]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - builder.sh
adapter: cleanup r= from sf urls
[packages/rpm-build-tools.git] / builder.sh
index ef4361ea9ca2fe83796c285ce4e89945ec854f98..90e1b93eb434620b977749088bfd6c9938664dda 100755 (executable)
@@ -463,7 +463,7 @@ tempdir() {
 }
 
 # inserts git log instead of %changelog
-# outputs name of modified file created by tempfile
+# @output directory containing modified specfile
 insert_gitlog() {
        local SPECFILE=$1 specdir=$(tempdir) gitlog=$(tempfile) speclog=$(tempfile)
 
@@ -656,7 +656,7 @@ minirpm() {
 %remove_etc_shells(p) %{p:<lua>}
 %lua_add_etc_shells()  %{nil}
 %lua_remove_etc_shells() %{nil}
-%required_jdk %{nil}
+%required_jdk jdk
 %buildrequires_jdk %{nil}
 %pear_package_print_optionalpackages %{nil}
 EOF
@@ -1826,33 +1826,15 @@ run_sub_builder() {
 # @return exit code from poldek
 #
 # this requires following sudo rules:
-# - poldek -q --update --upa
+# - poldek --noask --caplookup -uG
 poldek_install() {
-# TODO: if carme sudo rules are updated, this function could be just:
-#      LANG=C $POLDEK_CMD --noask --caplookup -uG $*
-
-       local log=$(tempfile poldek) rc
-
-       echo "install $*" | LANG=C script -e -f $log -c "$POLDEK_CMD"; rc=$?
-       # remove color and other terminal escapes
-       # see https://bugs.launchpad.net/poldek/+bug/1434393
-       sed -i -e 's/\r/\n/g;s/\ f//g;' $log
-       perl -pe 's/\033\[[\d;]*m//g' -i $log
-
-       # error: libjpeg-devel: no such package
-       local failed=$(awk '/^error:/{a=$2; sub(/^error: /, "", a); sub(/:$/, "", a); print a}' $log)
-       rm $log
-
-       # failed to capture error?
-       if [ -n "$failed" -a $rc = 0 ]; then
-               echo >&2 "Failed to install: "$failed
-               rc=1
-       fi
-
-       return $rc
+       LANG=C $POLDEK_CMD --noask --caplookup --uniq -uG "$@"
 }
 
 # install packages
+#
+# this requires following sudo rules:
+# - poldek -q --update --upa
 install_packages() {
        # sync poldek indexes once per invocation
        if [ -z "$package_indexes_updated" ]; then
@@ -1946,21 +1928,21 @@ display_branches() {
 # outputs all dependencies which current rpmdb doesn't satisfy.
 # input can be either STDIN or parameters
 _rpm_prov_check() {
-       local DEPS
+       local deps out
 
        if [ $# -gt 0 ]; then
-               DEPS="$@"
+               deps="$@"
        else
-               DEPS=$(cat)
+               deps=$(cat)
        fi
 
-       DEPS=$(LANG=C rpm -q --whatprovides $DEPS 2>&1 | awk '/^(error:|no package provides)/ { print }')
+       out=$(LC_ALL=C rpm -q --whatprovides $deps 2>&1)
 
        # packages
-       echo "$DEPS" | awk '/^no package provides/ { print $NF }'
+       echo "$out" | awk '/^no package provides/ { print $NF }'
 
        # other deps (files)
-       echo "$DEPS" | awk -F: '/^error:.*No such file/{o = $2; gsub("^ file ", "", o); print o}'
+       echo "$out" | sed -rne 's/file (.*): No such file or directory/\1/p'
 }
 
 # checks if given package/files/provides exists in rpmdb.
@@ -1992,12 +1974,12 @@ install_build_requires_rpmdeps() {
        fi
 
        if [ -n "$CNFL" ]; then
-               echo "Uninstall conflicting packages ($CNFL):"
+               echo "Uninstall conflicting packages: $CNFL"
                uninstall_packages $CNFL
        fi
 
        if [ -n "$DEPS" ]; then
-               echo "Install dependencies ($DEPS):"
+               echo "Install dependencies: $DEPS"
                install_packages $DEPS
        fi
 }
@@ -2070,6 +2052,11 @@ if [ $# = 0 ]; then
        exit 1
 fi
 
+# stuff global $BUILDER_OPTS from env as args
+if [ "$BUILDER_OPTS" ]; then
+       set -- "$BUILDER_OPTS" "$@"
+fi
+
 while [ $# -gt 0 ]; do
        case "${1}" in
                -4|-6)
@@ -2328,7 +2315,7 @@ while [ $# -gt 0 ]; do
                        ;;
                --alt_kernel)
                        shift
-                       RPMOPTS="${RPMOPTS} --define \"alt_kernel $1\""
+                       RPMOPTS="${RPMOPTS} --define \"alt_kernel $1\" --define \"build_kernels $1\""
                        shift
                        ;;
                --short-circuit)
This page took 0.03776 seconds and 4 git commands to generate.