packages: builder - unify func declaration - checkout rpm.groups in --init-...

glen glen at pld-linux.org
Wed Apr 29 10:43:51 CEST 2009


Author: glen                         Date: Wed Apr 29 08:43:51 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- unify func declaration
- checkout rpm.groups in --init-rpm-dir

---- Files affected:
packages:
   builder (1.574 -> 1.575) 

---- Diffs:

================================================================
Index: packages/builder
diff -u packages/builder:1.574 packages/builder:1.575
--- packages/builder:1.574	Tue Apr 28 14:51:56 2009
+++ packages/builder	Wed Apr 29 10:43:45 2009
@@ -31,7 +31,7 @@
 VERSION="v0.23/$rev"
 VERSIONSTRING="\
 Build package utility from PLD Linux CVS repository
-$VERSION (C) 1999-2008 Free Penguins".
+$VERSION (C) 1999-2009 Free Penguins".
 
 PATH="/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11R6/bin"
 
@@ -206,8 +206,7 @@
 POLDEK_INDEX_DIR="$($RPM --eval %_rpmdir)/"
 POLDEK_CMD="$SU_SUDO /usr/bin/poldek --noask"
 
-run_poldek()
-{
+run_poldek() {
 	RES_FILE=$(mktemp -t builder.XXXXXX || ${TMPDIR:-/tmp}/builder.$RANDOM)
 	if [ -n "$LOGFILE" ]; then
 		LOG=`eval echo $LOGFILE`
@@ -226,8 +225,7 @@
 #---------------------------------------------
 # functions
 
-usage()
-{
+usage() {
 	if [ -n "$DEBUG" ]; then set -xv; fi
 	echo "\
 Usage: builder [-D|--debug] [-V|--version] [--short-version] [-a|--as_anon] [-b|-ba|--build]
@@ -536,8 +534,7 @@
 	echo "$rpm_dump_cache"
 }
 
-get_icons()
-{
+get_icons() {
 	update_shell_title "get icons"
 	ICONS=$(awk '/^Icon:/ {print $2}' ${ASSUMED_NAME}/${SPECFILE})
 	if [ -z "$ICONS" ]; then
@@ -547,8 +544,7 @@
 	rpm_dump_cache="kalasaba" NODIST="yes" get_files $ICONS
 }
 
-parse_spec()
-{
+parse_spec() {
 	update_shell_title "parsing specfile"
 	if [ -n "$DEBUG" ]; then
 		set -x
@@ -599,8 +595,7 @@
 	update_shell_title "parse_spec: OK!"
 }
 
-Exit_error()
-{
+Exit_error() {
 	if [ -n "$DEBUG" ]; then
 		set -x
 		set -v
@@ -653,8 +648,7 @@
 	exit 100
 }
 
-init_builder()
-{
+init_builder() {
 	if [ -n "$DEBUG" ]; then
 		set -x
 		set -v
@@ -672,8 +666,7 @@
 	__PWD=$(pwd)
 }
 
-get_spec()
-{
+get_spec() {
 
 	update_shell_title "get_spec"
 
@@ -713,8 +706,7 @@
 	set_spec_target
 }
 
-find_mirror()
-{
+find_mirror() {
 	cd "$REPO_DIR"
 	local url="$1"
 	if [ ! -f "mirrors" -a "$NOCVSSPEC" != "yes" ] ; then
@@ -740,8 +732,7 @@
 }
 
 # Warning: unpredictable results if same URL used twice
-src_no ()
-{
+src_no() {
 	cd $PACKAGE_DIR
 	rpm_dump | \
 	grep "SOURCEURL[0-9]*[ 	]*$1""[ 	]*$" | \
@@ -749,8 +740,7 @@
 	head -n 1 | xargs
 }
 
-src_md5()
-{
+src_md5() {
 	[ "$NO5" = "yes" ] && return
 	no=$(src_no "$1")
 	[ -z "$no" ] && return
@@ -795,36 +785,30 @@
 	fi
 }
 
-distfiles_path ()
-{
+distfiles_path() {
 	echo "by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
 }
 
-distfiles_url ()
-{
+distfiles_url() {
 	echo "$PROTOCOL$DISTFILES_SERVER/distfiles/$(distfiles_path "$1")"
 }
 
-distfiles_attic_url ()
-{
+distfiles_attic_url() {
 	echo "$PROTOCOL$ATTICDISTFILES_SERVER/distfiles/Attic/$(distfiles_path "$1")"
 }
 
-good_md5 ()
-{
+good_md5() {
 	md5=$(src_md5 "$1")
 	[ "$md5" = "" ] || \
 	[ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ]
 }
 
-good_size ()
-{
+good_size() {
 	size=$(find $(nourl "$1") -printf "%s" 2>/dev/null)
 	[ -n "$size" -a "$size" -gt 0 ]
 }
 
-cvsignore_df ()
-{
+cvsignore_df() {
 	if [ "$CVSIGNORE_DF" != "yes" ]; then
 		return
 	fi
@@ -834,8 +818,7 @@
 	fi
 }
 
-cvsup()
-{
+cvsup() {
 	update_shell_title "cvsup"
 	local OPTIONS="up "
 
@@ -884,8 +867,7 @@
 }
 
 # returns true if "$1" is ftp, http or https protocol url
-is_url()
-{
+is_url() {
 	case "$1" in
 	ftp://*|http://*|https://*)
 		return 0
@@ -894,8 +876,7 @@
 	return 1
 }
 
-update_md5()
-{
+update_md5() {
 	if [ $# -eq 0 ]; then
 		return
 	fi
@@ -957,8 +938,7 @@
 	done
 }
 
-check_md5()
-{
+check_md5() {
 	[ "$NO5" = "yes" ] && return
 
 	update_shell_title "check md5"
@@ -974,8 +954,7 @@
 	done
 }
 
-get_files()
-{
+get_files() {
 	update_shell_title "get_files"
 
 	if [ -n "$DEBUG" ]; then
@@ -1208,8 +1187,7 @@
 	return $?
 }
 
-tag_files()
-{
+tag_files() {
 	TAG_FILES="$@"
 
 	if [ -n "$DEBUG" ]; then
@@ -1290,8 +1268,7 @@
 	fi
 }
 
-branch_files()
-{
+branch_files() {
 	TAG=$1
 	echo "CVS branch tag: $TAG"
 	shift
@@ -1347,9 +1324,7 @@
 	fi
 }
 
-
-build_package()
-{
+build_package() {
 	update_shell_title "build_package"
 	if [ -n "$DEBUG" ]; then
 		set -x
@@ -1443,19 +1418,16 @@
 	unset BUILD_SWITCH
 }
 
-nourl()
-{
+nourl() {
 	echo "$@" | sed 's#\<\(ftp\|http\|https\|cvs\|svn\)://[^ ]*/##g'
 }
 
-install_required_packages()
-{
+install_required_packages() {
 	run_poldek -vi $1
 	return $?
 }
 
-find_spec_bcond() {
-	# originally from /usr/lib/rpm/find-spec-bcond
+find_spec_bcond() { # originally from /usr/lib/rpm/find-spec-bcond
 	local SPEC="$1"
 	awk -F"\n" '
 	/^%changelog/ { exit }
@@ -1563,8 +1535,7 @@
 	done
 }
 
-run_sub_builder()
-{
+run_sub_builder() {
 	package_name="${1}"
 	update_shell_title "run_sub_builder $package_name"
 	#
@@ -1599,8 +1570,7 @@
 	NOT_INSTALLED_PACKAGES="$NOT_INSTALLED_PACKAGES $package_name"
 }
 
-spawn_sub_builder()
-{
+spawn_sub_builder() {
 	package_name="${1}"
 	update_shell_title "spawn_sub_builder $package_name"
 
@@ -1621,8 +1591,7 @@
 	./builder ${sub_builder_opts} "$@"
 }
 
-remove_build_requires()
-{
+remove_build_requires() {
 	if [ "$INSTALLED_PACKAGES" != "" ]; then
 		case "$REMOVE_BUILD_REQUIRES" in
 			"force")
@@ -1640,8 +1609,7 @@
 	fi
 }
 
-display_bconds()
-{
+display_bconds() {
 	if [ "$AVAIL_BCONDS_WITH" -o "$AVAIL_BCONDS_WITHOUT" ]; then
 		if [ "$BCOND" ]; then
 			echo -ne "\nBuilding $SPECFILE with the following conditional flags:\n"
@@ -1654,8 +1622,7 @@
 	fi
 }
 
-display_branches()
-{
+display_branches() {
 	if [ "$NOCVSSPEC" != "yes" ]; then
 		echo -ne "Available branches: "
 		$CVS_COMMAND status -v "${SPECFILE}" | awk '!/Sticky Tag:/ && /\(branch:/ { print $1 } ' | xargs
@@ -1665,8 +1632,7 @@
 # checks a given list of packages/files/provides agains current rpmdb.
 # outputs all dependencies which current rpmdb doesn't satisfy.
 # input can be either STDIN or parameters
-_rpm_prov_check()
-{
+_rpm_prov_check() {
 	local DEPS
 
 	if [ $# -gt 0 ]; then
@@ -1687,8 +1653,7 @@
 # checks if given package/files/provides exists in rpmdb.
 # input can be either stdin or parameters
 # returns packages which are present in the rpmdb
-_rpm_cnfl_check()
-{
+_rpm_cnfl_check() {
 	local DEPS
 
 	if [ $# -gt 0 ]; then
@@ -1904,7 +1869,7 @@
 	echo "Initialising rpm directories to $TOP_DIR from $CVSROOT"
 	mkdir -p $TOP_DIR/{RPMS,BUILD,SRPMS}
 	cd $TOP_DIR
-	$CVS_COMMAND -d $CVSROOT co packages/{.cvsignore,dropin,mirrors,md5,adapter{,.awk},fetchsrc_request,builder,{relup,compile,repackage}.sh}
+	$CVS_COMMAND -d $CVSROOT co packages/{.cvsignore,rpm.groups,dropin,mirrors,md5,adapter{,.awk},fetchsrc_request,builder,{relup,compile,repackage}.sh}
 
 	init_builder
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/builder?r1=1.574&r2=1.575&f=u



More information about the pld-cvs-commit mailing list