Update setup.ini when necessary
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.
This commit is contained in:
parent
44e89c64d4
commit
3ecc4eef4a
30
apt-cyg
30
apt-cyg
|
@ -95,6 +95,23 @@ function findworkspace()
|
||||||
echo Mirror is $mirror
|
echo Mirror is $mirror
|
||||||
mkdir -p "$cache/$mirrordir/$ARCH"
|
mkdir -p "$cache/$mirrordir/$ARCH"
|
||||||
cd "$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()
|
function checkpackages()
|
||||||
|
@ -189,18 +206,7 @@ case "$command" in
|
||||||
|
|
||||||
update)
|
update)
|
||||||
findworkspace
|
findworkspace
|
||||||
touch setup.ini
|
getsetup
|
||||||
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)
|
||||||
|
|
Loading…
Reference in New Issue