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" 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() function checkpackages()
{ {
if (( ${#packages} )) if (( ${#packages} ))
@ -133,7 +110,6 @@ function checkpackages()
# process options # process options
dofile=0 dofile=0
noscripts=0
command='' command=''
file='' file=''
filepackages='' filepackages=''
@ -153,11 +129,6 @@ do
shift 2 shift 2
;; ;;
--noscripts)
noscripts=1
shift
;;
--help) --help)
usage usage
exit 0 exit 0
@ -218,7 +189,18 @@ case "$command" in
update) update)
findworkspace 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) list)
@ -430,7 +412,7 @@ case "$command" in
echo Package $package is already installed, skipping echo Package $package is already installed, skipping
continue continue
fi fi
apt-cyg --noscripts install $package apt-cyg install $package
(( $? && warn++ )) (( $? && warn++ ))
done done
fi fi
@ -442,7 +424,7 @@ case "$command" in
# run all postinstall scripts # run all postinstall scripts
pis=`ls /etc/postinstall/*.sh 2>/dev/null | wc -l` pis=`ls /etc/postinstall/*.sh 2>/dev/null | wc -l`
if (( pis && ! noscripts )) if (( pis ))
then then
echo Running postinstall scripts echo Running postinstall scripts
for script in /etc/postinstall/*.sh for script in /etc/postinstall/*.sh