Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apg-cyg update fails because cygwin has updated their repository format #26

Closed
GoogleCodeExporter opened this issue Nov 29, 2015 · 13 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Execute "apt-cyg update"
2. You will then see the following output:

========================================
$ apt-cyg update
Working directory is /setup
Mirror is http://cygwin.mirrorcatalogs.com/
--2013-08-12 21:26:03--  http://cygwin.mirrorcatalogs.com//setup.bz2
Resolving cygwin.mirrorcatalogs.com (cygwin.mirrorcatalogs.com)... 204.45.83.21
Connecting to cygwin.mirrorcatalogs.com 
(cygwin.mirrorcatalogs.com)|204.45.83.21|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-08-12 21:26:04 ERROR 404: Not Found.

--2013-08-12 21:26:04--  http://cygwin.mirrorcatalogs.com//setup.ini
Resolving cygwin.mirrorcatalogs.com (cygwin.mirrorcatalogs.com)... 204.45.83.21
Connecting to cygwin.mirrorcatalogs.com 
(cygwin.mirrorcatalogs.com)|204.45.83.21|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-08-12 21:26:04 ERROR 404: Not Found.

Error updating setup.ini, reverting
========================================

----
What is the expected output? What do you see instead?
----
I believe the expected output would have been something other than "Error 
updating setup.ini, reverting"

----
What version of the product are you using? On what operating system?
----
I downloaded the latest version and installed it with the following commands:

  10  wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
  11  chmod +x apt-cyg
  14  mv apt-cyg /usr/local/bin/

----
Please provide any additional information below.
----
This reminds me of an issue which I encountered when running the old CYGWIN 
setup.exe installer and was only resolved by downloading the latest 
setup-x86.exe.  I know the difference is a new url or location of some mirror 
index file.  I will take a look at the source code and see if I can figure this 
out.

