Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame^] | 1 | From 02dbc7e3478e409d6f5e3e1c53daddf8838be999 Mon Sep 17 00:00:00 2001 |
| 2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> |
| 3 | Date: Tue, 1 Sep 2015 12:04:33 +0100 |
| 4 | Subject: [PATCH] Add support for deb and ipk packaging |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | |
| 8 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> |
| 9 | --- |
| 10 | functions.sh | 15 +++++++++++++++ |
| 11 | pkg-diff.sh | 6 ++++++ |
| 12 | 2 files changed, 21 insertions(+) |
| 13 | |
| 14 | diff --git a/functions.sh b/functions.sh |
| 15 | index 06079df..85c9003 100644 |
| 16 | --- a/functions.sh |
| 17 | +++ b/functions.sh |
| 18 | @@ -85,6 +85,13 @@ function unpackage() |
| 19 | CPIO_OPTS="--extract --unconditional --preserve-modification-time --make-directories --quiet" |
| 20 | rpm2cpio $file | cpio ${CPIO_OPTS} |
| 21 | ;; |
| 22 | + *.ipk|*.deb) |
| 23 | + ar x $file |
| 24 | + tar xf control.tar.gz |
| 25 | + rm control.tar.gz |
| 26 | + tar xf data.tar.gz |
| 27 | + rm data.tar.gz |
| 28 | + ;; |
| 29 | esac |
| 30 | popd 1>/dev/null |
| 31 | } |
| 32 | @@ -255,4 +262,12 @@ function cmp_spec () |
| 33 | rm $file1 $file2 |
| 34 | return $RES |
| 35 | } |
| 36 | + |
| 37 | +function adjust_controlfile () { |
| 38 | + cat $1/control | sed '/^Version: /d' > $1/control.fixed |
| 39 | + mv $1/control.fixed $1/control |
| 40 | + cat $2/control | sed '/^Version: /d' > $2/control.fixed |
| 41 | + mv $2/control.fixed $2/control |
| 42 | +} |
| 43 | + |
| 44 | # vim: tw=666 ts=2 et |
| 45 | diff --git a/pkg-diff.sh b/pkg-diff.sh |
| 46 | index 0f1fa76..3cf10aa 100644 |
| 47 | --- a/pkg-diff.sh |
| 48 | +++ b/pkg-diff.sh |
| 49 | @@ -138,6 +138,12 @@ echo "Extracting packages" |
| 50 | unpackage $oldpkg $dir/old |
| 51 | unpackage $newpkg $dir/new |
| 52 | |
| 53 | +case $oldpkg in |
| 54 | + *.deb|*.ipk) |
| 55 | + adjust_controlfile $dir/old $dir/new |
| 56 | + ;; |
| 57 | +esac |
| 58 | + |
| 59 | # files is set in cmp_spec for rpms, so if RES is empty we should assume |
| 60 | # it wasn't an rpm and pick all files for comparison. |
| 61 | if [ -z $RES ]; then |
| 62 | -- |
| 63 | 2.1.0 |
| 64 | |