]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- update from SPECS auto/ac/rpm-build-tools-4_4_9-15 auto/th/rpm-build-tools-4_4_9-16 auto/ti/rpm-build-tools-4_4_9-16
authorElan Ruusamäe <glen@pld-linux.org>
Sat, 5 Apr 2008 08:42:17 +0000 (08:42 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    adapter.awk -> 1.7
    builder -> 1.22

adapter.awk
builder

index fbdc077bee15092d24d051f2bf52e17a5fb01d0f..110a154219cd73cc8dc6340feb5b0bcbc446c46b 100644 (file)
@@ -18,6 +18,7 @@
 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 
 # TODO
+# - really long sourceX make preamble sorting totally fcked up (try snake.spec r1.1)
 # - parse ../PLD-doc/BuildRequires.txt and setup proper BR epoches?
 # - add "-nc" option to skip CVS interaction
 # - sort Summary(XX)
@@ -929,27 +930,7 @@ preamble == 1 {
                # assigning to $2 kills preamble formatting
                $2 = fixedsub(filename, url[n], $2)
 
-               # sourceforge urls
-               sub("[?&]big_mirror=.*$", "", $2);
-               sub("[?&]modtime=.*$", "", $2);
-
-               sub("[?]use_mirror=.*$", "", $2);
-               sub("[?]download$", "", $2);
-
-               sub("^http://prdownloads\.sourceforge\.net/", "http://dl.sourceforge.net/", $2)
-               sub("^http://download\.sf\.net/", "http://dl.sourceforge.net/", $2)
-               sub("^http://download\.sourceforge\.net/", "http://dl.sourceforge.net/", $2)
-               sub("^http://downloads\.sourceforge\.net/", "http://dl.sourceforge.net/", $2)
-
-               sub("^http://.*\.dl\.sourceforge\.net/", "http://dl.sourceforge.net/", $2)
-               sub("^http://dl\.sourceforge\.net/sourceforge/", "http://dl.sourceforge.net/", $2)
-               sub("^http://dl\.sf\.net/", "http://dl.sourceforge.net/", $2)
-
-               sub("^ftp://ftp\.gnome\.org/", "http://ftp.gnome.org/", $2)
-               sub("^http://ftp\.gnome\.org/pub/gnome/", "http://ftp.gnome.org/pub/GNOME/", $2)
-
-               # apache urls
-               sub("^http://apache.zone-h.org/", "http://www.apache.org/dist/", $2)
+               $2 = unify_url($2)
        }
 
 
@@ -1595,6 +1576,37 @@ function cflags(var)
        return 1
 }
 
