Faulty git update/pull logic. a reset and pull at the same time will make it contain a lot more information

This commit is contained in:
Anton Hvornum 2019-06-20 18:15:40 +00:00
parent 9e9c8e0051
commit abaf778241
1 changed files with 11 additions and 10 deletions

View File

@ -269,16 +269,17 @@ def update_git():
return return
# b'From github.com:Torxed/archinstall\n 339d687..80b97f3 master -> origin/master\nUpdating 339d687..80b97f3\nFast-forward\n README.md | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n' # b'From github.com:Torxed/archinstall\n 339d687..80b97f3 master -> origin/master\nUpdating 339d687..80b97f3\nFast-forward\n README.md | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n'
if not b'Already up to date' in output: if output != b'Already up to date':
tmp = re.findall(b'[0-9]+ file changed', output) #tmp = re.findall(b'[0-9]+ file changed', output)
print(tmp) #print(tmp)
if len(tmp): #if len(tmp):
num_changes = int(tmp[0].split(b' ',1)[0]) # num_changes = int(tmp[0].split(b' ',1)[0])
if(num_changes): # if(num_changes):
## Reboot the script (in same context)
print('[N] Rebooting the script') ## Reboot the script (in same context)
os.execv('/usr/bin/python3', ['archinstall.py'] + sys.argv) print('[N] Rebooting the script')
extit(1) os.execv('/usr/bin/python3', ['archinstall.py'] + sys.argv)
extit(1)
def device_state(name): def device_state(name):
# Based out of: https://askubuntu.com/questions/528690/how-to-get-list-of-all-non-removable-disk-device-names-ssd-hdd-and-sata-ide-onl/528709#528709 # Based out of: https://askubuntu.com/questions/528690/how-to-get-list-of-all-non-removable-disk-device-names-ssd-hdd-and-sata-ide-onl/528709#528709