(Just took a look at a mirror, and I think it is as simple as adding "/x86/ or 
"/x86_64" to the mirror url.... 

Original issue reported on code.google.com by johnstra...@gmail.com on 13 Aug 2013 at 1:30

@GoogleCodeExporter
Copy link
Author

For now, you can edit the following file and append your architecture

[1] /etc/setup/last-mirror
[2] modify first line to look like this:

http://cygwin.mirrorcatalogs.com/x86

or whatever the mirror/architecture you are using is

http://cygwin.mirrorcatalogs.com/x86_64

Original comment by johnstra...@gmail.com on 13 Aug 2013 at 1:38

@GoogleCodeExporter
Copy link
Author

Here is my diff file:

I have tested it on Windows 7 64-bit with a x86 installation and an x86_64 
installation.  I'm sure the team will want to use a more proper statement for 
detecting the architecture.


Original comment by johnstra...@gmail.com on 13 Aug 2013 at 2:10

@GoogleCodeExporter
Copy link
Author

The previous patch only worked for update... now I ran it to download files and 
saw that the code would not work when connecting to a repository and actually 
downloading the file,

so here is the updated diff file that works in its entirety:


Original comment by johnstra...@gmail.com on 13 Aug 2013 at 3:39

Attachments:

@GoogleCodeExporter
Copy link
Author

I can confirm that the diff file does indeed solve the problem.

Original comment by Alexandr...@gmail.com on 14 Aug 2013 at 10:15

@GoogleCodeExporter
Copy link
Author

I obtain the same problem.
Cygwin now have x86 and x86_64 versions.
apt-cyg script should gain some corrects.
My way to sole it.
Original lines:
====================================================
function getsetup() 
{
  if test "$noscripts" == "0" -a "$noupdate" == "0"
  then
    touch setup.ini
    mv setup.ini setup.ini-save
    wget -N $mirror/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
      if test -e setup.ini && test $? -eq 0
      then
        echo Updated setup.ini
      else
        mv setup.ini-save setup.ini
        echo Error updating setup.ini, reverting
      fi
    fi
  fi
}
====================================================

Cygwin's out for apt-cyg install patch

====================================================
$ apt-cyg install patch
Working directory is /setup
Mirror is http://cygwin.mirrorcatalogs.com/x86
--2013-08-28 12:15:47--  http://cygwin.mirrorcatalogs.com/x86/setup.bz2
Распознаётся cygwin.mirrorcatalogs.com 
(cygwin.mirrorcatalogs.com)... 204.45.83.                      21
Подключение к cygwin.mirrorcatalogs.com 
(cygwin.mirrorcatalogs.com)|204.45.83.21                      |:80... 
соединение установлено.
HTTP-запрос отправлен. Ожидание ответа... 200 OK
Длина: 390526 (381K) [application/octet-stream]
Сохранение в каталог: ««setup.bz2»».

100%[======================================>] 390 526      166K/s   за 2,3s

2013-08-28 12:15:50 (166 KB/s) - «setup.bz2» saved [390526/390526]

Updated setup.ini

Installing patch
Found package patch
--2013-08-28 12:15:51--  
http://cygwin.mirrorcatalogs.com/x86/x86/release/patch/                      
patch-2.7.1-1.tar.bz2
Распознаётся cygwin.mirrorcatalogs.com 
(cygwin.mirrorcatalogs.com)... 204.45.83.                      21
Подключение к cygwin.mirrorcatalogs.com 
(cygwin.mirrorcatalogs.com)|204.45.83.21                      |:80... 
соединение установлено.
HTTP-запрос отправлен. Ожидание ответа... 404 Not 
Found
2013-08-28 12:15:51 ОШИБКА 404: Not Found.
====================================================

Lines with my corrects:

====================================================
function getsetup() 
{
  if test "$noscripts" == "0" -a "$noupdate" == "0"
  then
    touch setup.ini
    mv setup.ini setup.ini-save
    wget -N $mirror/x86/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/x86/setup.ini
      if test -e setup.ini && test $? -eq 0
      then
        echo Updated setup.ini
      else
        mv setup.ini-save setup.ini
        echo Error updating setup.ini, reverting
      fi
    fi
  fi
}
====================================================

Cygwin's out for apt-cyg install patch

====================================================
$ apt-cyg install patch
Working directory is /setup
Mirror is http://cygwin.mirrorcatalogs.com
--2013-08-28 17:33:35--  http://cygwin.mirrorcatalogs.com/x86/setup.bz2
Распознаётся cygwin.mirrorcatalogs.com 
(cygwin.mirrorcatalogs.com)... 204.45.83.21
Подключение к cygwin.mirrorcatalogs.com 
(cygwin.mirrorcatalogs.com)|204.45.83.21|:80... соединение 
установлено.
HTTP-запрос отправлен. Ожидание ответа... 200 OK
Длина: 390526 (381K) [application/octet-stream]
Сохранение в каталог: ««setup.bz2»».

100%[============================================================>] 390 526    
  131K/s   за 2,9s

2013-08-28 17:33:38 (131 KB/s) - «setup.bz2» saved [390526/390526]

Updated setup.ini

Installing patch
Found package patch
--2013-08-28 17:33:40--  
http://cygwin.mirrorcatalogs.com/x86/release/patch/patch-2.7.1-1.tar.bz2
Распознаётся cygwin.mirrorcatalogs.com 
(cygwin.mirrorcatalogs.com)... 204.45.83.21
Подключение к cygwin.mirrorcatalogs.com 
(cygwin.mirrorcatalogs.com)|204.45.83.21|:80... соединение 
установлено.
HTTP-запрос отправлен. Ожидание ответа... 200 OK
Длина: 107973 (105K) [application/octet-stream]
Сохранение в каталог: ««patch-2.7.1-1.tar.bz2»».

100%[============================================================>] 107 973    
 90,8K/s   за 1,2s

2013-08-28 17:33:42 (90,8 KB/s) - «patch-2.7.1-1.tar.bz2» saved 
[107973/107973]

Unpacking...
Package patch installed
====================================================

I'm working on x86 Windows XP.
I've tested it on http://cygwin.mirrorcatalogs.com in /etc/setup/last-mirror

Original comment by wearecom...@gmail.com on 28 Aug 2013 at 2:34

Attachments:

@GoogleCodeExporter
Copy link
Author

I just discovered that apt-cyg does not work for archives of type ".xz"

This happened when I was installing make, for some reason it chose to download 
the slightly smaller .xz file instead of the usual .bz file.  It would report 
the error but it would still continue and say that installation was successful. 
 Anyway, I am working on another patch, but for the super-anxious, just modify 
your apt-cyg script file with the following:


 echo "Unpacking..."
    if [ ${file: -3} == ".xz" ]
    then
        echo "File is of type .xz"
        tar -xJf $file -C /
    else
        cat $file | bunzip2 | tar > "/etc/setup/$pkg.lst" xvf - -C /
        gzip -f "/etc/setup/$pkg.lst"
    fi

Original comment by johnstra...@gmail.com on 30 Oct 2013 at 8:33

@GoogleCodeExporter
Copy link
Author

Here is a patch file

Original comment by johnstra...@gmail.com on 30 Oct 2013 at 9:10

Attachments:

@GoogleCodeExporter
Copy link
Author

We should fork this project... I'll look into making something new on github

Original comment by johnstra...@gmail.com on 30 Oct 2013 at 10:33

@GoogleCodeExporter
Copy link
Author

I forked it and applied my 2 patches.  Feel free to join the project and to 
contribute yours/better modifications.

https://github.com/GiannisRambo/apt-cyg

Original comment by johnstra...@gmail.com on 30 Oct 2013 at 10:55

@GoogleCodeExporter
Copy link
Author

just tested the patch from Alex, adding x86 in the path solved the problem. we 
shall update the trunk with this so that new people won't have the same issue.

Original comment by isaac...@gmail.com on 23 Dec 2013 at 7:33

@GoogleCodeExporter
Copy link
Author

Original comment by i...@skl.me on 17 Feb 2014 at 8:56

  • Changed state: Duplicate

@GoogleCodeExporter
Copy link
Author

Still not working :(((

apt-cyg install zip
Working directory is /setup
Mirror is http://mirrors.kernel.org/sourceware/cygwin
--2015-03-25 14:59:00--  
http://mirrors.kernel.org/sourceware/cygwin/x86/setup.bz2
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:18080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 1362599 (1.3M) [application/octet-stream]
Saving to: ‘setup.bz2’

setup.bz2                  100%[========================================>]   
1.30M  1.46MB/s   in 0.9s

2015-03-25 14:59:01 (1.46 MB/s) - ‘setup.bz2’ saved [1362599/1362599]

Updated setup.ini

Installing zip
Found package zip
--2015-03-25 14:59:02--  
http://mirrors.kernel.org/sourceware/cygwin/x86/release/zip/zip-3.0-12.tar.xz
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:18080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 211748 (207K) [application/octet-stream]
Saving to: ‘zip-3.0-12.tar.xz’

zip-3.0-12.tar.xz          100%[========================================>] 
206.79K   201KB/s   in 1.0s

2015-03-25 14:59:05 (201 KB/s) - ‘zip-3.0-12.tar.xz’ saved [211748/211748]

file zip-3.0-12.tar.xz in 
/setup/http%3a%2f%2fmirrors.kernel.org%2fsourceware%2fcygwin/release/zip
MD5 sum did not match, exiting


Original comment by jcrinc...@gmail.com on 25 Mar 2015 at 4:00

@GoogleCodeExporter
Copy link
Author

I ran into the same issue just yesterday.  The hash algorithm has changed in 
Cygwin's setup.ini, looks like they've upgraded from MD5 to SHA512.

Since Google Code is about to die off, I went ahead and made a fix in my fork:
 * https://github.com/digitallamb/apt-cyg

Give it a try and let me know if you have issues.

Original comment by capnsla...@gmail.com on 26 Mar 2015 at 9:30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant