[arch-projects] [devtools] [PATCH] commitpkg: Sync changelog/install check with makepkg(8)

Lukas Fleischer archlinux at cryptocrack.de
Mon Oct 24 14:15:22 EDT 2011


makepkg(8) currently uses a smarter method to extract all changelog and
install files from a PKGBUILD. Sync commitpkg to use the same code (with
small modifications). This also adds support for changelog/install files
that contain a whitespace.

Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 commitpkg.in |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/commitpkg.in b/commitpkg.in
index 2a732b5..43cc015 100644
--- a/commitpkg.in
+++ b/commitpkg.in
@@ -86,14 +86,13 @@ done
 
 # check if changelog and install files are under version control
 for i in 'changelog' 'install'; do
-	filelist=$(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD)
-	for file in $filelist; do
+	while read -r file; do
 		# evaluate any bash variables used
-		eval file=${file}
+		eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
 		if ! svn status -v "${file}" | grep -q '^[ AMRX~]'; then
 			abort "${file} is not under version control"
 		fi
-	done
+	done < <(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD)
 done
 
 # see if any limit options were passed, we'll send them to rsync
-- 
1.7.7



More information about the arch-projects mailing list