Remove noscripts option

- "--noscripts" was not advertised in the help, and is not really needed now
  that updates are done manually

- moved the function inline as it was only being called once
This commit is contained in:
Steven Penny 2014-05-14 00:16:44 -05:00
parent c585c8e893
commit 44e89c64d4
1 changed files with 14 additions and 32 deletions

46
apt-cyg
View File

@ -97,29 +97,6 @@ function findworkspace()
cd "$cache/$mirrordir/$ARCH"
}
function getsetup()
{
(( noscripts )) && return
touch setup.ini
mv setup.ini setup.ini-save
wget -N $mirror/$ARCH/setup.bz2
if [ -e setup.bz2 ]
then
bunzip2 setup.bz2
mv setup setup.ini
echo Updated setup.ini
else
wget -N $mirror/$ARCH/setup.ini
if [ -e setup.ini ]
then
echo Updated setup.ini
else
mv setup.ini-save setup.ini
echo Error updating setup.ini, reverting
fi
fi
}
function checkpackages()
{
if (( ${#packages} ))
@ -133,7 +110,6 @@ function checkpackages()
# process options
dofile=0
noscripts=0
command=''
file=''
filepackages=''
@ -153,11 +129,6 @@ do
shift 2
;;
--noscripts)
noscripts=1
shift
;;
--help)
usage
exit 0
@ -218,7 +189,18 @@ case "$command" in
update)
findworkspace
getsetup
touch setup.ini
mv setup.ini setup.ini-save
wget -N $mirror/$ARCH/setup.bz2
if [ -e setup.bz2 ]
then
bunzip2 setup.bz2
mv setup setup.ini
echo Updated setup.ini
else
echo Error updating setup.ini, reverting
mv setup.ini-save setup.ini
fi
;;
list)
@ -430,7 +412,7 @@ case "$command" in
echo Package $package is already installed, skipping
continue
fi
apt-cyg --noscripts install $package
apt-cyg install $package
(( $? && warn++ ))
done
fi
@ -442,7 +424,7 @@ case "$command" in
# run all postinstall scripts
pis=`ls /etc/postinstall/*.sh 2>/dev/null | wc -l`
if (( pis && ! noscripts ))
if (( pis ))
then
echo Running postinstall scripts
for script in /etc/postinstall/*.sh