Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (3137d24e5a3935b8688181eaf09a8de5a6bc2a7e)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (3137d24e5a3935b8688181eaf09a8de5a6bc2a7e)
  • Date: Thu, 15 Sep 2011 07:36:43 -0500

GIT changes to master sorcery by Jaka Kranjc <lynxlynxlynx AT sourcemage.org>:

ChangeLog | 2 ++
usr/share/man/man5/grimoire.5 | 2 +-
var/lib/sorcery/modules/libmisc | 2 +-
var/lib/sorcery/modules/libsorcery | 16 ++++++++++++++--
var/lib/sorcery/modules/libtrack | 2 +-
var/lib/sorcery/modules/libunpack | 7 ++++++-
6 files changed, 25 insertions(+), 6 deletions(-)

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)"

@@ -1192,6 +1193,7 @@ function set_compression_type() {
0 0 0 \
"B" "bzip2 compression" "$B_HELP" \
"P" "pbzip2 compression (parallel bzip2)"
"$P_HELP" \
+ "X" "xz compression" "$X_HELP" \
"G" "gzip compression" "$G_HELP" \
"T" "no compression/tar" "$T_HELP"'`

@@ -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"
}

#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libtrack
b/var/lib/sorcery/modules/libtrack
index ed0a462..0b5762a 100755
--- a/var/lib/sorcery/modules/libtrack
+++ b/var/lib/sorcery/modules/libtrack
@@ -426,7 +426,7 @@ function create_cache_archive() {
rm $TMP_DATA $TMP_MDATA

case "$COMPRESSBIN" in
- gzip|bzip2|pbzip2)
+ gzip|bzip2|pbzip2|xz)
$COMPRESSBIN -c $CACHE > $CACHE_COMP
rm $CACHE
;;
diff --git a/var/lib/sorcery/modules/libunpack
b/var/lib/sorcery/modules/libunpack
index d7bf9a9..0b883a6 100755
--- a/var/lib/sorcery/modules/libunpack
+++ b/var/lib/sorcery/modules/libunpack
@@ -204,6 +204,9 @@ function uncompress_core() {
Zip) cat "$1" ;;
RPM) rpmunpack < "$1" | gzip -cd ;;
tar) cat "$1" ;;
+ XZ) xz -cdf "$1" ;;
+ LZMA) xz -cdf "$1" ;;
+ 7-zip) cat "$1" ;; # 7z supports stdout, but it unpacks at the
same time
*) cat "$1" ;;
esac

@@ -224,7 +227,7 @@ function unpack_core() {
debug "libgrimoire" "unpack_core - $*"

case "$2" in
- bzip2|gzip|compress*|tar)
+ bzip2|gzip|compress*|tar|XZ|LZMA)
if real_list_find "$3" same-permissions; then
tar -xf /dev/stdin 2> /dev/null
else
@@ -233,6 +236,8 @@ function unpack_core() {
fi || cat > /dev/null ;;
Zip) cat /dev/stdin >/dev/null #get rid of unused output
unzip -q "$1" ;;
+ 7-zip) cat /dev/stdin >/dev/null #get rid of unused output
+ 7z e "$1" ;;
RPM) cpio -idm < /dev/stdin ;;
*) cat > /dev/null ;;
esac



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (3137d24e5a3935b8688181eaf09a8de5a6bc2a7e), Jaka Kranjc, 09/15/2011

Archive powered by MHonArc 2.6.24.

Top of Page