Skip to content

Instantly share code, notes, and snippets.

@rcmdnk rcmdnk/apt-cyg.diff
Last active Dec 20, 2015

Embed
What would you like to do?
Fix of apt-cyg for new direcotry structure of cygwin mirror sites
Index: apt-cyg
===================================================================
--- apt-cyg (revision 18)
+++ apt-cyg (working copy)
@@ -75,6 +75,11 @@
tmp="`head -1 /etc/setup/last-cache`"
cache="`cygpath -au "$tmp"`"
fi
+
+ if test -e /etc/setup/last-arch
+ then
+ arch="`head -1 /etc/setup/last-arch`"
+ fi
if test -e /etc/setup/last-mirror
then
@@ -83,7 +88,7 @@
mirrordir="`echo "$mirror" | sed -e "s/:/%3a/g" -e "s:/:%2f:g"`"
echo Working directory is $cache
- echo Mirror is $mirror
+ echo Mirror is $mirror, architecture is $arch
mkdir -p "$cache/$mirrordir"
cd "$cache/$mirrordir"
}
@@ -95,14 +100,14 @@
then
touch setup.ini
mv setup.ini setup.ini-save
- wget -N $mirror/setup.bz2
+ wget -N $mirror/$arch/setup.bz2
if test -e setup.bz2 && test $? -eq 0
then
bunzip2 setup.bz2
mv setup setup.ini
echo Updated setup.ini
else
- wget -N $mirror/setup.ini
+ wget -N $mirror/$arch/setup.ini
if test -e setup.ini && test $? -eq 0
then
echo Updated setup.ini
@@ -140,8 +145,14 @@
case "$1" in
--mirror|-m)
- echo "$2" > /etc/setup/last-mirror
- shift ; shift
+ arch=`basename $2`
+ if [[ ! "$arch" =~ x86 ]];then
+ echo "Need /x86 (for 32 bit) or /x86_64 (for 64 bit) at the end of site ULR."
+ exit 1
+ fi
+ mirror=`dirname $2`
+ echo "$mirror" > /etc/setup/last-mirror
+ echo "$arch" > /etc/setup/last-arch
;;
--cache|-c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.