pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/url2pkg/files url2pkg: only accept a single U...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5313e50cacde
branches:  trunk
changeset: 373115:5313e50cacde
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Feb 06 18:04:50 2022 +0000

description:
url2pkg: only accept a single URL as command line argument

diffstat:

 pkgtools/url2pkg/files/url2pkg.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 8993910c8fa7 -r 5313e50cacde pkgtools/url2pkg/files/url2pkg.py
--- a/pkgtools/url2pkg/files/url2pkg.py Sun Feb 06 18:00:08 2022 +0000
+++ b/pkgtools/url2pkg/files/url2pkg.py Sun Feb 06 18:04:50 2022 +0000
@@ -1,5 +1,5 @@
 #! @PYTHONBIN@
-# $NetBSD: url2pkg.py,v 1.37 2022/02/06 18:00:08 rillig Exp $
+# $NetBSD: url2pkg.py,v 1.38 2022/02/06 18:04:50 rillig Exp $
 
 # Copyright (c) 2019 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1226,7 +1226,7 @@
     except getopt.GetoptError:
         usage()
 
-    url = args[0] if args else usage()
+    url = args[0] if len(args) == 1 else usage()
     if not re.fullmatch(r'\w+://[!-~]+?/[!-~]+', url):
         sys.exit(f'url2pkg: invalid URL: {url}')
 



Home | Main Index | Thread Index | Old Index