Comments (10)
Would just throwing an error message informing the user what's missing if it's not available be an acceptable workaround?
from lastversion.
@vogler unzip
is just an alias to extract
. While not solved the issue with zip files stripping, I realize, OS X bundles should not be stripped. You can check with latest master again.
from lastversion.
@vogler Fixed in lastversion v3.5.0
from lastversion.
This would require the py7zr
library, which I'm hesitant to add because it's missing RPM packages in major distros..
from lastversion.
I have the same problem also with .zip files:
$ brew install pipx
$ pipx install lastversion
$ lastversion --assets download SamusAranX/MinimalMIDIPlayer
Downloaded MinimalMIDIPlayer-v1.13.zip: : 7368.0KB [00:00, 10763.89KB/s]
$ unzip MinimalMIDIPlayer-v1.13.zip
Archive: MinimalMIDIPlayer-v1.13.zip
creating: MinimalMIDIPlayer.app/
...
$ rm -rf MinimalMIDIPlayer*
$ lastversion --assets unzip SamusAranX/MinimalMIDIPlayer
MinimalMIDIPlayer-v1.13.zip: 7368.0KB [00:00, 10887.83KB/s]
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tarfile.py", line 1876, in gzopen
t = cls.taropen(name, mode, fileobj, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tarfile.py", line 1853, in taropen
return cls(name, mode, fileobj, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tarfile.py", line 1711, in __init__
self.firstmember = self.next()
^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tarfile.py", line 2635, in next
raise e
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tarfile.py", line 2608, in next
tarinfo = self.tarinfo.fromtarfile(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tarfile.py", line 1293, in fromtarfile
buf = tarfile.fileobj.read(BLOCKSIZE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/gzip.py", line 324, in read
return self._buffer.read(size)
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/_compression.py", line 68, in readinto
data = self.read(len(byte_view))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/gzip.py", line 527, in read
if not self._read_gzip_header():
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/gzip.py", line 496, in _read_gzip_header
last_mtime = _read_gzip_header(self._fp)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/gzip.py", line 456, in _read_gzip_header
raise BadGzipFile('Not a gzipped file (%r)' % magic)
gzip.BadGzipFile: Not a gzipped file (b'PK')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/voglerr/.local/bin/lastversion", line 10, in <module>
sys.exit(main())
^^^^^^
File "/Users/voglerr/Library/Application Support/pipx/venvs/lastversion/lib/python3.12/site-packages/lastversion/lastversion.py", line 890, in main
extract_file(url)
File "/Users/voglerr/Library/Application Support/pipx/venvs/lastversion/lib/python3.12/site-packages/lastversion/utils.py", line 415, in extract_file
extract_tar(buffer, mode)
File "/Users/voglerr/Library/Application Support/pipx/venvs/lastversion/lib/python3.12/site-packages/lastversion/utils.py", line 358, in extract_tar
with tarfile.open(fileobj=buffer, mode=mode) as tar_file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tarfile.py", line 1821, in open
return func(name, filemode, fileobj, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tarfile.py", line 1880, in gzopen
raise ReadError("not a gzip file") from e
tarfile.ReadError: not a gzip file
from lastversion.
Also, what's the difference between extract and unzip?
from lastversion.
Still does not work for me with #141:
$ pipx uninstall lastversion
uninstalled lastversion! ✨ 🌟 ✨
$ pipx install git+https://github.com/dvershinin/lastversion
installed package lastversion 3.4.6, installed using Python 3.12.1
These apps are now globally available
- lastversion
done! ✨ 🌟 ✨
$ lastversion --assets unzip SamusAranX/MinimalMIDIPlayer
MinimalMIDIPlayer-v1.13.zip: 7368.0KB [00:00, 44333.42KB/s]
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/lastversion/utils.py", line 378, in extract_tar_and_zip
with tarfile.open(fileobj=buffer, mode="r") as file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tarfile.py", line 1811, in open
raise ReadError(f"file could not be opened successfully:\n{error_msgs_summary}")
tarfile.ReadError: file could not be opened successfully:
- method gz: ReadError('not a gzip file')
- method bz2: ReadError('not a bzip2 file')
- method xz: ReadError('not an lzma file')
- method tar: ReadError('bad checksum')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/homebrew/bin/lastversion", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/lastversion/lastversion.py", line 889, in main
extract_file(url)
File "/opt/homebrew/lib/python3.11/site-packages/lastversion/utils.py", line 437, in extract_file
extract_tar_and_zip(buffer, to_dir=to_dir)
File "/opt/homebrew/lib/python3.11/site-packages/lastversion/utils.py", line 384, in extract_tar_and_zip
extract_archive(file)
File "/opt/homebrew/lib/python3.11/site-packages/lastversion/utils.py", line 373, in extract_archive
archive_file.extract(item, to_dir)
File "/opt/homebrew/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/zipfile.py", line 1664, in extract
return self._extract_member(member, path, pwd)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/zipfile.py", line 1735, in _extract_member
open(targetpath, "wb") as target:
^^^^^^^^^^^^^^^^^^^^^^
NotADirectoryError: [Errno 20] Not a directory: 'Contents/CodeResources'
from lastversion.
Thanks, works now 👍
$ lastversion --assets unzip SamusAranX/MinimalMIDIPlayer
MinimalMIDIPlayer-v1.13.zip: 7368.0KB [00:00, 30144.44KB/s]
$ ll | grep Mini
drwxr-xr-x 3 voglerr staff 96 Jan 26 20:46 MinimalMIDIPlayer.app
from lastversion.
Are you making a release for this? If not, I'll just keep pipx install git+https://github.com/dvershinin/lastversion
in my dotfiles for now.
from lastversion.
lastversion --assets unzip
still doesn't work for macOS apps:
$ open MinimalMIDIPlayer.app
The application cannot be opened for an unexpected reason, error=Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x6000020c4570 {Error Domain=NSPOSIXErrorDomain Code=111 "Unknown error: 111" UserInfo={NSLocalizedDescription=Launchd job spawn failed}}}
Whereas there's no problem with download
+ unzip
:
$ lastversion --assets download SamusAranX/MinimalMIDIPlayer
Downloaded MinimalMIDIPlayer-v1.13.zip: : 7368.0KB [00:00, 30527.86KB/s]
$ unzip MinimalMIDIPlayer-v1.13.zip
Archive: MinimalMIDIPlayer-v1.13.zip
creating: MinimalMIDIPlayer.app/
creating: MinimalMIDIPlayer.app/Contents/
inflating: MinimalMIDIPlayer.app/Contents/CodeResources
...
MinimalMIDIPlayer.app/Contents/Frameworks/Sparkle.framework/Versions/Current -> A
$ open MinimalMIDIPlayer.app
The contents and permissions seem to be the same.
from lastversion.
Related Issues (20)
- Feature: Could we get release date of the latest version on command line HOT 5
- Web API: /hooks/github is not implemented
- Wrong version of cadvisor HOT 2
- Wrong version of n8n HOT 5
- CRITICAL: API request was denied despite using an API token. Missing scopes? HOT 5
- [GitLab] CRITICAL - No release was found HOT 8
- [GitLab] Last version and tag missmatch HOT 1
- [GitLab] lastversion reports old version HOT 1
- Some projects return incorrect versions when using gt param HOT 1
- Support unpkg.com?
- Pre-release version being picked up as regular release HOT 7
- Release Candidate Pre Release not Shown HOT 2
- lastversion 3.5.0 requires cachecontrol<=0.12.11 but you have cachecontrol 0.14.0 which is incompatible, breaks lastversion when upgrading pip packages. HOT 1
- Problem fetching pulumi assets HOT 1
- Zero padding is not done with CalVer HOT 2
- Wrong last version when too much new tags
- HTTP Cache improvements
- "TypeError: Parser must be a string or character stream, not NoneType" when using against a private enterprise repository
- Incorrect versions detected as latest (icu4c, hdf5, bullet) HOT 2
- Lastversion fails for GitLab instances with non-standard ports
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lastversion.