]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - builder.sh
- tread everything as metapackage when getting deps via rpm-getdeps (experimental...
[packages/rpm-build-tools.git] / builder.sh
index a9760048f7a1695a47eabdbfde523b3f074a4aad..3598f1b972e0615acf45985d8ebccd6a42843779 100644 (file)
@@ -40,6 +40,7 @@ NODIST=""
 UPDATE=""
 UPDATE5=""
 ADD5=""
+NO5=""
 ALWAYS_CVSUP=${ALWAYS_CVSUP:-"yes"}
 CVSROOT=""
 
@@ -176,6 +177,7 @@ Usage: builder [-D|--debug] [-V|--version] [-a|--as_anon] [-b|-ba|--build]
        
 -5, --update-md5    - update md5 comments in spec, implies -nd -ncs
 -a5, --add-md5      - add md5 comments to URL sources, implies -nc -nd -ncs
+-n5, --no-md5       - ignore md5 comments in spec
 -D, --debug         - enable script debugging mode,
 -V, --version       - output builder version
 -a, --as_anon       - get files via pserver as cvs@$CVS_SERVER,
@@ -452,6 +454,7 @@ src_no ()
 
 src_md5 ()
 {
+       [ X"$NO5" = X"yes" ] && return
        no=$(src_no "$1")
        [ -z "$no" ] && return
        cd $SPECS_DIR
@@ -1004,19 +1007,36 @@ display_bconds()
 {
        if [ "$AVAIL_BCONDS_WITH" != "" ] || [ "$AVAIL_BCONDS_WITHOUT" != "" ]; then
                if [ "$BCOND" != "" ]; then
-                       echo -ne "You are going to build $SPECFILE with the following conditional flags:\n"
+                       echo -ne "\nBuilding $SPECFILE with the following conditional flags:\n"
                        echo -ne "$BCOND"
                else
-                       echo -ne "No conditional flags passed"
+                       echo -ne "\nNo conditional flags passed"
                fi
-               echo -ne "\n\nfrom available:\n\n"
+               echo -ne "\n\nfrom available:\n"
                echo -ne "--with   :\t$AVAIL_BCONDS_WITH\n--without:\t$AVAIL_BCONDS_WITHOUT\n\n"
        fi
 }
 
 fetch_build_requires()
 {
-       if [ "${FETCH_BUILD_REQUIRES}" == "yes" ]; then
+       if [ "${FETCH_BUILD_REQUIRES}" = "yes" ]; then
+               if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ]; then
+                        CONF=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print "@" $3 } ' | xargs)
+                        DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print "@" $3 } ' | xargs)
+                        if [ -n "$CONF" -o -n "$DEPS" ]; then
+                                 /usr/bin/poldek --update; /usr/bin/poldek --upa
+                        fi
+                        if [ -n "$CONF" ]; then
+                                 echo "Trying to uninstall conflicting packages ($CONF):"
+                                 /usr/bin/poldek --noask --nofollow -ev $CONF
+                        fi
+                        if [ -n "$DEPS" ]; then
+                                 echo "Trying to install dependencies ($DEPS):"
+                                 /usr/bin/poldek -uGv $DEPS
+                        fi
+                        return
+               fi
+                
                echo -ne "\nAll packages installed by fetch_build_requires() are written to:\n"
                echo -ne "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES\n"
                echo -ne "\nIf anything fails, you may get rid of them by executing:\n"
@@ -1144,7 +1164,7 @@ fetch_build_requires()
                done
                export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}\007"`
                if [ "$NOT_INSTALLED_PACKAGES" != "" ]; then
-                       echo "Nie uda³o siê zainstalowaæ nastêpuj±cych pakietów i ich zale¿no¶ci:"
+                       echo "Unable to install following packages and their dependencies:"
                        for pkg in "$NOT_INSTALLED_PACKAGES"
                        do
                                echo $pkg
@@ -1180,6 +1200,9 @@ do
                        UPDATE5="yes"
                        ADD5="yes"
                        shift ;;
+               -n5 | --no-md5 )
+                       NO5="yes"
+                       shift ;;
                -D | --debug )
                        DEBUG="yes"; shift ;;
                -V | --version )
This page took 0.03342 seconds and 4 git commands to generate.