summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-07-17 20:32:45 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-26 08:56:28 +0100
commit9621959a3ad052af33bb8a5ed530f8e84b799f0d (patch)
tree6a571f530a6abf7b10191773c54655055f983585 /meta/recipes-devtools
parentad6aae31065b798b6f6f83eb830cebb075a0b62a (diff)
downloadpoky-9621959a3ad052af33bb8a5ed530f8e84b799f0d.tar.gz
build-compare: improve deb and ipk checking
* The deb and ipk's depends version string is like: Depends: libc6 (>= 2.24) Update trim_release_old and trim_release_new to match the bracket in the end ")". * The deb's data tarball now is .tar.xz, and ipk's is .tar.gz. * Update adjust_controlfile() to make ituse trim_release_old and trim_release_new. (From OE-Core rev: c92152e521a9f96a741eccd4a4bf5ddfbd59a7ae) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/build-compare/build-compare_git.bb1
-rw-r--r--meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch4
-rw-r--r--meta/recipes-devtools/build-compare/files/functions.sh-improve-deb-and-ipk-checking.patch117
3 files changed, 120 insertions, 2 deletions
diff --git a/meta/recipes-devtools/build-compare/build-compare_git.bb b/meta/recipes-devtools/build-compare/build-compare_git.bb
index 09740d4921..fa9c6b45d3 100644
--- a/meta/recipes-devtools/build-compare/build-compare_git.bb
+++ b/meta/recipes-devtools/build-compare/build-compare_git.bb
@@ -14,6 +14,7 @@ SRC_URI = "git://github.com/openSUSE/build-compare.git \
14 file://pkg-diff.sh-check-for-fifo-named-pipe.patch \ 14 file://pkg-diff.sh-check-for-fifo-named-pipe.patch \
15 file://pkg-diff.sh-check_single_file-return-at-once-when-sa.patch \ 15 file://pkg-diff.sh-check_single_file-return-at-once-when-sa.patch \
16 file://pkg-diff.sh-remove-space-in-the-end-for-ftype.patch \ 16 file://pkg-diff.sh-remove-space-in-the-end-for-ftype.patch \
17 file://functions.sh-improve-deb-and-ipk-checking.patch \
17 " 18 "
18 19
19SRCREV = "c5352c054c6ef15735da31b76d6d88620f4aff0a" 20SRCREV = "c5352c054c6ef15735da31b76d6d88620f4aff0a"
diff --git a/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch b/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch
index 5c15218c8a..82fd8169ff 100644
--- a/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch
+++ b/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch
@@ -3,7 +3,7 @@ From: Paul Eggleton <paul.eggleton@linux.intel.com>
3Date: Tue, 1 Sep 2015 12:04:33 +0100 3Date: Tue, 1 Sep 2015 12:04:33 +0100
4Subject: [PATCH] Add support for deb and ipk packaging 4Subject: [PATCH] Add support for deb and ipk packaging
5 5
6Upstream-Status: Pending 6Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pull/10]
7 7
8Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> 8Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
9--- 9---
@@ -34,7 +34,7 @@ index 06079df..85c9003 100644
34 return $RES 34 return $RES
35 } 35 }
36+ 36+
37+function adjust_controlfile () { 37+function adjust_controlfile() {
38+ cat $1/control | sed '/^Version: /d' > $1/control.fixed 38+ cat $1/control | sed '/^Version: /d' > $1/control.fixed
39+ mv $1/control.fixed $1/control 39+ mv $1/control.fixed $1/control
40+ cat $2/control | sed '/^Version: /d' > $2/control.fixed 40+ cat $2/control | sed '/^Version: /d' > $2/control.fixed
diff --git a/meta/recipes-devtools/build-compare/files/functions.sh-improve-deb-and-ipk-checking.patch b/meta/recipes-devtools/build-compare/files/functions.sh-improve-deb-and-ipk-checking.patch
new file mode 100644
index 0000000000..05420f89f7
--- /dev/null
+++ b/meta/recipes-devtools/build-compare/files/functions.sh-improve-deb-and-ipk-checking.patch
@@ -0,0 +1,117 @@
1From b4eb7fde10318162bd2d02b9017ef51746752a91 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Thu, 14 Jul 2016 23:14:21 -0700
4Subject: [PATCH 4/4] functions.sh: improve deb and ipk checking
5
6* The deb and ipk's depends version string is like:
7 Depends: libc6 (>= 2.24)
8 Update trim_release_old and trim_release_new to match the bracket in
9 the end ")".
10
11* The deb's data tarball now is .tar.xz, and ipk's is .tar.gz.
12
13* Update adjust_controlfile() to make ituse trim_release_old and
14 trim_release_new.
15
16Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pull/10]
17
18Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
19---
20 functions.sh | 45 ++++++++++++++++++++++++++++-----------------
21 1 file changed, 28 insertions(+), 17 deletions(-)
22
23diff --git a/functions.sh b/functions.sh
24index aa572f9..fe493ba 100755
25--- a/functions.sh
26+++ b/functions.sh
27@@ -78,7 +78,7 @@ check_header()
28 function trim_release_old()
29 {
30 sed -e "
31- /\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_old_regex_l\$\)/{s,$version_release_old_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_old_regex_s,@VERSION@-@RELEASE_SHORT@,g}
32+ /\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_old_regex_l\$\|$version_release_old_regex_l)\)/{s,$version_release_old_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_old_regex_s,@VERSION@-@RELEASE_SHORT@,g}
33 s/\(\/var\/adm\/update-scripts\/\)${name_ver_rel_old_regex_l}\([^[:blank:]]\+\)/\1@NAME_VER_REL@\2/g
34 s/^ *//g
35 "
36@@ -86,7 +86,7 @@ function trim_release_old()
37 function trim_release_new()
38 {
39 sed -e "
40- /\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_new_regex_l\$\)/{s,$version_release_new_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_new_regex_s,@VERSION@-@RELEASE_SHORT@,g}
41+ /\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_new_regex_l\$\|$version_release_new_regex_l)\)/{s,$version_release_new_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_new_regex_s,@VERSION@-@RELEASE_SHORT@,g}
42 s/\(\/var\/adm\/update-scripts\/\)${name_ver_rel_new_regex_l}\([^[:blank:]]\+\)/\1@NAME_VER_REL@\2/g
43 s/^ *//g
44 "
45@@ -133,8 +133,8 @@ function unpackage()
46 ar x $file
47 tar xf control.tar.gz
48 rm control.tar.gz
49- tar xf data.tar.gz
50- rm data.tar.gz
51+ tar xf data.tar.[xg]z
52+ rm data.tar.[xg]z
53 ;;
54 esac
55 popd 1>/dev/null
56@@ -164,6 +164,22 @@ function get_value()
57 sed -n -e "/^___${1}___/,/^___${1}___/p" $2 | sed -e "/^___${1}___/d"
58 }
59
60+# Set version_release_old_regex_s, version_release_old_regex_l and
61+# name_ver_rel_old_regex_l, also the new ones.
62+function set_regex() {
63+ # Remember to quote the . which is in release
64+ # Short version without B_CN
65+ version_release_old_regex_s=${version_release_old%.*}
66+ version_release_old_regex_s=${version_release_old_regex_s//./\\.}
67+ version_release_new_regex_s=${version_release_new%.*}
68+ version_release_new_regex_s=${version_release_new_regex_s//./\\.}
69+ # Long version with B_CNT
70+ version_release_old_regex_l=${version_release_old//./\\.}
71+ version_release_new_regex_l=${version_release_new//./\\.}
72+ name_ver_rel_old_regex_l=${name_ver_rel_old//./\\.}
73+ name_ver_rel_new_regex_l=${name_ver_rel_new//./\\.}
74+}
75+
76 # Compare just the rpm meta data of two rpms
77 # Returns:
78 # 0 in case of same content
79@@ -194,17 +210,7 @@ function cmp_spec ()
80 version_release_old="$(get_value QF_VER_REL $spec_old)"
81 name_ver_rel_old="$(get_value QF_NAME_VER_REL $spec_old)"
82
83- # Remember to quote the . which is in release
84- # Short version without B_CN
85- version_release_old_regex_s=${version_release_old%.*}
86- version_release_old_regex_s=${version_release_old_regex_s//./\\.}
87- version_release_new_regex_s=${version_release_new%.*}
88- version_release_new_regex_s=${version_release_new_regex_s//./\\.}
89- # Long version with B_CNT
90- version_release_old_regex_l=${version_release_old//./\\.}
91- version_release_new_regex_l=${version_release_new//./\\.}
92- name_ver_rel_old_regex_l=${name_ver_rel_old//./\\.}
93- name_ver_rel_new_regex_l=${name_ver_rel_new//./\\.}
94+ set_regex
95
96 # Check the whole spec file at first, return 0 immediately if the
97 # are the same.
98@@ -285,9 +291,14 @@ function cmp_spec ()
99 }
100
101 function adjust_controlfile() {
102- cat $1/control | sed '/^Version: /d' > $1/control.fixed
103+ version_release_old="`sed -ne 's/^Version: \(.*\)/\1/p' $1/control`"
104+ name_ver_rel_old="`sed -n -e 's/^Package: \(.*\)/\1/p' $1/control`-`sed -n -e 's/^Version: \(.*\)/\1/p' $1/control`"
105+ version_release_new="`sed -ne 's/^Version: \(.*\)/\1/p' $2/control`"
106+ name_ver_rel_new="`sed -n -e 's/^Package: \(.*\)/\1/p' $2/control`-`sed -n -e 's/^Version: \(.*\)/\1/p' $2/control`"
107+ set_regex
108+ cat $1/control | trim_release_old > $1/control.fixed
109 mv $1/control.fixed $1/control
110- cat $2/control | sed '/^Version: /d' > $2/control.fixed
111+ cat $2/control | trim_release_new > $2/control.fixed
112 mv $2/control.fixed $2/control
113 }
114
115--
1162.9.0
117