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
When "ditto" fails to extract an archive in PkgPayloadUnpacker, use "aa" if present #804
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer we use subprocess.run() instead of Popen, but this is not a blocker.
proc = subprocess.Popen( | ||
unpack_cmd, | ||
stdout=subprocess.PIPE, | ||
stderr=subprocess.PIPE, | ||
text=True, | ||
) | ||
proc.communicate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please prefer subprocess.run() instead of Popen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have another example from within autokglib
so I can follow the style? All I did was copy the existing code for the ditto
proc
command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grahampugh Some other examples:
autopkg/Scripts/bulk_repo_add.py
Line 79 in 7ba6e9d
subprocess.run(cmd, check=False, capture_output=True) |
autopkg/Code/autopkglib/URLGetter.py
Line 169 in 71a1737
result = subprocess.run( |
Can you show some output (doesn't have to be the whole output of a run) showing:
|
Here's a successful output:
Here's a failed output on a Mac that has
I don't currently have access to the device running Catalina or older to check the output when |
PS here's the output using
|
* Change PkgPayloadUnpacker to a custom processor until Autopkg is updated to include support. (autopkg/autopkg#804) * Removed version number of TV in comment
Is it possible that we get a Prerelease with that fix? :) |
@colorenz while we wait, I've created a clone of my fix at Alternatively you can copy the |
It looks like somebody else also created a custom processor to switch to |
@grahampugh Move this to :dev and I'll merge. |
@nmcspadden done. |
…aa" if present (#804) * Use aa if ditto fails * indenting error * better handling of errors * remove commented out test Co-authored-by: Graham Pugh <noemail@itscdgpmacmini>
…aa" if present (#804) * Use aa if ditto fails * indenting error * better handling of errors * remove commented out test Co-authored-by: Graham Pugh <noemail@itscdgpmacmini>
Modern Apple Archives fail to be extracted using
ditto
. Case in point is TeamViewer.pkg in justinrimmel-recipes.In Slack's
#autopkg
channel we have established that theaa
command can do the job instead. In fact, it seems to also be able to extract the Payload archives that are not modern Apple Archives but CPIO archive payloads.However,
aa
only appears to have been introduced on Big Sur, so can't replaceditto
just yet.This PR makes PkgPayloadUnpacker try
aa
only ifditto
fails andaa
is found at/usr/bin/aa
. Ifaa
is not present, theditto
failure is raised as a ProcessorError.