Skip to content
Snippets Groups Projects
Commit a93aa33d authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Always pass a filename with a ".zip" extension to zipnote, otherwise it will...

Always pass a filename with a ".zip" extension to zipnote, otherwise it will return with an exit code of 9 and revert to a binary diff for the entire file.

eg:

```
├── scrcpy-server_1.11+ds-1_all.deb
│ ├── data.tar.xz
│ │ ├── data.tar
│ │ │ ├── ./usr/share/scrcpy/scrcpy-server
│ │ │ │┄ Command `zipnote /srv/reproducible-results/rbuild-debian/tmp.nUXKuYqaZC/dbd-tmp-LUse4MQ/diffoscope_umwd1nq2/tmp0lwevy98/0/8` exited with exit code 9. Standard output:
│ │ │ │┄     zipnote error: Interrupted (aborting)
│ │ │ │ @@ -1,20 +1,20 @@
│ │ │ │ -00000000: 504b 0304 1400 0808 0800 a914 9b4f 0000  PK...........O..
│ │ │ │ +00000000: 504b 0304 1400 0808 0800 6558 3d52 0000  PK........eX=R..
│ │ │ │  00000010: 0000 0000 0000 0000 0000 0900 0400 4d45  ..............ME
```
parent 5da3f5ef
No related branches found
No related tags found
No related merge requests found
Pipeline #96782 passed
......@@ -27,6 +27,7 @@ from diffoscope.config import Config
from diffoscope.tools import tool_required
from diffoscope.difference import Difference
from diffoscope.exc import ContainerExtractionError
from diffoscope.tempfiles import get_named_temporary_file
from .utils.file import File
from .directory import Directory
......@@ -78,7 +79,11 @@ class Zipnote(Command):
@tool_required('zipnote')
def cmdline(self):
return ['zipnote', self.path]
path = self.path
if not path.endswith('.zip'):
path = get_named_temporary_file(suffix='.zip').name
shutil.copy(self.path, path)
return ['zipnote', path]
@property
def returncode(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment