Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2019-11-13 22:46:41 +0000
committerAnton Hvornum <anton.feeds+github@gmail.com>2019-11-13 22:46:41 +0000
commit9627e2079b663b9dfdd561001255eb1aca26014d (patch)
treed227395de008e18286bf3b697016af1075206140
parentd08f9835a21a8f3101a4cf05de975bf41a076a67 (diff)
Improiving on git branch switching
-rw-r--r--archinstall.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/archinstall.py b/archinstall.py
index b9e08de2..4c4fd116 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -336,13 +336,15 @@ def update_git(branch='master'):
# if(num_changes):
if branch != 'master':
- print(f'[N] Changing branch to {branch}')
- output = simple_command(f'(cd /root/archinstall; git checkout {branch}; git pull)')
- print('[N] Rebooting the new branch')
- if not 'rebooted' in args:
- os.execv('/usr/bin/python3', ['archinstall.py'] + sys.argv + ['--rebooted','--rerun'])
- else:
- os.execv('/usr/bin/python3', ['archinstall.py'] + sys.argv + ['--rerun',])
+ on_branch = simple_command('(cd /root/archinstall; git branch | grep "*" | cut -d\' \' -f 2)')
+ if on_branch.strip().lower() != branch.strip().lower():
+ print(f'[N] Changing branch to {branch}')
+ output = simple_command(f'(cd /root/archinstall; git checkout {branch}; git pull)')
+ print('[N] Rebooting the new branch')
+ if not 'rebooted' in args:
+ os.execv('/usr/bin/python3', ['archinstall.py'] + sys.argv + ['--rebooted','--rerun'])
+ else:
+ os.execv('/usr/bin/python3', ['archinstall.py'] + sys.argv + ['--rerun',])
if not 'rebooted' in args:
## Reboot the script (in same context)