diff options
author | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-11-09 00:04:17 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-11-09 00:04:17 (GMT) |
commit | 2224d9ab6b1d8af808d20ac13c2f67b80853cdd3 (patch) | |
tree | 2313b82207f324c3167993bfab33fe233483e6a0 | |
parent | 25a164a3c12c1e6a28cfed75b014f900251b7686 (diff) |
Better check to decide if we need to update jhbuild.
-rwxr-xr-x | sugar-jhbuild | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sugar-jhbuild b/sugar-jhbuild index 74c64de..8146547 100755 --- a/sugar-jhbuild +++ b/sugar-jhbuild @@ -3,6 +3,7 @@ import os import sys import subprocess +import optparse base_dir = os.path.abspath(os.path.dirname(__file__)) jhbuild_dir = os.path.join(base_dir, 'jhbuild') @@ -10,9 +11,12 @@ jhbuild_dir = os.path.join(base_dir, 'jhbuild') sys.path.append(os.path.join(base_dir, 'scripts')) sys.path.append(jhbuild_dir) +parser = optparse.OptionParser() +parser.disable_interspersed_args() +options, args = parser.parse_args(sys.argv[1:]) + if os.path.exists(jhbuild_dir): - if len(sys.argv) == 1 or (len(sys.argv) > 1 and \ - sys.argv[1] in ('build', 'update')): + if not args or args[0] in ('build', 'update'): print 'Updating sugar-jhbuild...' retcode = subprocess.call(['git', 'pull']) |