New commits:
commit 3137d24e5a3935b8688181eaf09a8de5a6bc2a7e
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
libsorcery: added xz compression support #13176
commit d0bc3333f24494b513db41322bb26049d2f2bc08
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
libunpack: added xz, 7z and lzma support #13176
lzma untested, as there are no such spells
commit e022d72c4aa3b81c9163c6cf11b0f2f1a84dc274
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
final lzma archives have the magic byte
diff --git a/ChangeLog b/ChangeLog
index cfb6208..fff871c 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@
merged show_file from cabal and sorcery
merged display_file into show_file
* libsecurity: use filename_indicates_compression
+ * libunpack: added xz, 7z and lzma support #13176
+ * libsorcery: added xz compression support #13176
2011-09-14 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* config: unset GREP_OPTIONS in case the user set it to something bad
diff --git a/usr/share/man/man5/grimoire.5 b/usr/share/man/man5/grimoire.5
index 0286134..82ea9ce 100644
--- a/usr/share/man/man5/grimoire.5
+++ b/usr/share/man/man5/grimoire.5
@@ -116,7 +116,7 @@ This describes the unpacking process as performed in step
2 and current
working directory for this step is the $BUILD_DIRECTORY, usually /usr/src.
The default PRE_BUILD will work for the following compressions:
.IP
-bzip2, gzip, zip, RPM, tar
+bzip2, gzip, compress, zip, RPM, tar, xz, 7z, lzma
.PP
.I BUILD
.IP
diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index 37ec1e7..896e55d 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -1623,7 +1623,7 @@ function show_file() {
fi ;;
bzip2*) bzcat "$file" | $PAGER ;;
gzip*) gzip -cd "$file" | $PAGER ;;
- XZ*) xz -cd "$file" | $PAGER ;;
+ XZ*|LZMA*) xz -cd "$file" | $PAGER ;;
7-zip*) 7z -d "$file" | $PAGER ;;
*) message "Unknown file type."
return 1 ;;
diff --git a/var/lib/sorcery/modules/libsorcery
b/var/lib/sorcery/modules/libsorcery
index cf0afb9..daf4494 100755
--- a/var/lib/sorcery/modules/libsorcery
+++ b/var/lib/sorcery/modules/libsorcery
@@ -1178,6 +1178,7 @@ function set_compression_type() {
local B_HELP="bzip2 compression (slow, small files)"
local P_HELP="parallel bzip2 compression (slow unless on SMP, small files)"
+ local X_HELP="xz compression (slow compress, fast decompress, smallest
files)"
local G_HELP="gzip compression (fast, larger files)"
local T_HELP="no compression/tar (fastest, largest files)"
@@ -1214,6 +1216,16 @@ function set_compression_type() {
modify_local_config "COMPRESSBIN" "pbzip2" &&
COMPRESSBIN="pbzip2" &&
modify_local_config "EXTENSION" ".bz2" ;;
+ X)
+ if ! spell_ok xz-utils; then
+ clear_line
+ message "xz-utils is not installed on this system! Running cast
...\n"
+ sleep 2
+ cast xz-utils
+ fi &&
+ modify_local_config "COMPRESSBIN" "xz" &&
+ COMPRESSBIN="xz" &&
+ modify_local_config "EXTENSION" ".xz" ;;
G)
modify_local_config "COMPRESSBIN" "gzip" &&
COMPRESSBIN="gzip" &&
@@ -1233,11 +1245,11 @@ function set_compression_type() {
## @return 1 otherwise
## Returns true if the name of the file indicates that it should be
## a compressed file. In other words, this function returns true if
-## the filename ends in .gz, .tgz, .bz2, .zip, .rpm, or .Z.
+## the extension is .gz, .tgz, .bz2, .zip, .rpm, .Z, .xz, .7z or .lzma.
##
#---------------------------------------------------------------------
function filename_indicates_compression() {
- grep -qE "^.*\.(gz|tgz|bz2|zip|Z|rpm)$" <<< "$1"
+ grep -qE "^.*\.(gz|tgz|bz2|zip|Z|rpm|xz|7z|lzma)$" <<< "$1"
}