diff options
Diffstat (limited to 'utils/grumpy_sync.py')
-rwxr-xr-x | utils/grumpy_sync.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/utils/grumpy_sync.py b/utils/grumpy_sync.py index 20c4674..3de226f 100755 --- a/utils/grumpy_sync.py +++ b/utils/grumpy_sync.py @@ -4,13 +4,12 @@ import os, sys from datetime import datetime from fnmatch import fnmatch +from optparse import OptionParser + from pkgcore.config import load_config from pkgcore.cache import metadata from pkgcore.ebuild import repository -from sqlalchemy import create_engine -from sqlalchemy.orm import scoped_session, sessionmaker - from snakeoil.fileutils import iter_read_bash path = os.path.join(os.path.dirname(__file__), os.path.pardir) @@ -202,7 +201,11 @@ def main(path): package_update(cat, pkg, files, int(os.stat(dir).st_mtime)) if __name__ == '__main__': - if len(sys.argv) != 2: - print "Please provide path to portage directory as argument" - sys.exit() - main(sys.argv[1]) + parser = OptionParser(usage="usage: %prog [options] portagedir") + parser.add_option("-i", "--initial-sync", action="store_true", \ + dest="initial", help="Skips handling of package moves") + (opts, args) = parser.parse_args() + if len(args) != 1: + parser.error("please provide path to portagedir as first argument") + sys.exit(1) + main(args[0]) |