]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - builder.sh
- BuildConflicts after BuildRequires
[packages/rpm-build-tools.git] / builder.sh
index 199b4fafb04b4cdadbde10368be146b552ffbff8..5eacb84efd52e8875d2f062c1b1670222664dac2 100644 (file)
@@ -247,6 +247,8 @@ Usage: builder [-D|--debug] [-V|--version] [-a|--as_anon] [-b|-ba|--build]
 -sp, --source-paths - list sources - filenames with full local paths (intended for
                       offline operations; does not work when Icon field is present
                                                         but icon file is absent),
+-su, --source-urls  - list urls - urls to sources and patches
+                      intended for copying urls with spec with lots of macros in urls
 -T <cvstag> , --tag <cvstag>
                     - add cvs tag <cvstag> for files,
 -Tvs, --tag-version-stable
@@ -288,14 +290,16 @@ Usage: builder [-D|--debug] [-V|--version] [-a|--as_anon] [-b|-ba|--build]
 
 update_shell_title() {
        [ -t 1 ] || return
-       echo "$*"
-       local msg="builder[$SPECFILE] $*"
+       local len=${COLUMNS:-80}
+       local msg=$(echo "$*" | cut -c-$len)
+
+       msg="builder[$SPECFILE] $msg"
        case "$TERM" in
                cygwin|xterm*)
-               echo -ne "\033]1;$msg\007\033]2;$msg\007"
+               echo >&2 -ne "\033]1;$msg\007\033]2;$msg\007"
        ;;
                screen*)
-               echo -ne "\033]0;$msg\007"
+               echo >&2 -ne "\033]0;$msg\007"
        ;;
        esac
 }
@@ -342,7 +346,7 @@ rpm_dump () {
 
 parse_spec()
 {
-       update_shell_title "parse_spec"
+       update_shell_title "parsing specfile"
        if [ -n "$DEBUG" ]; then
                set -x;
                set -v;
@@ -622,7 +626,7 @@ cvsignore_df ()
 get_files()
 {
        GET_FILES="$@"
-       update_shell_title "get_files"
+       update_shell_title "fetching sources"
 
        if [ -n "$DEBUG" ]; then
                set -x;
@@ -1020,7 +1024,7 @@ install_required_packages()
 
 set_bconds_values()
 {
-       update_shell_title "set_bconds_values"
+       update_shell_title "set bcond values"
 
        AVAIL_BCONDS_WITHOUT=""
        AVAIL_BCONDS_WITH=""
@@ -1293,34 +1297,39 @@ _rpm_cnfl_check()
 fetch_build_requires()
 {
        if [ "${FETCH_BUILD_REQUIRES}" = "yes" ]; then
-               update_shell_title "fetch_build_requires"
+               update_shell_title "fetch build requires"
                if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ]; then
-                       CONF=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print $3 } ' | _rpm_cnfl_check | xargs)
-                       DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print $3 } ' | _rpm_prov_check | xargs)
+                       local CONF=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print $3 } ' | _rpm_cnfl_check | xargs)
+                       local DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print $3 } ' | _rpm_prov_check | xargs)
 
-                       update_shell_title "fetch_build_requires: update indexes"
+                       update_shell_title "poldek: update indexes"
                        if [ -n "$CONF" ] || [ -n "$DEPS" ]; then
                                $SU_SUDO /usr/bin/poldek -q --update || $SU_SUDO /usr/bin/poldek -q --upa
                        fi
                        if [ -n "$CONF" ]; then
-                               update_shell_title "fetch_build_requires: uninstall conflicting packages"
+                               update_shell_title "uninstall conflicting packages: $CONF"
                                echo "Trying to uninstall conflicting packages ($CONF):"
                                $SU_SUDO /usr/bin/poldek --noask --nofollow -ev $CONF
                        fi
-                       if [ -n "$DEPS" ]; then
-                               update_shell_title "fetch_build_requires: install deps ($DEPS)"
+
+                  while [ "$DEPS" ]; do
+                               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
                                failed=$(awk -F: '/^error:/{print $2}' $log)
                                rm -f $log
+                               local ok
                                if [ -n "$failed" ]; then
                                         for package in $failed; do
                                                  # FIXME: sanitise, deps could be not .spec files
-                                                 spawn_sub_builder -bb $package
+                                                 spawn_sub_builder -bb $package && ok="$ok $package"
                                         done
+                                        DEPS="$ok"
+                               else
+                                        DEPS=""
                                fi
-                       fi
+                  done
                        return
                fi
 
@@ -1601,6 +1610,9 @@ do
                -sp | --sources-paths)
                        COMMAND="list-sources-local-paths"
                        shift ;;
+               -su | --sources-urls)
+                       COMMAND="list-sources-urls"
+                       shift ;;
                -Tvs | --tag-version-stable )
                        COMMAND="tag";
                        TAG="STABLE"
@@ -1824,6 +1836,17 @@ case "$COMMAND" in
                         echo $SAP | awk '{gsub(/.*\//,"") ; print}'
                done
                ;;
+       "list-sources-urls" )
+               init_builder
+               NOCVSSPEC="yes"
+               DONT_PRINT_REVISION="yes"
+               get_spec
+               parse_spec
+               SAPS="$SOURCES $PATCHES"
+               for SAP in $SAPS ; do
+                        echo $SAP
+               done
+               ;;
        "list-sources-local-paths" )
                init_builder
                NOCVSSPEC="yes"
This page took 0.039551 seconds and 4 git commands to generate.