summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro del Castillo <alejandro.delcastillo@ni.com>2018-11-09 13:11:46 -0600
committerAlejandro del Castillo <alejandro.delcastillo@ni.com>2018-11-13 09:18:09 -0600
commit49d32419abec4142995f3ed6f840137c8a72f3b3 (patch)
tree068973ba9bd8df3bb114fcece8af14cf8c59df3f
parent37f2ddb196a8bf33355cf82f182c57f3de6ef0a5 (diff)
downloadopkg-utils-49d32419abec4142995f3ed6f840137c8a72f3b3.tar.gz
opkg-utils-49d32419abec4142995f3ed6f840137c8a72f3b3.tar.bz2
opkg-utils-49d32419abec4142995f3ed6f840137c8a72f3b3.zip
opkg-build: add compressor arguments command line argument
If specified, overwrites the default compressor flags. Fixes bugzilla #12611 Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
-rwxr-xr-xopkg-build25
1 files changed, 17 insertions, 8 deletions
diff --git a/opkg-build b/opkg-build
index 937f2f3..0d3ca23 100755
--- a/opkg-build
+++ b/opkg-build
@@ -189,12 +189,12 @@ compressor_ext() {
: <<=cut
=head1 SYNOPSIS
-B<opkg-build> [B<-c>] [B<-C>] [B<-Z> I<compressor>] [B<-O>] [B<-o> I<owner>] [B<-g> I<group>] I<pkg_directory> [I<destination_directory>]
+B<opkg-build> [B<-c>] [B<-C>] [B<-Z> I<compressor>] [B<-a>] [B<-O>] [B<-o> I<owner>] [B<-g> I<group>] I<pkg_directory> [I<destination_directory>]
=cut
-usage="Usage: $0 [-c] [-C] [-Z compressor] [-O] [-o owner] [-g group] <pkg_directory> [<destination_directory>]"
-while getopts "cCg:ho:vOZ:" opt; do
+usage="Usage: $0 [-c] [-C] [-Z compressor] [-a] [-O] [-o owner] [-g group] <pkg_directory> [<destination_directory>]"
+while getopts "a:cCg:ho:vOZ:" opt; do
case $opt in
o ) owner=$OPTARG
ogargs="--owner=$owner"
@@ -210,6 +210,8 @@ while getopts "cCg:ho:vOZ:" opt; do
;;
Z ) compressor=$OPTARG
;;
+ a ) compressorargs=$OPTARG
+ ;;
v ) echo $version
exit 0
;;
@@ -228,11 +230,14 @@ cext=$(compressor_ext $compressor)
if gzip --help 2>&1 | grep -- "-T" > /dev/null; then
zipargs="-9nT"
fi
-if [ $compressor = "gzip" ] ; then
- compressorargs=$zipargs
-elif [ $compressor = "pigz" ] ; then
- if $compressor --help 2>&1 | grep -- "-T" > /dev/null; then
- compressorargs="-9nT"
+
+if [ compressorargs = "" ] ; then
+ if [ $compressor = "gzip" ] ; then
+ compressorargs=$zipargs
+ elif [ $compressor = "pigz" ] ; then
+ if $compressor --help 2>&1 | grep -- "-T" > /dev/null; then
+ compressorargs="-9nT"
+ fi
fi
fi
@@ -343,6 +348,10 @@ Stop with an error if any files ending with B<~> are found. The default behaviou
Specify which compression type to use when building a package. Allowed values are B<gzip>, B<pigz>, B<bzip2> and B<xz> (default is B<gzip>).
+=item B<-a> I<compressor-args>
+
+Specify the arguments used by the compressor. Overrides the default values.
+
=item B<-O>
Use B<.opk> extension. By default, B<.ipk> is used.