rorysenpai / apt-cyg

Automatically exported from code.google.com/p/apt-cyg
MIT License
0 stars 0 forks source link

does not work with 64 bit cygwin #31

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. install 64 bit cygwin
2. download the utility as mentioned on the wiki
3. try to use it.

I had to apply the following patch to get it working:

$ diff -u /tmp/apt-cyg /bin/apt-cyg
--- /tmp/apt-cyg        2010-04-28 00:25:43.315784000 +0530
+++ /bin/apt-cyg        2013-08-30 12:27:57.411357400 +0530
@@ -65,7 +65,7 @@
 {
   # default working directory and mirror

-  mirror=ftp://mirror.mcs.anl.gov/pub/cygwin
+  mirror=http://mirrors.kernel.org/sourceware/cygwin
   cache=/setup

   # work wherever setup worked last, if possible
@@ -95,14 +95,14 @@
   then
     touch setup.ini
     mv setup.ini setup.ini-save
-    wget -N $mirror/setup.bz2
+    wget -N $mirror/x86_64/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/x86_64/setup.ini
       if test -e setup.ini && test $? -eq 0
       then
         echo Updated setup.ini

I changed the mirror just so that I use a more trusted server. Otherwise, the 
mirror in use does not matter.

The main problem is that it is looking for setup.ini and setup.bz2 in the wrong 
location.

If I include "x86_64" inside the mirror location itself, then it appends 
another "x86_64" when looking for actual package files, thus failing later.

Either ways, it fails and so I had to fix it in the above manner.

I was using 32 bit cygwin earlier and did not have this problem.

Original issue reported on code.google.com by dev.mit...@gmail.com on 30 Aug 2013 at 7:03

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This problem also occurs with the current apt-cyg and the 32-bit version of 
cygwin. The suggested fix (appending 'x86' to the mirror URL only when 
downloading the setup files) resolves the issue. I am thinking the cygwin 
mirrors altered their directory structures for the 64-bit cygwin release. 
Anyway, based on the provided fix, I threw 32/64-bit detection into the mix.

$ diff -u apt-cyg.broke apt-cyg
--- apt-cyg.broke       2013-09-03 09:34:33.035199100 -0400
+++ apt-cyg     2013-09-03 10:17:35.909293600 -0400
@@ -29,6 +29,8 @@
   exit 1
 fi

+arch=x86 # default to x86
+[[ -n `uname -a | grep x86_64` ]] && arch=x86_64

 function usage()
 {
@@ -94,14 +96,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

-Clayton

Original comment by maxwell....@gmail.com on 3 Sep 2013 at 2:19

GoogleCodeExporter commented 8 years ago
Thank you both, I applied Claytons patch to my apt-cyg and it's working 
perfectly.  -Greg

Original comment by gregormi...@gmail.com on 16 Oct 2013 at 5:56

GoogleCodeExporter commented 8 years ago
so how/ when does this fix get checked in?

Original comment by dev.mit...@gmail.com on 17 Oct 2013 at 5:02

GoogleCodeExporter commented 8 years ago
Changes have been merged, thanks.

Original comment by i...@skl.me on 19 Feb 2014 at 8:41