[Unstable][PATCH 2/3] UBUNTU: [Packaging] getabis: Download ABIs into an unversioned directory

Juerg Haefliger juerg.haefliger at canonical.com
Mon Apr 12 12:53:57 UTC 2021


Download the ABIs into the unversioned directory $DEBIAN/abi/previous and
remove any old/versioned ABI directories. Also add a new file
$DEBIAN/abi/previous/version that contains the ABI version that was
previously part of the directory name for subsequent version checking.

Signed-off-by: Juerg Haefliger <juergh at canonical.com>
---
 debian/scripts/misc/getabis | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/debian/scripts/misc/getabis b/debian/scripts/misc/getabis
index ebe4c4abdbc0..b2a5585fb618 100755
--- a/debian/scripts/misc/getabis
+++ b/debian/scripts/misc/getabis
@@ -168,6 +168,7 @@ getall_set()
 # Setup abi directory
 mkdir -p $abidir
 echo $abi > $abidir/abiname
+echo $verfull > $abidir/version
 
 # NOTE: The flavours are hardcoded, because they may have changed from the
 # current build.
@@ -187,8 +188,13 @@ mv fwinfo.tmp $fwinfo
 
 rmdir $tmpdir
 
-# If this is running in a git repo, add the new ABI directory, remove the old
+# Replace the previous ABI directory with the new one
+abiprevdir="$(pwd)/$DEBIAN/abi/previous"
+rm -rf "$abiprevdir"
+mv "$abidir" "$abiprevdir"
+
+# If this is running in a git repo, add the current ABI directory and remove any old ones
 if [ -d ".git" ]; then
-    git add $abidir
-    find $DEBIAN/abi/* -maxdepth 0 -type d | grep -v $verfull | while read f; do git rm -r -f $f;done
+    git add "$abiprevdir"
+    find "$DEBIAN"/abi/* -maxdepth 0 -type d | grep -v '/previous$' | while read f; do git rm -rf "$f"; done
 fi
-- 
2.27.0




More information about the kernel-team mailing list