Small fix to make febootstrap work on Debian.
[febootstrap.git] / febootstrap.sh
index 867de63..654d51f 100755 (executable)
@@ -47,7 +47,7 @@ while true; do
        -i|--install)
            packages[i++]="$2"
            shift 2;;
-       --groupinstall|--group-install)
+       -g|--groupinstall|--group-install)
            packages[i++]="@$2"
            shift 2;;
        -p|--proxy)
@@ -82,7 +82,7 @@ mirror="$3"
 
 # Architecture is currently always the same as the current arch.  We
 # cannot do --foreign builds.  See discussion in the manpage.
-arch=$(arch)
+arch=$(uname -m)
 case $arch in
     i?86) arch=i386 ;;
 esac
@@ -117,7 +117,7 @@ fi
 
 # Add the updates repository if asked.
 case "$updates" in
-    none|no)
+    ""|none|no)
        ;;
     *://*)
        cat >> $tmpdir/febootstrap.repo <<EOF
@@ -130,6 +130,7 @@ gpgcheck=0
 $proxy
 baseurl=$updates
 EOF
+addrepo=febootstrap-updates
        ;;
     *)
        cat >> $tmpdir/febootstrap.repo <<EOF
@@ -142,6 +143,7 @@ gpgcheck=0
 $proxy
 mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=$updates&arch=$arch
 EOF
+addrepo=febootstrap-updates
        ;;
 esac
 
@@ -204,18 +206,24 @@ else
     make_device_nodes
 fi
 
+repos=febootstrap
+if [ -n "$addrepo" ]; then
+    repos="$repos,$addrepo"
+fi
+
 # Run yum.
 run_yum ()
 {
     yum \
        -y -c "$tmpdir"/febootstrap.repo \
-       --disablerepo=* --enablerepo=febootstrap \
+       --disablerepo=* --enablerepo=$repos \
        --noplugins --nogpgcheck \
        --installroot="$target" \
        install "$@"
 }
 export -f run_yum
 export tmpdir
+export repos
 
 if [ $(id -u) -ne 0 ]; then
     # Bash doesn't support exporting array variables, hence this