Skip to contentSkip to conversation

opkg-build: Add support for explicit pigz

PATCH In review Mike Crowe 2 participants 2 messages Oct 4, 2018 – Oct 5, 2018

lore
Share & tools
lore

Mike Crowe

author
#0 lore raw

PATCH 1/1 opkg-build: Add support for explicit pigz

From: Mike Crowe <[email protected]>

oe-core has stopped[1] installing pigz as gzip. This means that in order to persuade opkg-build to use pigz it must be specified explicitly. Let's teach opkg-build to deal with being passed pigz as a compressor. We can't combine the check for whether -T is required because opkg-build calls both $compressor and gzip explicitly.

---
 opkg-build | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
opkg-build +5 -1
index 0050c2b..d5f5b8f 100755
@@ -170,7 +170,7 @@ fi
 
 compressor_ext() {
     case $1 in
-	gzip)
+	gzip|pigz)
 	    echo gz
 	    ;;
 	bzip2)
@@ -230,6 +230,10 @@ if gzip --help 2>&1 | grep -- "-T" > /dev/null; then
 fi
 if [ $compressor = "gzip" ] ; then
 	compressorargs=$zipargs
+elif [ $compressor = "pigz" ] ; then
+	if $compressor --help 2>&1 | grep -- "-T" > /dev/null; then
+		compressorargs="-9nT"
+	fi
 fi
 
 tsortargs=
Signature · 1 line
2.11.0
#1 lore raw

Hi Mike,

Thanks for the patch! Just merged it into master (I updated the man page to reflect the new option)

Quoted 38 lines · Mike Crowe

From: Mike Crowe <[email protected]>

oe-core has stopped[1] installing pigz as gzip. This means that in order to persuade opkg-build to use pigz it must be specified explicitly. Let's teach opkg-build to deal with being passed pigz as a compressor. We can't combine the check for whether -T is required because opkg-build calls both $compressor and gzip explicitly.

---
  opkg-build | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
opkg-build +5 -1
index 0050c2b..d5f5b8f 100755
@@ -170,7 +170,7 @@ fi
 
  compressor_ext() {
      case $1 in
-	gzip)
+	gzip|pigz)
  	    echo gz
  	    ;;
  	bzip2)
@@ -230,6 +230,10 @@ if gzip --help 2>&1 | grep -- "-T" > /dev/null; then
  fi
  if [ $compressor = "gzip" ] ; then
  	compressorargs=$zipargs
+elif [ $compressor = "pigz" ] ; then
+	if $compressor --help 2>&1 | grep -- "-T" > /dev/null; then
+		compressorargs="-9nT"
+	fi
  fi
 
  tsortargs=
Signature · 3 lines
Cheers,

Alejandro