Navigation Menu

Skip to content

Commit

Permalink
Update setup.ini when necessary
Browse files Browse the repository at this point in the history
If you tried to use this command

    apt-cyg install --mirror <URL> <package>

with a new mirror, it would fail because "apt-cyg install" no longer downloads
setup.ini every time. Fix so that setup.ini will be downloaded if it does not
already exist.
  • Loading branch information
Steven Penny committed May 14, 2014
1 parent 44e89c6 commit 3ecc4ee
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions apt-cyg
Expand Up @@ -95,6 +95,23 @@ function findworkspace()
echo Mirror is $mirror
mkdir -p "$cache/$mirrordir/$ARCH"
cd "$cache/$mirrordir/$ARCH"
[ -e setup.ini ] || getsetup
}

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
}

function checkpackages()
Expand Down Expand Up @@ -189,18 +206,7 @@ case "$command" in

update)
findworkspace
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
getsetup
;;

list)
Expand Down

0 comments on commit 3ecc4ee

Please sign in to comment.