[Frugalware-darcs] pacman: makepkg: added up2date feature

VMiklos vmiklos at frugalware.org
Mon Dec 26 02:03:59 CET 2005


[makepkg: added up2date feature
VMiklos <vmiklos at frugalware.org>**20051210185700
 see the manpage!
] {
hunk ./doc/makepkg.8.in 43
+up2date="lynx -dump http://www.kernel.org/pub/linux/utils/kernel/modutils/v2.4/|grep LATEST |sed -n 's/.*S-\([0-9\.]*\) .*/\1/; 1 p'"
hunk ./doc/makepkg.8.in 266
+.TP
+.B up2date
+This directive should contain a command that prints the current upstream stable
+version of the project. This way we can check for newer version without visiting
+manually the project's website (see above).
+
hunk ./doc/makepkg.8.in 408
+.B "\-u, \-\-noup2date"
+Do not check for newer version before starting build. Normally makepkg will
+prevent you from building obsolete source by mistake. If you know what you are
+doing, you can disable this feature with this switch.
+.TP
hunk ./scripts/makepkg 220
+	echo "  -u, --noup2date  Do not check for newer version"
hunk ./scripts/makepkg 247
+NOUP2DATE=0
hunk ./scripts/makepkg 271
+		--noup2date)  NOUP2DATE=1 ;;
hunk ./scripts/makepkg 282
-			while getopts "abBcCdefghij:Lmnop:rsSw:-" opt; do
+			while getopts "abBcCdefghij:Lmnop:ursSw:-" opt; do
hunk ./scripts/makepkg 307
+					u) NOUP2DATE=1 ;;
hunk ./scripts/makepkg 447
+# version checking
+if [ "$NOUP2DATE" = "0" ]; then
+	msg "Checking for newer version..."
+	if echo "$up2date"|grep -q " "; then
+		cmd=`echo "$up2date"|sed 's/^\([^ ]*\) .*/\1/'`
+		if type -p $cmd &>/dev/null; then
+			up2date=`eval "$up2date"`
+		else
+			warning "The $cmd program is missing.  Cannot check for newer version!"
+			up2date=""
+			sleep 1
+		fi
+	fi
+	if [ -z "$up2date" ]; then
+		warning "Version checking informations are missing. Cannot check for newer version."
+	else
+		if [ "$pkgver" != "$up2date" ]; then
+			echo "   FAILED" >&2
+			error "Newer version available! ($pkgver < $up2date)"
+			exit 1
+		else
+		echo "   Passed" >&2
+		fi
+	fi
+fi
+
}


More information about the Frugalware-darcs mailing list