Simple change from using getopt to using argparse. Also fixes
https://bugs.archlinux.org/task/56995
diff --git a/namcap.py b/namcap.py
index a7f532a..bb2754e 100755
--- a/namcap.py
+++ b/namcap.py
@@ -19,10 +19,10 @@
#
#
-import getopt
import os
import sys
import tarfile
+import argparse
import
Adds handling of the compression and temporary storage into namcap.py so it can
be removed from the bash script. https://bugs.archlinux.org/task/59844 mentions
"use setuptools entry points." instead of the bash script but I don't know how
to do that. I just removed it from the bash script for no
x27;).name)
+ subprocess.run(cmd + ' -dcf ' + extra_opts + pkgpath.as_posix()
+ ' > ' + tmpfilepath.as_posix(), shell=True)
+
+ if tmpfilepath.is_file() and xtarfile.is_tarfile(tmpfilepath):
+ process_realpackage(package, a
ion as err:
+ print("File doesn't exist or isn't a tar
file:", package, err)
+ sys.exit(1)
+
+ except TypeError as err: # The tar file doesn't contain a
.PKGINFO file
+ print(err)
+
Fixed some potential bugs and made it all around better. I'm working on
upstreaming support in xtarfile for LZ4 compression so hopefully the special
handling for that can be removed soon. I also fixed a bug in xtarfile that
prevents .tar files from being opened. So once the new version hits the