Commit 674c00a9 authored by Lucas Manika Koeb's avatar Lucas Manika Koeb

le-gera-iso: Add new command line parameters --host and --mirror

Signed-off-by: default avatarLucas Manika Koeb <lmk08@c3sl.ufpr.br>
parent 178df354
......@@ -54,13 +54,38 @@ loadConf()
echo "Error: Config file for $2 not found."
exit 1
fi
host=true
mirror=true
if [ ! -z "$LEHOST" ];
then
host="false"
fi
if [ ! -z "$LEMIRROR" ];
then
mirror="false"
fi
#read config file and declares only valid vars.
BASENAME=`basename $(echo "$2")`
while read var; do
egrep -qi "^[a-z_]+=" <<< "$var" &&
eval "export $(echo $var | sed -e "s@DISTNAME@$2@g" -e "s/BASENAME/$BASENAME/g")"
if egrep -qi "^[a-z_]+=" <<< "$var";
then
varname="$(echo $var | cut -d"=" -f 1)"
if [ "$varname" != "LEHOST" ] && [ "$varname" != "LEMIRROR" ];
then
eval "export $(echo $var | sed -e "s@DISTNAME@$2@g" -e "s/BASENAME/$BASENAME/g")"
elif [ "$varname" == "LEHOST" ];
then
$host && eval "export $(echo $var)"
elif [ "$varname" == "LEMIRROR" ];
then
$mirror && eval "export $(echo $var)"
fi
fi
done < "$conf"
return 0
}
......
......@@ -20,9 +20,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#------------------------------------------------------------------------------
export DEBIAN_FRONTEND=noninteractive
editDistro()
{
log "Editing $DISTROBASE ..."
......@@ -52,7 +53,13 @@ regenerateManifest()
#cp $CDDIR/casper/filesystem.manifest \
# $CDDIR/casper/filesystem.manifest-desktop
cat "$INSTLIST"-remove >> "$CDDIR"/casper/filesystem.manifest-remove
#for package in $(cat "$CDDIR"/casper/filesystem.manifest-remove | cut -d '=' -f1 | grep -v "^#"); do
# if ! grep -q "^$package " "$CDDIR"/casper/filesystem.manifest; then
# sed -i "/$package/d" "$CDDIR"/casper/filesystem.manifest-remove
# fi
#done
#for package in $(cat $INSTLIST-desktop | cut -d '=' -f1 | grep -v "^#"); do
# ( printf "$package "; chroot $CHROOTDIR apt-cache showpkg $package |
# grep "^[0-9]" | tail -n1 | cut -d ' ' -f1 ) >> \
......@@ -166,6 +173,10 @@ clean=false
all=false
dist=false
edit=false
host=false
mirror=false
nextHost=false
nextMirror=false
for opc in $*; do
case "$opc" in
......@@ -190,7 +201,17 @@ for opc in $*; do
bash
exit 0
;;
--host)
host=true
nextHost=true
;;
--mirror)
mirror=true
nextMirror=true
;;
*)
$nextHost && export LEHOST="$opc" && nextHost=false
$nextMirror && export LEMIRROR="$opc" && nextMirror=false
$nextDist && distName="$opc" && nextDist=false
$nextAll && baseIso="$opc" && nextAll=false
esac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment