diff mbox series

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

Message ID 20210412125358.23098-3-juergh@canonical.com
State New
Headers show
Series debian: Drop versioned ABI directory names | expand

Commit Message

Juerg Haefliger April 12, 2021, 12:53 p.m. UTC
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@canonical.com>
---
 debian/scripts/misc/getabis | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Thadeu Lima de Souza Cascardo April 19, 2021, 8:16 p.m. UTC | #1
On Mon, Apr 12, 2021 at 02:53:57PM +0200, Juerg Haefliger wrote:
> 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@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

What is the point of keeping this git rm here? Just removing the old cruft for
versioned ABI directories? That is, once that is gone, there is no point
keeping this anymore?

Cascardo.

> -- 
> 2.27.0
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Juerg Haefliger April 21, 2021, 5:21 a.m. UTC | #2
On Mon, 19 Apr 2021 17:16:04 -0300
Thadeu Lima de Souza Cascardo <cascardo@canonical.com> wrote:

> On Mon, Apr 12, 2021 at 02:53:57PM +0200, Juerg Haefliger wrote:
> > 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@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  
> 
> What is the point of keeping this git rm here? Just removing the old cruft for
> versioned ABI directories? That is, once that is gone, there is no point
> keeping this anymore?

Yes it's needed only to remove the final versioned ABI directory and no longer
after the switch to 'previous'.

...Juerg

 
> Cascardo.
> 
> > -- 
> > 2.27.0
> > 
> > 
> > -- 
> > kernel-team mailing list
> > kernel-team@lists.ubuntu.com
> > https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff mbox series

Patch

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