]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - builder.sh
builder: xtitle check stderr, so it would work in capture blocks too
[packages/rpm-build-tools.git] / builder.sh
index 52d306ab205859bf68499dc8bb805357fe1e4097..840a3699afe082a238d4e9c1bc65f8d33b91a6a4 100755 (executable)
@@ -554,7 +554,7 @@ depspecname() {
 }
 
 update_shell_title() {
-       [ -t 1 ] || return
+       [ -t 2 ] || return
        local len=${COLUMNS:-80}
        local msg="$(echo "$*" | cut -c-$len)"
 
@@ -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
@@ -1033,15 +1033,22 @@ get_spec() {
        set_spec_target
 }
 
+# find mirrors in this order. first match wins:
+# - package dir (~/rpm/packages/foo)
+# - repository dir (~/rpm/packages)
+# - tools dir dir (~/rpm/packages/rpm-build-tools)
 find_mirror() {
-       cd "$REPO_DIR"
        local url="$1"
-       if [ ! -f "mirrors"  ] ; then
-               ln -s ../rpm-build-tools/mirrors .
-       fi
 
-       IFS="|"
+       update_shell_title "find_mirror[$url][$REPO_DIR]"
+
+       # NOTE: as while loop runs in subshell,
+       # we use exit 2 to indicate  that the match was found
+       # otherwise we end up outputing mirror url and origin url.
+
        local origin mirror name rest ol prefix
+       IFS="|"
+       cat "$PACKAGE_DIR/mirrors" "$REPO_DIR/mirrors" "$REPO_DIR/../rpm-build-tools/mirrors" /dev/null 2>/dev/null | \
        while read origin mirror name rest; do
                # skip comments and empty lines
                if [ -z "$origin" ] || [ "${origin#\#}" != "$origin" ]; then
@@ -1052,10 +1059,9 @@ find_mirror() {
                if [ "$prefix" = "$origin" ] ; then
                        suffix=$(echo "$url" | cut -b $((ol+1))-)
                        echo -n "$mirror$suffix"
-                       return 0
+                       exit 2
                fi
-       done < mirrors
-       echo "$url"
+       done && echo "$url"
 }
 
 # Warning: unpredictable results if same URL used twice
@@ -2315,7 +2321,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.030772 seconds and 4 git commands to generate.