From 25a00cae5bf702b9e844b05923a9c59de9df6788 Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Tue, 14 May 2013 15:10:14 +0200 Subject: Add gzip support for channel unpacking --- corepkgs/config.nix.in | 1 + corepkgs/unpack-channel.nix | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'corepkgs') diff --git a/corepkgs/config.nix.in b/corepkgs/config.nix.in index 6f6ec6de1a30..3819dc96c164 100644 --- a/corepkgs/config.nix.in +++ b/corepkgs/config.nix.in @@ -7,6 +7,7 @@ in { shell = "@shell@"; coreutils = "@coreutils@"; bzip2 = "@bzip2@"; + gzip = "@gzip@"; xz = "@xz@"; tar = "@tar@"; tarFlags = "@tarFlags@"; diff --git a/corepkgs/unpack-channel.nix b/corepkgs/unpack-channel.nix index 5c2a61e66946..b309fc41ec01 100644 --- a/corepkgs/unpack-channel.nix +++ b/corepkgs/unpack-channel.nix @@ -6,9 +6,12 @@ let '' mkdir $out cd $out - pat="\.xz\$" - if [[ "$src" =~ $pat ]]; then + xzpat="\.xz\$" + gzpat="\.gz\$" + if [[ "$src" =~ $xzpat ]]; then ${xz} -d < $src | ${tar} xf - ${tarFlags} + else if [[ "$src" =~ $gzpat ]]; then + ${gzip} -d < $src | ${tar} xf - ${tarFlags} else ${bzip2} -d < $src | ${tar} xf - ${tarFlags} fi -- cgit 1.4.1