Commit aa06caf3 authored by Lukas Fleischer's avatar Lukas Fleischer Committed by Pierre Schmitz
Browse files

Abort properly if source files are not under version control (FS#23122).



Remove superfluous subshell code from version control checks in
commitpkg, making it exit properly if source files are not under version
control. Also, improve correctness of sed(1) commands and use fgrep(1)
instead of grep(1) where appropriate.

Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: default avatarPierre Schmitz <pierre@archlinux.de>
parent 08a68bb4
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -85,23 +85,23 @@ else
fi

# check if all local source files are under version control
(for s in ${source[@]}; do
	echo $s | grep -vq '://' && \
	svn status $s | grep -q '?' && \
for s in ${source[@]}; do
	echo $s | grep -Fvq '://' && \
	svn status $s | grep -q '^\?' && \
	abort "$s is not under version control"
done) || true
done

# check if changelog and install files are under version control
(for i in 'changelog' 'install'; do
for i in 'changelog' 'install'; do
	filelist=$(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD)
	for file in $filelist; do
		# evaluate any bash variables used
		eval file=${file}
		if svn status ${file} | grep -q '?'; then
		if svn status ${file} | grep -q '^\?'; then
			abort "${file} is not under version control"
		fi
	done
done) || true
done

# see if any limit options were passed, we'll send them to rsync
unset rsyncopts