summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch
blob: 82fd8169ff371bbbf3511531dacef5b274147651 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 02dbc7e3478e409d6f5e3e1c53daddf8838be999 Mon Sep 17 00:00:00 2001
From: Paul Eggleton <paul.eggleton@linux.intel.com>
Date: Tue, 1 Sep 2015 12:04:33 +0100
Subject: [PATCH] Add support for deb and ipk packaging

Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pull/10]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 functions.sh | 15 +++++++++++++++
 pkg-diff.sh  |  6 ++++++
 2 files changed, 21 insertions(+)

diff --git a/functions.sh b/functions.sh
index 06079df..85c9003 100644
--- a/functions.sh
+++ b/functions.sh
@@ -85,6 +85,13 @@ function unpackage()
             CPIO_OPTS="--extract --unconditional --preserve-modification-time --make-directories --quiet"
             rpm2cpio $file | cpio ${CPIO_OPTS}
             ;;
+        *.ipk|*.deb)
+            ar x $file
+            tar xf control.tar.gz
+            rm control.tar.gz
+            tar xf data.tar.gz
+            rm data.tar.gz
+            ;;
     esac
     popd 1>/dev/null
 }
@@ -255,4 +262,12 @@ function cmp_spec ()
     rm $file1 $file2
     return $RES
 }
+
+function adjust_controlfile() {
+    cat $1/control | sed '/^Version: /d' > $1/control.fixed
+    mv $1/control.fixed $1/control
+    cat $2/control | sed '/^Version: /d' > $2/control.fixed
+    mv $2/control.fixed $2/control
+}
+
 # vim: tw=666 ts=2 et
diff --git a/pkg-diff.sh b/pkg-diff.sh
index 0f1fa76..3cf10aa 100644
--- a/pkg-diff.sh
+++ b/pkg-diff.sh
@@ -138,6 +138,12 @@ echo "Extracting packages"
 unpackage $oldpkg $dir/old
 unpackage $newpkg $dir/new
 
+case $oldpkg in
+  *.deb|*.ipk)
+     adjust_controlfile $dir/old $dir/new
+  ;;
+esac
+
 # files is set in cmp_spec for rpms, so if RES is empty we should assume
 # it wasn't an rpm and pick all files for comparison.
 if [ -z $RES ]; then
-- 
2.1.0