- back out 1.23 and 1.24 for now, breaks the build
authorMark Huang <mlhuang@cs.princeton.edu>
Sat, 20 Jan 2007 01:19:12 +0000 (01:19 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Sat, 20 Jan 2007 01:19:12 +0000 (01:19 +0000)
mkfedora

index c2354e0..fff9a40 100755 (executable)
--- a/mkfedora
+++ b/mkfedora
@@ -13,7 +13,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2004-2006 The Trustees of Princeton University
 #
-# $Id: mkfedora,v 1.23 2007/01/19 19:14:06 mef Exp $
+# $Id$
 #
 
 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
@@ -85,10 +85,10 @@ function post-filter () {
 while getopts "l:r:a:g:p:x:kvh" opt ; do
     case $opt in
        l)
-           if echo $OPTARG | grep -q -i '^\(file\|http[s]*\|ftp\)://' ; then
-               mirrors=($OPTARG ${mirrors[@]})
+           if echo $OPTARG | grep -q -i '^\(file\|http[s]*\)://' ; then
+               mirrors=($OPTARG)
            else
-               mirrors=(file://$OPTARG ${mirrors[@]})
+               mirrors=(file://$OPTARG)
            fi
            ;;
        r)
@@ -165,7 +165,6 @@ if [ -z "$baseurl" ] ; then
     usage
 fi
 
-
 exec 3>&1
 exec 4>&2
 if [ $verbose -eq 0 ] ; then
@@ -332,19 +331,14 @@ done
 echo "* Installing glibc" >&3
 yum -c $vroot/etc/yum.conf --installroot=$vroot -y $excludes install glibc
 
-#get rpm and yum
-yum -c $vroot/etc/yum.conf --installroot=$vroot -y install rpm yum 
-
-# use host env resolv info to make yum work.
-cp /etc/resolv.conf $vroot/etc/resolv.conf
-
 # Go, baby, go
 if [ ${#packages[*]} -gt 0 ] ; then
    echo "* Installing optional packages" "${packages[@]}" >&3
-   chroot $vroot yum -c /etc/yum.conf -y $excludes install "${packages[@]}"
-   if ! chroot $vroot rpm -q "${packages[@]}" >/dev/null ; then
+   yum -c $vroot/etc/yum.conf --installroot=$vroot -y $excludes \
+         install "${packages[@]}"
+   if ! rpm --root $vroot -q "${packages[@]}" >/dev/null ; then
        echo "* Warning: Missing packages"
-       chroot $vroot rpm -q "${packages[@]}" | grep "not installed"
+       rpm --root $vroot -q "${packages[@]}" | grep "not installed"
    fi
 fi
 
@@ -352,7 +346,8 @@ if [ ${#groups[*]} -gt 0 ] ; then
    ## call yum sequentially to get finer-grained info on dependencies
    for grp in "${groups[@]}" ; do
       echo "* Installing optional group $grp" >&3
-      chroot $vroot yum -c /etc/yum.conf -y $excludes groupinstall "$grp"
+      yum -c $vroot/etc/yum.conf --installroot=$vroot -y $excludes \
+       groupinstall "$grp"
    done
 fi
 
@@ -374,7 +369,8 @@ fi
 
 # Clean yum cache
 echo "* Cleaning up" >&3
-chroot $vroot yum -c /etc/yum.conf -y clean all
+yum -c $vroot/etc/yum.conf --installroot=$vroot -y \
+    clean all
 
 # Clean RPM state
 rm -f $vroot/var/lib/rpm/__db*