[arch-projects] [PATCH] [namcap] Treat all non-tar files as PKGBUILD files, regardless of filename

Dave Reisner d at falconindy.com
Thu Jan 25 18:50:19 UTC 2018


On Thu, Jan 25, 2018 at 01:31:45PM -0500, Luke Shumaker wrote:
> From: Luke Shumaker <lukeshu at parabola.nu>
> 
> https://bugs.archlinux.org/task/57193
> 
> If the user mistakenly passes in some other (non-package, non-PKGBUILD)
> file, instead of refusing to process it (saying
> "Error: Cannot process ${filename}"), it will now try to parse it as a
> PKGBUILD, probably encounter and print at least one error, but finally say
> "Error: ${filename} is not a valid PKGBUILD".  This is actually probably
> *more* helpful to a confused user who passed in the wrong file.
> ---
>  namcap.py | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/namcap.py b/namcap.py
> index b62a2fa..fd62d3c 100755
> --- a/namcap.py
> +++ b/namcap.py
> @@ -248,9 +248,7 @@ for package in packages:
>  
>  	if os.path.isfile(package) and tarfile.is_tarfile(package):
>  		process_realpackage(package, active_modules)
> -	elif package.endswith('PKGBUILD'):
> +	else:

Install files? Other assets? Doesn't this mean we assume they're
PKGBUILDs?

>  		process_pkgbuild(package, active_modules)
> -	else:
> -		print("Error: Cannot process %s" % package)
>  
>  # vim: set ts=4 sw=4 noet:
> -- 
> 2.15.1


More information about the arch-projects mailing list