euscanwww: take args from stdin and update INSTALL
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
This commit is contained in:
@ -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):
|
||||
|
@ -36,21 +36,21 @@ class Command(BaseCommand):
|
||||
default=False,
|
||||
help='Be quiet'),
|
||||
)
|
||||
args = '<package package ...>'
|
||||
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)
|
||||
|
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user