Overlay/app-portage/ewo/files/fix_empty_genlop_output.patch

17 lines
647 B
Diff

--- ewo.py 2010-01-29 18:44:36.000000000 +0300
+++ ewo.py 2015-02-08 10:51:06.136410426 +0300
@@ -66,7 +66,12 @@
def get_latest_sync_date():
raw_genlop_pattern = re.compile('\s+rsync\'ed at >>> ([^\s]+.*)')
- raw_genlop = commands.getstatusoutput('genlop -rn | tail -n3')
+ raw_genlop = commands.getstatusoutput('genlop -rn | tail -n3 | sed "s~ Git pulled~rsync\'ed~"')
+
+ # Fixing empty genlop output
+ if raw_genlop[1] == "":
+ raw_genlop = commands.getstatusoutput ('echo " rsync\'ed at >>> Sat Jan 1 00:00:00 2000"')
+
if raw_genlop[0] == 0:
# index -1 means last list element
raw_latest_sync = raw_genlop[1].split('\n')[-1]