Fix repacking with 7z

This commit is contained in:
Bastian Kleineidam 2013-04-05 18:46:30 +02:00
parent 7f07ae5aa5
commit f25df56733
2 changed files with 13 additions and 4 deletions

View File

@ -1,6 +1,7 @@
1.1 "" (released xx.xx.2013) 1.1 "" (released xx.xx.2013)
* Add support for zopfli, Googles new zlib compressor. * Add support for zopfli, Googles new zlib compressor.
* Fix an error repacking compressed tar archives with 7z.
1.0 "Robot and Frank" (released 1.3.2013) 1.0 "Robot and Frank" (released 1.3.2013)

View File

@ -15,14 +15,24 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Archive commands for the 7z program.""" """Archive commands for the 7z program."""
def extract_7z (archive, compression, cmd, verbosity, outdir): def extract_7z(archive, compression, cmd, verbosity, outdir):
"""Extract a 7z archive.""" """Extract a 7z archive."""
return [cmd, 'x', '-o%s' % outdir, '--', archive] return [cmd, 'x', '-o%s' % outdir, '--', archive]
def extract_7z_singlefile(archive, compression, cmd, verbosity, outdir):
"""Extract a singlefile archive (eg. gzip or bzip2) with '7z e'.
This makes sure a single file and no subdirectories are created,
which would cause errors with patool repack."""
return [cmd, 'e', '-o%s' % outdir, '--', archive]
extract_bzip2 = \ extract_bzip2 = \
extract_gzip = \ extract_gzip = \
extract_zip = \
extract_compress = \ extract_compress = \
extract_xz = \
extract_lzma = \
extract_7z_singlefile
extract_zip = \
extract_rar = \ extract_rar = \
extract_cab = \ extract_cab = \
extract_arj = \ extract_arj = \
@ -30,8 +40,6 @@ extract_bzip2 = \
extract_rpm = \ extract_rpm = \
extract_deb = \ extract_deb = \
extract_iso = \ extract_iso = \
extract_xz = \
extract_lzma = \
extract_7z extract_7z
def list_7z (archive, compression, cmd, verbosity): def list_7z (archive, compression, cmd, verbosity):