[pacman-dev] [PATCH v1] paccache: parse_filename bug fix

Maxim Andersson thesilentboatman at gmail.com
Sun Sep 28 23:06:00 UTC 2014


Filenames got parsed wrongly, causing whitelist- and blacklist-checks to always return false.

Bug appeared when full path names to pkgs were introduced.

Signed-off-by: Maxim Andersson <thesilentboatman at gmail.com>
---
 contrib/paccache.sh.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/contrib/paccache.sh.in b/contrib/paccache.sh.in
index eba315c..ce64d93 100644
--- a/contrib/paccache.sh.in
+++ b/contrib/paccache.sh.in
@@ -56,9 +56,11 @@ pkgfilter() {
 	# script after the block of awk.
 
 	awk -v keep="$1" -v scanarch="$2" '
-	function parse_filename(filename,     parts, count, i, pkgname, arch) {
+	function parse_filename(filename,     basename, parts, count, i, pkgname, arch) {
 
-		count = split(filename, parts, "-")
+		basename = filename
+		sub(".*/", "", basename)
+		count = split(basename, parts, "-")
 
 		i = 1
 		pkgname = parts[i++]
-- 
2.1.1


More information about the pacman-dev mailing list