use all enabled zypp repos by default
authorLudwig Nussel <ludwig.nussel@suse.de>
Fri, 22 Jan 2010 12:56:14 +0000 (13:56 +0100)
committerLudwig Nussel <ludwig.nussel@suse.de>
Fri, 22 Jan 2010 13:17:07 +0000 (14:17 +0100)
build
init_buildsystem

diff --git a/build b/build
index 6142516..26a4a5b 100755 (executable)
--- a/build
+++ b/build
@@ -824,7 +824,7 @@ fi
 
 if [ -z "$RPMLIST" ]; then
     if [ -z "$repos" -a -z "$BUILD_RPMS" ]; then
-       BUILD_RPMS="/media/dvd/suse"
+       repos=(--repository 'zypp://')
     fi
 else
     repos=()
index de52995..918f3e1 100755 (executable)
@@ -246,8 +246,28 @@ function create_devs {
 DEVLIST
 }
 
+# check whether the repo list contains a plain "zypp://". Add all
+# enabled zypp repos in this case
+maybe_add_all_zypp_repos()
+{
+    local i j
+    r=()
+    for i in "${repos[@]}"; do
+       if [ "$i" = "zypp://" ]; then
+           for j in `grep -l enabled=1 /etc/zypp/repos.d/*.repo`; do
+               j="${j#/etc/zypp/repos.d/}"
+               r+=("zypp://${j%.repo}")
+           done
+       else
+           r+=("$i")
+       fi
+    done
+    repos=("${r[@]}")
+}
+
 function validate_cache_file {
     local findonly=''
+    maybe_add_all_zypp_repos
     test "${repos[*]} ${BUILD_RPMS//:/ /}" != "$(cat $CACHE_FILE.id 2>/dev/null)" && rm -f $CACHE_FILE.id
     test -f $CACHE_FILE || rm -f $CACHE_FILE.id
     for SRC in "${repos[@]}" ${BUILD_RPMS//:/ /}; do