Ticket #916: ds-backup.py.diff

File ds-backup.py.diff, 1.7 KB (added by hamiltonchua, 15 years ago)
Line 
1*** ds-backup-orig.py   2009-06-01 22:09:23.000000000 +0800
2--- ds-backup.py        2009-06-01 21:52:32.000000000 +0800
3***************
4*** 27,32 ****
5--- 27,33 ----
6  import glob
7  import popen2
8  import re
9+ import gconf
10 
11  from sugar import env
12  from sugar import profile
13***************
14*** 86,92 ****
15      # Note: the dest dir on the XS is watched via
16      # inotify - so we avoid creating tempfiles there.
17      tmpfile = tempfile.mkstemp()
18!     rsync = ("/usr/bin/rsync -z -rlt --timeout 10 -T /tmp -e '%s' '%s' '%s' "
19               % (ssh, tmpfile[1], 'schoolserver:/var/lib/ds-backup/completion/'+user))
20      rsync_p = popen2.Popen3(rsync, True)
21      rsync_exit = os.WEXITSTATUS(rsync_p.wait())
22--- 87,93 ----
23      # Note: the dest dir on the XS is watched via
24      # inotify - so we avoid creating tempfiles there.
25      tmpfile = tempfile.mkstemp()
26!     rsync = ("/usr/bin/rsync -a -rlt --timeout 10 -T /tmp -e '%s' '%s' '%s' "
27               % (ssh, tmpfile[1], 'schoolserver:/var/lib/ds-backup/completion/'+user))
28      rsync_p = popen2.Popen3(rsync, True)
29      rsync_exit = os.WEXITSTATUS(rsync_p.wait())
30***************
31*** 116,122 ****
32      if have_ofw_tree():
33          sn = read_ofw('mfg-data/SN')
34      else:
35!         sn = 'SHF00000000'
36 
37      ds_path = env.get_profile_path('datastore')
38      pk_path = os.path.join(env.get_profile_path(), 'owner.key')
39--- 117,126 ----
40      if have_ofw_tree():
41          sn = read_ofw('mfg-data/SN')
42      else:
43!       # HAM : SoaS
44!         # sn = 'SHF00000000'
45!       client = gconf.client_get_default()
46!       sn = client.get_string('/desktop/sugar/soas_serial')
47 
48      ds_path = env.get_profile_path('datastore')
49      pk_path = os.path.join(env.get_profile_path(), 'owner.key')