--- ds-backup.py.orig	2009-07-25 16:25:35.672440478 +0800
+++ ds-backup.py	2009-07-24 21:16:36.918858188 +0800
@@ -27,6 +27,7 @@
 import glob
 import popen2
 import re
+import gconf
 
 from sugar import env
 from sugar import profile
@@ -86,7 +87,7 @@
     # Note: the dest dir on the XS is watched via
     # inotify - so we avoid creating tempfiles there.
     tmpfile = tempfile.mkstemp()
-    rsync = ("/usr/bin/rsync -a -rlt --timeout 10 -T /tmp -e '%s' '%s' '%s' "
+    rsync = ("/usr/bin/rsync -z -rlt --timeout 10 -T /tmp -e '%s' '%s' '%s' "
              % (ssh, tmpfile[1], 'schoolserver:/var/lib/ds-backup/completion/'+user))
     rsync_p = popen2.Popen3(rsync, True)
     rsync_exit = os.WEXITSTATUS(rsync_p.wait())
@@ -108,6 +109,20 @@
     fh.close()
     return data
 
+def get_soas_sn():
+  soas_dir = '/home/liveuser/.sugar/soas/'
+  fh = open(os.path.join(soas_dir, 'sn'),'r')
+  data = fh.read().rstrip('\0\n')
+  fh.close()
+  return data
+
+def get_soas_uuid():
+  soas_dir = '/home/liveuser/.sugar/soas/'
+  fh = open(os.path.join(soas_dir, 'uuid'),'r')
+  data = fh.read().rstrip('\0\n')
+  fh.close()
+  return data
+
 # if run directly as script
 if __name__ == "__main__":
 
@@ -116,7 +131,11 @@
     if have_ofw_tree():
         sn = read_ofw('mfg-data/SN')
     else:
-        sn = 'SHF00000000'
+      # HAM : SoaS
+      # sn = 'SHF00000000'
+      # client = gconf.client_get_default()
+      # sn = client.get_string('/desktop/sugar/soas_serial')
+      sn = get_soas_sn()
 
     ds_path = env.get_profile_path('datastore')
     pk_path = os.path.join(env.get_profile_path(), 'owner.key')
