Patchwork [precise,1/2] UBUNTU: [Packaging] getabis should be extracting all packages

login
register
mail settings
Submitter Andy Whitcroft
Date July 5, 2012, 12:46 p.m.
Message ID <1341492369-24650-5-git-send-email-apw@canonical.com>
Download mbox | patch
Permalink /patch/169143/
State New
Headers show

Comments

Andy Whitcroft - July 5, 2012, 12:46 p.m.
We should be extracting both the linux-image and linux-image-extras
packages when calculating the ABI and module lists.

BugLink: http://bugs.launchpad.net/bugs/1021174
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 debian/scripts/misc/getabis |   37 ++++++++++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 9 deletions(-)

Patch

diff --git a/debian/scripts/misc/getabis b/debian/scripts/misc/getabis
index 708b7b2..b35639c 100755
--- a/debian/scripts/misc/getabis
+++ b/debian/scripts/misc/getabis
@@ -23,6 +23,10 @@  fwinfo=$abidir/fwinfo
 
 test -d $tmpdir || mkdir $tmpdir
 
+package_prefixes() {
+	__package_prefixes="$@"
+}
+
 getall() {
 	arch=$1
 	shift
@@ -35,17 +39,30 @@  getall() {
 			continue
 		fi
 		echo -n "Fetching $sub..."
-		filename=linux-image-${verabi}-${sub}_${verfull}_${arch}.deb
+		prefixes=""
+		filenames=""
 		cd $tmpdir
-		for r in "${repo_list[@]}"
+		for prefix in $__package_prefixes
 		do
-			if ! [ -f $filename ]; then
-				$WGET $r/$filename
-			fi
+			filename=${prefix}-${verabi}-${sub}_${verfull}_${arch}.deb
+			for r in "${repo_list[@]}"
+			do
+				if ! [ -f $filename ]; then
+					$WGET $r/$filename
+				fi
+				if [ -f $filename ]; then
+					prefixes="$prefixes $prefix"
+					filenames="$filenames $filename"
+					break
+				fi
+			done
 		done
-		if [ "$?" = "0" ]; then
-			echo -n "extracting..."
-			dpkg-deb --extract $filename tmp
+		if [ "$filenames" != "" ]; then
+			echo -n "extracting$prefixes..."
+			for filename in $filenames
+			do
+				dpkg-deb --extract $filename tmp
+			done
 			find tmp -name "*.ko" | while read f; do
 				modinfo $f | grep ^firmware >> $fwinfo
 			done
@@ -71,7 +88,7 @@  getall() {
 				version=`cat $abidir/$arch/$sub.compiler`
 				echo -n "$version..."
 			)
-			rm -rf tmp $filename
+			rm -rf tmp $filenames
 			echo "done."
 		else
 			echo "FAILED."
@@ -89,6 +106,8 @@  echo $abi > $abidir/abiname
 # NOTE: The flavours are hardcoded, because they may have changed from the
 # current build.
 
+__package_prefixes="linux-image"
+
 . $DEBIAN/etc/getabis
 
 compilers=`cat $abidir/*/*.compiler | sort -u | wc -l`