From: Mark Huang Date: Wed, 5 Apr 2006 21:20:27 +0000 (+0000) Subject: - not sure what i was seeing; fc2 curl does indeed support file:// X-Git-Tag: plc-0_2-14~19 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=d5d9f9b2abd0b5a4380f1ed59805da1bc5fec0ab;p=build.git - not sure what i was seeing; fc2 curl does indeed support file:// - no need for scratch space - clean /dev before populating - set an error trap after making device nodes; mknod fails if the file already exists, so set the trap after this point --- diff --git a/mkfedora b/mkfedora index cf8d4af2..40abf407 100755 --- a/mkfedora +++ b/mkfedora @@ -13,7 +13,7 @@ # Mark Huang # Copyright (C) 2004-2006 The Trustees of Princeton University # -# $Id: mkfedora,v 1.6 2006/04/03 19:11:46 mlhuang Exp $ +# $Id: mkfedora,v 1.7 2006/04/03 19:51:42 mlhuang Exp $ # export PATH=/sbin:/bin:/usr/sbin:/usr/bin @@ -103,19 +103,9 @@ if [ $UID -ne 0 ] ; then exit 1 fi -# Old versions of curl don't understand file:// URLs fetch () { - url=$1 - if curl --fail --silent --max-time 60 $url ; then - return 0 - else - if [ -f ${url#file://} ] ; then - cat ${url#file://} - return 0 - fi - fi - return 1 + curl --fail --silent --max-time 60 "$1" } for mirror in "${mirrors[@]}" ; do @@ -144,9 +134,6 @@ if [ $verbose -eq 0 ] ; then exec 2>/dev/null fi -# Scratch space -tmp=$(mktemp -d /tmp/mkfedora.XXXXXX) - # Minimally initialize /dev in reference image. If installed, the dev # or udev RPMs will fill in the rest. mkdir -p $vroot/dev @@ -162,6 +149,9 @@ ln -nsf ../proc/self/fd $vroot/dev/fd # For df and linuxconf touch $vroot/dev/hdv1 +# Do not tolerate errors +set -e + # Mount /dev/pts in reference image mkdir -p $vroot/dev/pts mount -t devpts none $vroot/dev/pts @@ -179,11 +169,10 @@ cleanup () umount $vroot/proc umount $vroot/dev/shm umount $vroot/dev/pts - rm -rf $tmp } # Clean up before exiting if anything goes wrong -trap "cleanup; exit 1" ERR +trap "cleanup" ERR # Create a dummy /etc/fstab in reference image mkdir -p $vroot/etc