summaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorAaron Bockover <abockover@novell.com>2010-04-27 07:56:25 -0400
committerGabriel Burt <gabriel.burt@gmail.com>2010-05-05 12:54:04 -0700
commitf9956d361c3654329a705c3fb86178c0ffa1c841 (patch)
treeca4ca0324c1361be749dd2e980898c289ba84a67 /extras
parentfccd1d734f50e825dacdd5e6f45e7c4189ca69f1 (diff)
push-meego: only push changes since last push
Also kill the Xorg process. Sometimes killing mutter isn't enough.
Diffstat (limited to 'extras')
-rwxr-xr-xextras/push-meego27
1 files changed, 24 insertions, 3 deletions
diff --git a/extras/push-meego b/extras/push-meego
index 1068cc836..6b7e7f43b 100755
--- a/extras/push-meego
+++ b/extras/push-meego
@@ -7,21 +7,42 @@ import subprocess
prefix = '/usr/lib/banshee-1'
exclude_files = []
sync_files = {}
+last_sync_files = {}
+
+try:
+ with open ('bin/.last-meego-push') as fp:
+ for entry in fp:
+ path, mtime = entry.split ('\t')
+ last_sync_files[path] = float (mtime)
+except:
+ pass
for path in subprocess.Popen (['meego-ssh', 'find', prefix],
stdout = subprocess.PIPE).communicate ()[0].split ('\n'):
basename = os.path.basename (path)
bin_path = os.path.join ('bin', basename)
-
- if not os.path.isfile (bin_path) or basename in exclude_files:
+
+ if not os.path.isfile (bin_path) or basename in exclude_files \
+ or (bin_path in last_sync_files and \
+ last_sync_files[bin_path] >= os.stat (bin_path).st_mtime):
continue
relpath = os.path.relpath (path, prefix)
dirname = os.path.dirname (relpath)
+
if dirname not in sync_files:
sync_files[dirname] = []
sync_files[dirname].append (bin_path)
+ last_sync_files[bin_path] = os.stat (bin_path).st_mtime
+
+if len (sync_files) == 0:
+ print 'Nothing to sync.'
+ sys.exit (0)
+
+with open ('bin/.last-meego-push', 'w') as fp:
+ for bin_path, mtime in last_sync_files.iteritems ():
+ fp.write ('%s\t%f\n' % (bin_path, mtime))
for dirname, files in sync_files.iteritems ():
scp = ['meego-scp', '-u', 'root']
@@ -29,4 +50,4 @@ for dirname, files in sync_files.iteritems ():
scp.append (os.path.abspath (os.path.join (prefix, dirname)))
os.waitpid (subprocess.Popen (scp).pid, 0)
-subprocess.call (['meego-ssh', 'killall', '-9', 'mutter', 'banshee-1'])
+subprocess.call (['meego-ssh', 'killall', '-9', 'Xorg', 'mutter', 'banshee-1'])