build-compare: add support for examining deb and ipk packages

This is just rudimentary support at the moment as we'd potentially want
to compare the control files a bit more specifically than this does, but
it's a start.

(From OE-Core rev: 60564c6d6b8c1a3813baa04fb0d5597cf63f2a9f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2015-09-08 14:41:51 +01:00 committed by Richard Purdie
parent 3a9e230b7a
commit 29e94f671b
2 changed files with 69 additions and 3 deletions

View File

@ -5,9 +5,11 @@ HOMEPAGE = "https://github.com/openSUSE/build-compare"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
SRC_URI = "git://github.com/openSUSE/build-compare.git"
SRC_URI += "file://Rename-rpm-check.sh-to-pkg-diff.sh.patch;striplevel=1"
SRC_URI += "file://Ignore-DWARF-sections.patch;striplevel=1"
SRC_URI = "git://github.com/openSUSE/build-compare.git \
file://Rename-rpm-check.sh-to-pkg-diff.sh.patch;striplevel=1 \
file://Ignore-DWARF-sections.patch;striplevel=1 \
file://0001-Add-support-for-deb-and-ipk-packaging.patch \
"
PATCHTOOL = "git"
SRCREV = "c5352c054c6ef15735da31b76d6d88620f4aff0a"

View File

@ -0,0 +1,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: Pending
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