krobertson/deb-s3 — pull request #26 by bazbremner (2014-01-28 18:31:19+00:00)
Title: Fix #11. Fallback to tar if ar fails

If `dpkg` isn't available, `ar` is used to extract control.tar.gz from the .deb and then tar to get the control file.

On OS X, ar reports

```
ar: control.tar.gz: not found in archive
```

This change attempts to list control.tar.gz using `ar`. If that works the existing behaviour is retained, otherwise (on OS X, for example), `tar` is attempted, which seems to do the right thing on OS X.

Also included is a tweak to only extract the control file, not the control and md5sum files.

Output on OS X is now:

```
>> Retrieving existing manifests
>> Examining package file package_name.deb
ar: control.tar.gz: not found in archive
Failed to find control data in .deb with ar, trying tar.
>> Uploading packages and new manifests to S3
```

I've not been able to hush the error from ar, I'm afraid.