]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - builder.sh
- help
[packages/rpm-build-tools.git] / builder.sh
index 7de08fccf60f2566fa5f01ad11d654f00783474e..b58d75e6dc4fca0cc23c12393e4bf571d7561482 100644 (file)
@@ -42,6 +42,7 @@ NOCVS=""
 NOCVSSPEC=""
 NODIST=""
 NOINIT=""
+PREFMIRRORS=""
 UPDATE=""
 ADD5=""
 NO5=""
@@ -259,6 +260,7 @@ Usage: builder [-D|--debug] [-V|--version] [--short-version] [-a|--as_anon] [-b|
 -ns, --no-srcs      - don't download Sources
 -ns0, --no-source0  - don't download Source0
 -nn, --no-net       - don't download anything from the net
+-pm, --prefer-mirrors - prefer mirrors (if any) over distfiles for SOURCES
 --no-init           - don't initialize builder paths (SPECS and SOURCES)
 -ske,
 --skip-existing-files - skip existing files in get_files
@@ -943,9 +945,9 @@ get_files()
                                        fi
                                        target="$fp"
 
-                                       # prefer mirror over distfiles if there's mirror
+                                       # optionally prefer mirror over distfiles if there's mirror
                                        # TODO: build url list and then try each url from the list
-                                       if [ -z "$NOMIRRORS" ] && im=$(find_mirror "$i") && [ "$im" != "$i" ]; then
+                                       if [ -n "$PREFMIRRORS" ] && [ -z "$NOMIRRORS" ] && im=$(find_mirror "$i") && [ "$im" != "$i" ]; then
                                                url="$im"
                                        else
                                                url=$(distfiles_url "$i")
@@ -1918,6 +1920,9 @@ while [ $# -gt 0 ]; do
                        NOSRCS="yes"
                        ALWAYS_CVSUP="no"
                        shift;;
+               -pm | --prefer-mirrors )
+                       PREFMIRRORS="yes"
+                       shift;;
                --no-init )
                        NOINIT="yes"
                        shift;;
This page took 0.046544 seconds and 4 git commands to generate.