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

[revamp] Unpack archives that don't list their root directory #450

Closed
str4d opened this issue Sep 12, 2015 · 6 comments
Closed

[revamp] Unpack archives that don't list their root directory #450

str4d opened this issue Sep 12, 2015 · 6 comments

Comments

@str4d
Copy link
Contributor

str4d commented Sep 12, 2015

The code in Recipe.unpack() gets the first item on an archive's list as the root directory, and renames it if necessary. Archives like http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2 show their root directory as the first entry of tar tjf. But others like https://pypi.python.org/packages/source/T/Twisted/Twisted-15.4.0.tar.bz2 do not, and so instead the first file in the list gets renamed, causing the later build stage to fail (because the expected directory doesn't exist).

@inclement
Copy link
Member

python-for-android uses a recipe with http://twistedmatrix.com/Releases/Twisted/15.2/Twisted-15.2.1.tar.bz2 as the source, which is a more politely packaged archive. I recognise that the archive unpacking should probably be made better and some code changes for that would be fine, but does using this source solve your problem?

@str4d
Copy link
Contributor Author

str4d commented Sep 12, 2015

No, it has the same issue here :(

@inclement
Copy link
Member

Are you sure? The top level of the archive is a directory, how does it fail now?

@str4d
Copy link
Contributor Author

str4d commented Sep 12, 2015

So was the PyPI one. But what is happening, is that this top level is not shown in the list. I don't understand why, but it has to be something in the way the archive was produced.

$ tar tjf packages/python2/Python-2.7.2.tar.bz2
Python-2.7.2/
Python-2.7.2/PC/
Python-2.7.2/PC/py.ico
Python-2.7.2/PC/testpy.py
Python-2.7.2/PC/pyconfig.h
Python-2.7.2/PC/_msi.c
Python-2.7.2/PC/pyc.ico
Python-2.7.2/PC/icons.mak
Python-2.7.2/PC/frozen_dllmain.c
Python-2.7.2/PC/winsound.c
Python-2.7.2/PC/os2emx/
Python-2.7.2/PC/os2emx/pyconfig.h
...
$ tar tjf packages/twisted/Twisted-15.2.1.tar.bz2
Twisted-15.2.1/bin/_preamble.py
Twisted-15.2.1/bin/conch/
Twisted-15.2.1/bin/conch/cftp
Twisted-15.2.1/bin/conch/ckeygen
Twisted-15.2.1/bin/conch/conch
Twisted-15.2.1/bin/conch/tkconch
Twisted-15.2.1/bin/lore/
Twisted-15.2.1/bin/lore/lore
Twisted-15.2.1/bin/mail/
Twisted-15.2.1/bin/mail/mailmail
Twisted-15.2.1/bin/manhole
Twisted-15.2.1/bin/pyhtmlizer
Twisted-15.2.1/bin/tap2deb
Twisted-15.2.1/bin/tap2rpm
Twisted-15.2.1/bin/trial
...

@inclement
Copy link
Member

Oh, I see, I'm sorry I misunderstood. That's strange indeed. I was going to switch to more pythonic unpacking at some point anyway (I think tito's function for this is still in toolchain.py but not used), so maybe this can be solved that way.

@inclement
Copy link
Member

I think kived fixed this.

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

No branches or pull requests

2 participants