diff --git a/euscanwww/INSTALL b/euscanwww/INSTALL index a32d7b0..e384d02 100644 --- a/euscanwww/INSTALL +++ b/euscanwww/INSTALL @@ -13,6 +13,13 @@ touch local_settings.py ./manage.py scan-portage htop # Scan ebuilds ./manage.py scan-metadata htop # Lookup for maintainers, herds, etc... ./manage.py scan-upstream htop # Run euscan + +# Scan dev-python +eix --only-names -C dev-python | ./manage.py scan-portage +eix --only-names -C dev-python | ./manage.py scan-metadata +eix --only-names -C dev-python | ./manage.py scan-upstream + +# Update counters at end of scan ./manage.py update-counters # Update counters, graphs, etc... # Start server diff --git a/euscanwww/euscan/management/commands/scan-metadata.py b/euscanwww/euscan/management/commands/scan-metadata.py index 863e36e..bb5e070 100644 --- a/euscanwww/euscan/management/commands/scan-metadata.py +++ b/euscanwww/euscan/management/commands/scan-metadata.py @@ -33,15 +33,15 @@ class Command(BaseCommand): help = 'Scans metadata and fills database' def handle(self, *args, **options): - if len(args) == 0 and options['all'] == False: - raise CommandError('You must specify a package or use --all') - - if len(args) == 0: + if options['all']: for pkg in Package.objects.all(): self.scan(options, '%s/%s' % (pkg.category, pkg.name)) - else: + elif len(args): for package in args: self.scan(options, package) + else: + for package in sys.stdin.readlines(): + self.scan(options, package[:-1]) @commit_on_success def scan(self, options, query=None): diff --git a/euscanwww/euscan/management/commands/scan-portage.py b/euscanwww/euscan/management/commands/scan-portage.py index d6c6a13..82e5532 100644 --- a/euscanwww/euscan/management/commands/scan-portage.py +++ b/euscanwww/euscan/management/commands/scan-portage.py @@ -36,21 +36,21 @@ class Command(BaseCommand): default=False, help='Be quiet'), ) - args = '' + args = '[package package ...]' help = 'Scans portage tree and fills database' def handle(self, *args, **options): - if len(args) == 0 and options['all'] == False: - raise CommandError('You must specify a package or use --all') - if not options['quiet']: self.stdout.write('Scanning portage tree...\n') - if len(args) == 0: + if options['all']: self.scan(options) - else: + elif len(args): for package in args: self.scan(options, package) + else: + for package in sys.stdin.readlines(): + self.scan(options, package[:-1]) if options['purge-versions']: self.purge_versions(options) diff --git a/euscanwww/euscan/management/commands/scan-upstream.py b/euscanwww/euscan/management/commands/scan-upstream.py index 241fc66..0a2ee35 100644 --- a/euscanwww/euscan/management/commands/scan-upstream.py +++ b/euscanwww/euscan/management/commands/scan-upstream.py @@ -42,9 +42,6 @@ class Command(BaseCommand): help = 'Scans metadata and fills database' def handle(self, *args, **options): - if len(args) == 0 and options['all'] == False and options['feed'] == False: - raise CommandError('You must specify a package or use --all') - if options['feed']: self.parse_output(options, sys.stdin) if options['purge-versions']: @@ -56,11 +53,13 @@ class Command(BaseCommand): packages = [] - if len(args) == 0: + if options['all']: for pkg in Package.objects.all(): packages.append('%s/%s' % (pkg.category, pkg.name)) - else: + elif args: packages = list(args) + else: + packages = [ package[:-1] for package in sys.stdin.readlines() ] self.scan(options, packages)