summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg-utils
diff options
context:
space:
mode:
authorAlejandro del Castillo <alejandro.delcastillo@ni.com>2018-12-26 17:59:05 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-27 22:52:58 +0000
commit5bcb626cf49d2295ccca45d6fc7e1617cca932d6 (patch)
tree440d2431ed078111c2bc21c8e77bf94465bebe54 /meta/recipes-devtools/opkg-utils
parent7dfee9b78daa5d25551704f27d0228b2c170fbcc (diff)
downloadpoky-5bcb626cf49d2295ccca45d6fc7e1617cca932d6.tar.gz
opkg-utils: upgrade to version 0.4.0
Drop patches already merged upstream. (From OE-Core rev: 19ac60adbfc9c3ea1896e7e0d83f3b33438c092b) Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/opkg-utils')
-rw-r--r--meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch51
-rw-r--r--meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch5
-rw-r--r--meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-Fix-link-relocation-support.patch40
-rw-r--r--meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch44
-rw-r--r--meta/recipes-devtools/opkg-utils/opkg-utils/pigz.patch51
-rw-r--r--meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch48
-rw-r--r--meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch18
-rw-r--r--meta/recipes-devtools/opkg-utils/opkg-utils_0.4.0.bb (renamed from meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb)10
8 files changed, 5 insertions, 262 deletions
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch
deleted file mode 100644
index 6b7ca7da3e..0000000000
--- a/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch
+++ /dev/null
@@ -1,51 +0,0 @@
1From ef5db062b7d25e6070acc6922ea48f50491313b5 Mon Sep 17 00:00:00 2001
2From: Michael Hansen <michael.j.hansen@hp.com>
3Date: Mon, 26 Feb 2018 09:42:56 -0800
4Subject: [PATCH 1/2] Only use --sort=name on versions of tar which support it.
5 This fixes compatibility with bsdtar and old versions of GNU tar (e.g.
6 RHEL6).
7
8Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
9Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
10Upstream-Status: Backport
11
12---
13 opkg-build | 11 ++++++++---
14 1 file changed, 8 insertions(+), 3 deletions(-)
15
16Index: opkg-utils-0.3.6/opkg-build
17===================================================================
18--- opkg-utils-0.3.6.orig/opkg-build
19+++ opkg-utils-0.3.6/opkg-build
20@@ -232,6 +232,11 @@ if [ $compressor = "gzip" ] ; then
21 compressorargs=$zipargs
22 fi
23
24+tsortargs=
25+if tar --help 2>&1 | grep -- "--sort=" > /dev/null; then
26+ tsortargs="--sort=name"
27+fi
28+
29 shift $(($OPTIND - 1))
30
31 # continue on to process additional arguments
32@@ -280,8 +285,8 @@ mkdir $tmp_dir
33 build_date="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
34
35 echo $CONTROL > $tmp_dir/tarX
36-( cd $pkg_dir && tar $ogargs --sort=name --mtime=$build_date -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
37-( cd $pkg_dir/$CONTROL && tar $ogargs --sort=name --mtime=$build_date -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
38+( cd $pkg_dir && tar $ogargs $tsortargs --mtime=$build_date -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
39+( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime=$build_date -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
40 rm $tmp_dir/tarX
41
42 echo "2.0" > $tmp_dir/debian-binary
43@@ -296,7 +301,7 @@ rm -f $pkg_file
44 if [ "$outer" = "ar" ] ; then
45 ( cd $tmp_dir && ar -crf $pkg_file ./debian-binary ./control.tar.gz ./data.tar.$cext )
46 else
47- ( cd $tmp_dir && tar -c --sort=name --mtime=$build_date $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
48+ ( cd $tmp_dir && tar -c $tsortargs --mtime=$build_date $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
49 fi
50
51 rm $tmp_dir/debian-binary $tmp_dir/data.tar.$cext $tmp_dir/control.tar.gz
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch
index c36ae2ffda..691ed50c2b 100644
--- a/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch
@@ -64,8 +64,9 @@ index 3f757f6..2988f9f 100755
64@@ -1,4 +1,4 @@ 64@@ -1,4 +1,4 @@
65-#!/usr/bin/env python 65-#!/usr/bin/env python
66+#!/usr/bin/env python3 66+#!/usr/bin/env python3
67 from __future__ import absolute_import 67 """
68 from __future__ import print_function 68 Utility to create opkg compatible indexes
69 """
69 70
70diff --git a/opkg-show-deps b/opkg-show-deps 71diff --git a/opkg-show-deps b/opkg-show-deps
71index 153f21e..4e18b4f 100755 72index 153f21e..4e18b4f 100755
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-Fix-link-relocation-support.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-Fix-link-relocation-support.patch
deleted file mode 100644
index 9dc488b7aa..0000000000
--- a/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-Fix-link-relocation-support.patch
+++ /dev/null
@@ -1,40 +0,0 @@
1From 18562ccae6996431d37767653b061d4e9e1b9424 Mon Sep 17 00:00:00 2001
2From: Niko Mauno <niko.mauno@iki.fi>
3Date: Sun, 11 Nov 2018 15:50:22 +0200
4Subject: [opkg-utils PATCH] update-alternatives: Fix link relocation support
5
6Commit fcb26339000021eb9bb711aa264247aebcfdd4ae which added Debian-style
7support for link relocation tries to relocate symbolic link on host OS,
8resulting in following-like error when two alternative packages have
9symbolic link source located in different directories (/bin/rev ->
10/bin/busybox.nosuid and /usr/bin/rev -> /usr/bin/rev.util-linux):
11
12 update-alternatives: renaming rev link from /bin/rev to /usr/bin/rev
13 mv: cannot stat '/bin/rev': No such file or directory
14
15Fix the issue by prefixing 'olink' and 'link' variable references with
16path to targeted root filesystem's root directory.
17
18Upstream-Status: Submitted [opkg-utils]
19
20Signed-off-by: Niko Mauno <niko.mauno@iki.fi>
21---
22 update-alternatives | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25diff --git a/update-alternatives b/update-alternatives
26index 89a440b..d4fa7eb 100644
27--- a/update-alternatives
28+++ b/update-alternatives
29@@ -58,7 +58,7 @@ register_alt() {
30 local link_str=`echo $link | protect_slashes`
31 sed -e "1s/.*/$link_str/" $ad/$name > $ad/$name.new
32 mv $ad/$name.new $ad/$name
33- mv $olink $link
34+ mv $OPKG_OFFLINE_ROOT$olink $OPKG_OFFLINE_ROOT$link
35 fi
36 else
37 echo "$link" > "$ad/$name"
38--
392.19.1
40
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch
deleted file mode 100644
index e338914b09..0000000000
--- a/meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1From 5727826b51cf99feaff3483a9df8af2043e7efc1 Mon Sep 17 00:00:00 2001
2From: Michael Hansen <michael.j.hansen@hp.com>
3Date: Mon, 26 Feb 2018 10:17:01 -0800
4Subject: [PATCH 2/2] opkg-build: Use local time for build_date, since opkg
5 extracts files assuming local time rather than UTC. Also increase resolution
6 of build date down to the second, rather than clamping to midnight of the
7 current date.
8
9Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
10Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
11Upstream-Status: Backport
12
13---
14 opkg-build | 8 ++++----
15 1 file changed, 4 insertions(+), 4 deletions(-)
16
17Index: opkg-utils-0.3.6/opkg-build
18===================================================================
19--- opkg-utils-0.3.6.orig/opkg-build
20+++ opkg-utils-0.3.6/opkg-build
21@@ -282,11 +282,11 @@ fi
22 tmp_dir=$dest_dir/IPKG_BUILD.$$
23 mkdir $tmp_dir
24
25-build_date="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
26+build_date="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" "+%Y-%m-%d %H:%M:%S")"
27
28 echo $CONTROL > $tmp_dir/tarX
29-( cd $pkg_dir && tar $ogargs $tsortargs --mtime=$build_date -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
30-( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime=$build_date -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
31+( cd $pkg_dir && tar $ogargs $tsortargs --mtime="$build_date" -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
32+( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime="$build_date" -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
33 rm $tmp_dir/tarX
34
35 echo "2.0" > $tmp_dir/debian-binary
36@@ -301,7 +301,7 @@ rm -f $pkg_file
37 if [ "$outer" = "ar" ] ; then
38 ( cd $tmp_dir && ar -crf $pkg_file ./debian-binary ./control.tar.gz ./data.tar.$cext )
39 else
40- ( cd $tmp_dir && tar -c $tsortargs --mtime=$build_date $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
41+ ( cd $tmp_dir && tar -c $tsortargs --mtime="$build_date" $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
42 fi
43
44 rm $tmp_dir/debian-binary $tmp_dir/data.tar.$cext $tmp_dir/control.tar.gz
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/pigz.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/pigz.patch
deleted file mode 100644
index dd433e8eb9..0000000000
--- a/meta/recipes-devtools/opkg-utils/opkg-utils/pigz.patch
+++ /dev/null
@@ -1,51 +0,0 @@
1From ab1436927b47badcd219a5f075dfc848020e061d Mon Sep 17 00:00:00 2001
2From: Mike Crowe <mac@mcrowe.com>
3Date: Thu, 4 Oct 2018 17:54:19 +0100
4Subject: [opkg-utils PATCH] opkg-build: Add support for explicit use of pigz
5To: opkg-devel@googlegroups.com,
6 yocto@yoctoproject.org
7
8oe-core has stopped[1] installing pigz as gzip. This means that in
9order to persuade opkg-build to use pigz it must be specified
10explicitly. Let's teach opkg-build to deal with being passed pigz as a
11compressor.
12
13We can't combine the check for whether -T is required with the one for
14gzip because opkg-build needs to call $compressor and gzip separately
15to construct the package.
16
17[1] http://lists.openembedded.org/pipermail/openembedded-commits/2018-February/218767.html
18
19Upstream-Status: Submitted [opkg-devel@googlegroups.com https://groups.google.com/forum/#!topic/opkg-devel/E0WVOhjK61w]
20Signed-off-by: Mike Crowe <mac@mcrowe.com>
21---
22 opkg-build | 6 +++++-
23 1 file changed, 5 insertions(+), 1 deletion(-)
24
25diff --git a/opkg-build b/opkg-build
26index 93a7956..f8403ea 100755
27--- a/opkg-build
28+++ b/opkg-build
29@@ -170,7 +170,7 @@ fi
30
31 compressor_ext() {
32 case $1 in
33- gzip)
34+ gzip|pigz)
35 echo gz
36 ;;
37 bzip2)
38@@ -232,6 +232,10 @@ if [ $compressor = "gzip" ] ; then
39 compressorargs=$zipargs
40 elif [ $compressor = "xz" ] ; then
41 compressorargs="--threads 0"
42+elif [ $compressor = "pigz" ] ; then
43+ if $compressor --help 2>&1 | grep -- "-T" > /dev/null; then
44+ compressorargs="-9nT"
45+ fi
46 fi
47
48 tsortargs=
49--
502.11.0
51
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
deleted file mode 100644
index d8931b281f..0000000000
--- a/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
+++ /dev/null
@@ -1,48 +0,0 @@
1If a the number of hard links decreases or increases while creating
2the tar files used for an ipk package, tar fails with error code 1:
3
4| DEBUG: Executing python function do_package_ipk
5| tar: ./usr/src/debug/gperf/3.0.4-r0/gperf-3.0.4/src/main.cc: file changed as we read it
6NOTE: recipe gperf-3.0.4-r0: task do_package_write_ipk: Failed
7ERROR: Task 6539 (recipes-extended/gperf/gperf_3.0.4.bb, do_package_write_ipk) failed with exit code '1'
8
9
10We detect if the error code produced by tar is 1 and in this case ignore it.
11
12This a similar behavior to the one on dpkg:
13http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=40731942515ec8d80c727ad561174986d4f05818
14
15Upstream-Status: Inappropriate
16
17Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
18
19
20Index: git/opkg-build
21
22===================================================================
23--- git.orig/opkg-build
24+++ git/opkg-build
25@@ -285,8 +285,21 @@ mkdir $tmp_dir
26 build_date="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" "+%Y-%m-%d %H:%M:%S")"
27
28 echo $CONTROL > $tmp_dir/tarX
29-( cd $pkg_dir && tar $ogargs $tsortargs --mtime="$build_date" -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
30-( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime="$build_date" -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
31+
32+
33+# Ignore error code 1, caused by modifying the number of hard links while creating the tar file
34+rc=0
35+( cd $pkg_dir && tar $ogargs $tsortargs --mtime="$build_date" -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext ) || rc=$?
36+if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
37+ exit $rc
38+fi
39+
40+rc=0
41+( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime="$build_date" -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz ) || rc=$?
42+if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
43+ exit $rc
44+fi
45+
46 rm $tmp_dir/tarX
47
48 echo "2.0" > $tmp_dir/debian-binary
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch
deleted file mode 100644
index 13a49f9170..0000000000
--- a/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch
+++ /dev/null
@@ -1,18 +0,0 @@
1Pass --threads=0 to xz so that it will use as many threads as there are cores to compress the packages. This makes qemu's do_package_ipk run in 34s instead of 275s on my machine.
2
3Upstream-Status: Inappropriate (ugly but works, discussing with upstream now)
4Signed-off-by: Ross Burton <ross.burton@intel.com>
5
6diff --git a/opkg-build b/opkg-build
7index 0050c2b..93a7956 100755
8--- a/opkg-build
9+++ b/opkg-build
10@@ -230,6 +230,8 @@ if gzip --help 2>&1 | grep -- "-T" > /dev/null; then
11 fi
12 if [ $compressor = "gzip" ] ; then
13 compressorargs=$zipargs
14+elif [ $compressor = "xz" ] ; then
15+ compressorargs="--threads 0"
16 fi
17
18 tsortargs=
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.0.bb
index 4c41774c39..eab74eabd6 100644
--- a/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.0.bb
@@ -9,18 +9,12 @@ PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtu
9 9
10SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \ 10SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \
11 file://0001-Switch-all-scripts-to-use-Python-3.x.patch \ 11 file://0001-Switch-all-scripts-to-use-Python-3.x.patch \
12 file://0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch \
13 file://0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch \
14 file://threaded-xz.patch \
15 file://pigz.patch \
16 file://0001-update-alternatives-Fix-link-relocation-support.patch \
17" 12"
18SRC_URI_append_class-native = " file://tar_ignore_error.patch"
19UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/" 13UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/"
20 14
21 15
22SRC_URI[md5sum] = "391c1c80aca26961375dd22e1d2d0cbf" 16SRC_URI[md5sum] = "6e1c2eae96239520a8eb3d05372773ea"
23SRC_URI[sha256sum] = "26b3f4dd1c1ef65f519d4cddfb35ebea41ae8af989aea2699a39783598c33769" 17SRC_URI[sha256sum] = "8153f4e5dadde422d35feaf86bf595266af9d0037389bc418fa87feb0437efb3"
24 18
25TARGET_CC_ARCH += "${LDFLAGS}" 19TARGET_CC_ARCH += "${LDFLAGS}"
26 20