Why not just use "-p" for explicitly specifying that we want to parse file as a PKGBUILD?26.01.2018, 00:41, "Luke Shumaker" :On Thu, 25 Jan 2018 13:50:19 -0500,Dave Reisner wrote: On Thu, Jan 25, 2018 at 01:31:45PM -0500, Luke Shumaker wrote: > From: Luke Shumaker
> But if we want to get fancy, we could:
>
> 1) add a dependency on python-magic and check for text/plain
> 2) read the file line by line to see if ^pkgname= exists anywhere.
Seems like a good idea. And maybe still process as PKGBUILD when file is named
just "PKGBUILD".
> How is "startswith" any less arbitrary than "endswith"? Because of some
> habit to move PKGBUILD to PKGBUILD.suffix?
Yes, as I already told at https://bugs.archlinux.org/task/57193:
I keep several PKGBUILD files in one directory, and they are named like
"PKGBUILD-project1" "PKGBUILD-project2"
Now you cannot randomly rename PKGBUILD files and use them with namcap. I have filed a bug here: https://bugs.archlinux.org/task/57193I created a patch for my needs: diff --git a/namcap.py b/namcap.pyindex b62a2fa..aae20c7 100755--- a/namcap.py+++ b/namcap.py@@ -248,7 +248,7 @@ for package in