+function unify_url(url)
+{
+
+       # sourceforge urls
+       sub("[?&]big_mirror=.*$", "", url);
+       sub("[?&]modtime=.*$", "", url);
+       sub("[?]use_mirror=.*$", "", url);
+       sub("[?]download$", "", url);
+
+       sub("^http://prdownloads\.sourceforge\.net/", "http://dl.sourceforge.net/", url)
+       sub("^http://download\.sf\.net/", "http://dl.sourceforge.net/", url)
+       sub("^http://download\.sourceforge\.net/", "http://dl.sourceforge.net/", url)
+       sub("^http://downloads\.sourceforge\.net/", "http://dl.sourceforge.net/", url)
+
+       sub("^http://.*\.dl\.sourceforge\.net/", "http://dl.sourceforge.net/", url)
+       sub("^http://dl\.sourceforge\.net/sourceforge/", "http://dl.sourceforge.net/", url)
+       sub("^http://dl\.sf\.net/", "http://dl.sourceforge.net/", url)
+
+       sub("^ftp://ftp\.gnome\.org/", "http://ftp.gnome.org/", url)
+       sub("^http://ftp\.gnome\.org/pub/gnome/", "http://ftp.gnome.org/pub/GNOME/", url)
+
+       # apache urls
+       sub("^http://apache.zone-h.org/", "http://www.apache.org/dist/", url)
+
+       # gnu.org
+       sub("^ftp://ftp.gnu.org/", "http://ftp.gnu.org/", url)
+       sub("^http://ftp.gnu.org/pub/gnu/", "http://ftp.gnu.org/gnu/", url)
+
+       return url
+}
+
 function demacroize(str)
 {
        if (mod_name) {
@@ -1626,11 +1638,14 @@ function demacroize(str)
 
 function kill_preamble_macros()
 {
-       if ($1 ~ /^URL:/ || $1 ~ /^Obsoletes:/) {
+       if ($1 ~ /^Obsoletes:/) {
+               # NB! assigning $2 a value breaks tabbing
+               $2 = demacroize($2);
+       }
+       if ($1 ~ /^URL:/) {
                # NB! assigning $2 a value breaks tabbing
                $2 = demacroize($2);
-               # unify sourceforge url
-               sub("\.sf\.net/$", ".sourceforge.net/", $2);
+               $2 = unify_url($2)
        }
 }
 
@@ -1705,6 +1720,7 @@ function replace_requires()
        sub(/^tftp-server$/, "tftpdaemon", $2);
 
        sub(/^gcc-c\+\+$/, "libstdc++-devel", $2);
+       sub(/^chkconfig$/, "/sbin/chkconfig", $2);
 
        replace_php_virtual_deps()
 }
diff --git a/builder b/builder
index 193fec4f0c459e210f092f760c1875db2846dabc..91141c490b74a47eaa13516353b5d2dadc3e5362 100644 (file)
--- a/builder
+++ b/builder
@@ -192,6 +192,13 @@ else
        RPMBUILD="rpmbuild"
 fi
 
+#
+# are we using cvs-nserver ?
+#
+CVS_NSERVER=0
+cvs --version 2>&1 | grep -q 'CVS-nserver'
+[ $? -eq 0 ] && CVS_NSERVER=1
+
 POLDEK_INDEX_DIR="`$RPM --eval %_rpmdir`/"
 POLDEK_CMD="$SU_SUDO /usr/bin/poldek --noask"
 
@@ -332,7 +339,7 @@ Usage: builder [-D|--debug] [-V|--version] [--short-version] [-a|--as_anon] [-b|
                     - as above, but allow float version
 --use-greed-sources
                     - try download source from tag head if don't find it in
-                      current tag      
+                      current tag
 -U, --update        - refetch sources, don't use distfiles, and update md5 comments
 -Upi, --update-poldek-indexes
                     - refresh or make poldek package index files.
@@ -1164,6 +1171,26 @@ make_tagver() {
        echo -n "$TAGVER"
 }
 
+# bool is_tag_a_branch(tag)
+#
+# returns 1 if a tag is a branch set on SPECFILE
+is_tag_a_branch() {
+       if [ -n "$DEBUG" ]; then
+               set -x
+               set -v
+       fi
+
+       if [ $# -ne 1 ]; then
+               return 0;
+       fi
+
+       TAG=$1
+
+       cd "$SPEC_DIR"
+       cvs status -v $SPECFILE | grep -Eiq "${TAG}.+(branch: [0-9.]+)"
+       return $?
+}
+
 tag_files()
 {
        TAG_FILES="$@"
@@ -1190,6 +1217,18 @@ tag_files()
                OPTIONS="-d $CVSROOT $OPTIONS"
        fi
 
+       # if a tagname we are about to set already exists
+       # and happens to be a branch (common case with AC-branch)
+       # pass -B (allows -F to disturb branch tag)
+       local _tag=$TAG
+       if [ "$TAG_VERSION" = "yes" ]; then
+               _tag=$TAGVER
+       fi;
+       is_tag_a_branch $_tag
+       if [ $? -eq 0 -a $CVS_NSERVER -eq 0 ]; then
+               OPTIONS="$OPTIONS -B"
+       fi;
+
        cd "$SOURCE_DIR"
        local tag_files
        for i in $TAG_FILES; do
@@ -1655,13 +1694,13 @@ display_branches()
 }
 
 # checks a given list of packages/files/provides agains current rpmdb.
-# outputs all dependencies whcih current rpmdb doesn't satisfy.
+# outputs all dependencies which current rpmdb doesn't satisfy.
 # input can be either STDIN or parameters
 _rpm_prov_check()
 {
        local DEPS
 
-       if [ "$#" -gt 0 ]; then
+       if [ $# -gt 0 ]; then
                DEPS="$@"
        else
                DEPS=$(cat)
@@ -1677,13 +1716,13 @@ _rpm_prov_check()
 }
 
 # checks if given package/files/provides exists in rpmdb.
-# inout can be either stdin or parameters
-# returns packages wchi hare present in the rpmdb
+# input can be either stdin or parameters
+# returns packages which are present in the rpmdb
 _rpm_cnfl_check()
 {
        local DEPS
 
-       if [ "$#" -gt 0 ]; then
+       if [ $# -gt 0 ]; then
                DEPS="$@"
        else
                DEPS=$(cat)
@@ -1708,7 +1747,7 @@ fetch_build_requires()
                        fi
 
                        if [ -n "$CNFL" ] || [ -n "$DEPS" ]; then
-                               echo "fetch builderequires: install [$DEPS]; remove [$CNFL]"
+                               echo "fetch BuildRequires: install [$DEPS]; remove [$CNFL]"
                                update_shell_title "poldek: install [$DEPS]; remove [$CNFL]"
                                $SU_SUDO /usr/bin/poldek -q --update || $SU_SUDO /usr/bin/poldek -q --upa
                        fi
@@ -1722,7 +1761,7 @@ fetch_build_requires()
                                        update_shell_title "install deps: $DEPS"
                                        echo "Trying to install dependencies ($DEPS):"
                                        local log=.${SPECFILE}_poldek.log
-                                       $SU_SUDO /usr/bin/poldek --caplookup -uGq $DEPS | tee $log
+                                       $SU_SUDO /usr/bin/poldek --caplookup -uGqQ $DEPS | tee $log
                                        failed=$(awk '/^error:/{a=$2; sub(/^error: /, "", a); sub(/:$/, "", a); print a}' $log)
                                        rm -f $log
                                        local ok
@@ -1888,7 +1927,7 @@ init_rpm_dir() {
 
        mkdir -p $TOP_DIR/{RPMS,BUILD,SRPMS}
        cd $TOP_DIR
-       cvs -d $CVSROOT co SOURCES/.cvsignore SPECS/{mirrors,md5,adapter{,.awk},fetchsrc_request,builder,{relup,compile,repackage}.sh}
+       cvs -d $CVSROOT co SOURCES/{.cvsignore,dropin} SPECS/{mirrors,md5,adapter{,.awk},fetchsrc_request,builder,{relup,compile,repackage}.sh}
 
        init_builder
 
@@ -1911,7 +1950,7 @@ get_greed_sources() {
        if [ $? != 0 ]; then
                Exit_error err_no_source_in_repo $1
        fi
-       
+
 }
 
 # remove entries from CVS/Entries
@@ -2195,10 +2234,10 @@ while [ $# -gt 0 ]; do
                -debug)
                        RPMBUILDOPTS="${RPMBUILDOPTS} -debug"; shift
                        ;;
-               -* )
+               -*)
                        Exit_error err_invalid_cmdline "$1"
                        ;;
-               * )
+               *)
                        SPECFILE="${1}"
                        # check if specname was passed as specname:cvstag
                        if [ "${SPECFILE##*:}" != "${SPECFILE}" ]; then
@@ -2211,7 +2250,7 @@ while [ $# -gt 0 ]; do
 done
 
 if [ -f CVS/Entries ] && [ -z "$CVSTAG" ]; then
-       CVSTAG=$(awk -vSPECFILE="${SPECFILE%.spec}.spec" -F/ '$2 == SPECFILE && $6 ~ /^T/{print substr($6, 2)}' CVS/Entries)
+       CVSTAG=$(awk -vSPECFILE=$(basename ${SPECFILE%.spec}.spec) -F/ '$2 == SPECFILE && $6 ~ /^T/{print substr($6, 2)}' CVS/Entries)
        if [ "$CVSTAG" ]; then
                echo >&2 "builder: Stick tag $CVSTAG active. Use -r TAGNAME to override."
        fi
This page took 0.123505 seconds and 4 git commands to generate.