- improve PSUF autodetection a bit
authorMichael Schroeder <mls@suse.de>
Tue, 17 Apr 2012 15:02:29 +0000 (17:02 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 17 Apr 2012 15:02:29 +0000 (17:02 +0200)
init_buildsystem

index 8657dea..a9e901e 100755 (executable)
@@ -724,24 +724,17 @@ else
     echo "$GUESSED_DIST" > $BUILD_ROOT/.guessed_dist
     test -n "$BUILD_DIST" || BUILD_DIST="$GUESSED_DIST"
     DIST_TYPE=`gettype --dist "$BUILD_DIST" --configdir "$BUILD_DIR/configs" --archpath "$BUILD_ARCH"`
-    if [ -n $DIST_TYPE ]; then
-       case $DIST_TYPE in
-               spec)
-                       PSUF=rpm 
-                       ;;
-               dsc)
-                       PSUF=deb
-                       ;;
-               *)
-                       PSUF=rpm
-                       test -L $BUILD_TARGET/.init_b_cache/rpms/rpm.rpm || PSUF=deb
-               ;;
-       esac
-    else
-       PSUF=rpm
-       test -L $BUILD_ROOT/.init_b_cache/rpms/dpkg.deb && PSUF=deb
-       test -L $BUILD_ROOT/.init_b_cache/rpms/pacman.arch && PSUF=arch
-    fi
+    case "$DIST_TYPE" in
+       spec)  PSUF=rpm ;;
+       dsc)   PSUF=deb ;;
+       arch)  PSUF=arch ;;
+       *)
+           # auto detect from packages
+           PSUF=rpm
+           test -L $BUILD_ROOT/.init_b_cache/rpms/dpkg.deb && PSUF=deb
+           test -L $BUILD_ROOT/.init_b_cache/rpms/pacman.arch && PSUF=arch
+           ;;
+    esac
 fi
 
 #