Skip to contentSkip to conversation

scripts/release: Release also tarball with everything

PATCH In review Petr Lautrbach 2 participants 4 messages Jan 29, 2021 – Feb 1, 2021 1 message not in the archive SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/release: Release also tarball with everything

Create and publish with sha256sum also tarball called selinux-$VERS.tar.gz with the whole tree. It could be useful for unit testing directly from tarball or backporting patches which affects more subdirectories. Github already provides similar archive called "Source code (tar.gz)" via release assets, but there's no guarantee this file would not change.

---
 scripts/release | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
scripts/release +20 -3
index 895a0e1ca1a1..40a9c06f56b9 100755
@@ -35,6 +35,8 @@ for i in $DIRS_NEED_PREFIX; do
 	cd ..
 done
 
+git archive -o $DEST/selinux-$VERS.tar.gz --prefix=selinux-$VERS/ $VERS
+
 cd $DEST
 
 git add .
@@ -54,13 +56,28 @@ echo ""
 echo "[short log](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/shortlog-$RELEASE_TAG.txt)"
 echo ""
 
-for i in *.tar.gz; do
+for i in $DIRS; do
+	tarball=$i-$VERS.tar.gz
+	echo -n "[$tarball](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$tarball) "
+	sha256sum $tarball | cut -d " " -f 1
+	echo ""
+done
 
-	echo -n "[$i](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$i) "
-	sha256sum $i | cut -d " " -f 1
+for i in $DIRS_NEED_PREFIX; do
+	tarball=selinux-$i-$VERS.tar.gz
+	echo -n "[$tarball](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$tarball) "
+	sha256sum $tarball | cut -d " " -f 1
 	echo ""
 done
 
+echo "### Everything"
+
+echo ""
+
+echo -n "[selinux-$VERS.tar.gz](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/selinux-$VERS.tar.gz) "
+sha256sum selinux-$VERS.tar.gz | cut -d " " -f 1
+echo ""
+
 echo "And then run:"
 echo "  cd $WIKIDIR"
 echo "  git commit  -m \"Release $RELEASE_TAG\" -a -s"
Signature · 1 line
2.30.0
#1 lore raw
Quoted 44 lines · Petr Lautrbach

Create and publish with sha256sum also tarball called selinux-$VERS.tar.gz with the whole tree. It could be useful for unit testing directly from tarball or backporting patches which affects more subdirectories. Github already provides similar archive called "Source code (tar.gz)" via release assets, but there's no guarantee this file would not change.

---
 scripts/release | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
scripts/release +12 -3
index 895a0e1ca1a1..40a9c06f56b9 100755
@@ -35,6 +35,8 @@ for i in $DIRS_NEED_PREFIX; do
        cd ..
 done
 
+git archive -o $DEST/selinux-$VERS.tar.gz --prefix=selinux-$VERS/ $VERS
+
 cd $DEST
 
 git add .
@@ -54,13 +56,28 @@ echo ""
 echo "[short log](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/shortlog-$RELEASE_TAG.txt)"
 echo ""
 
-for i in *.tar.gz; do
+for i in $DIRS; do
+       tarball=$i-$VERS.tar.gz
+       echo -n "[$tarball](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$tarball) "
+       sha256sum $tarball | cut -d " " -f 1
+       echo ""
+done
 
-       echo -n "[$i](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$i) "
-       sha256sum $i | cut -d " " -f 1
+for i in $DIRS_NEED_PREFIX; do
+       tarball=selinux-$i-$VERS.tar.gz
+       echo -n "[$tarball](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$tarball) "
+       sha256sum $tarball | cut -d " " -f 1

scripts/release echo "" · line 79

Quoted 10 lines
scripts/release +7 -0
        echo ""
 done
 
+echo "### Everything"
+
+echo ""
+
+echo -n "[selinux-$VERS.tar.gz](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/selinux-$VERS.tar.gz) "
+sha256sum selinux-$VERS.tar.gz | cut -d " " -f 1
+echo ""

Hello, there are at least two issues here:
* The section is named "Everything" but on
https://github.com/SELinuxProject/selinux/wiki/Releases it is named "All in one". What is the proper name?
* $VERS comes from a VERSION file in a subdirectory. It would be more consistent to either use $RELEASE_TAG (which is the content of the main VERSION file) or to use a single $VERS variable (and to verify that the */VERSION files all contain the same content, for example with "diff VERSION $i/VERSION"). Which option would be preferable?

Moreover I do not like using string variables without quotes (and shellcheck reports warnings for this), but this is a general issue of this script. I will send a patch to improve the release script.

Cheers,
Nicolas

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 65 lines · Petr Lautrbach
Quoted 48 lines · Nicolas Iooss
Quoted 47 lines · Petr Lautrbach

Create and publish with sha256sum also tarball called selinux-$VERS.tar.gz with the whole tree. It could be useful for unit testing directly from tarball or backporting patches which affects more subdirectories. Github already provides similar archive called "Source code (tar.gz)" via release assets, but there's no guarantee this file would not change.

---
 scripts/release | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
scripts/release +12 -3
index 895a0e1ca1a1..40a9c06f56b9 100755
@@ -35,6 +35,8 @@ for i in $DIRS_NEED_PREFIX; do
        cd ..
 done
 
+git archive -o $DEST/selinux-$VERS.tar.gz --prefix=selinux-$VERS/ $VERS
+
 cd $DEST
 
 git add .
@@ -54,13 +56,28 @@ echo ""
 echo "[short log](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/shortlog-$RELEASE_TAG.txt)"
 echo ""
 
-for i in *.tar.gz; do
+for i in $DIRS; do
+       tarball=$i-$VERS.tar.gz
+       echo -n "[$tarball](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$tarball) "
+       sha256sum $tarball | cut -d " " -f 1
+       echo ""
+done
 
-       echo -n "[$i](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$i) "
-       sha256sum $i | cut -d " " -f 1
+for i in $DIRS_NEED_PREFIX; do
+       tarball=selinux-$i-$VERS.tar.gz
+       echo -n "[$tarball](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$tarball) "
+       sha256sum $tarball | cut -d " " -f 1
        echo ""
 done
 
Quoted 12 lines

scripts/release echo "" · line 79

Quoted 7 lines
scripts/release +7 -0
+echo "### Everything"
+
+echo ""
+
+echo -n "[selinux-$VERS.tar.gz](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/selinux-$VERS.tar.gz) "
+sha256sum selinux-$VERS.tar.gz | cut -d " " -f 1
+echo ""

Hello, there are at least two issues here:
* The section is named "Everything" but on
https://github.com/SELinuxProject/selinux/wiki/Releases it is named "All in one". What is the proper name?

Quoted 5 lines

I used "All in one" in rc1 release but I didn't announce it properly and it didn't feel good to me. So I sent this patch to make this official. And I like "Everything" more than the original "All in one". I can change it on the release page if the change is accepted or drop it completely if it's denied.

I find "Everything" to be quite unclear, because for example the archive does not contain the git history... What about "Source repository snapshot", which better describes what the archive really is? This is a personal opinion and I am also fine with keeping "Everything" if you do not like my suggestion.

Quoted 10 lines
Quoted 5 lines

* $VERS comes from a VERSION file in a subdirectory. It would be more consistent to either use $RELEASE_TAG (which is the content of the main VERSION file) or to use a single $VERS variable (and to verify that the */VERSION files all contain the same content, for example with "diff VERSION $i/VERSION"). Which option would be preferable?

For now I'd use $RELEASE_TAG for selinux-X.Y.tar.gz

and maybe something like:

Review

Quoted 4 lines
(quoted diff) +2 -2
-for i in $DIRS; do
-       tarball=$i-$VERS.tar.gz
+for i in $DIRS; do
+       tarball=`ls $i-*.tar.gz`

I do not like using wildcard patterns. In the patch I sent
(https://lore.kernel.org/selinux/[email protected]/)
I replaced this part with reading $i/VERSION again:

+for COMPONENT in "${DIRS[@]}"; do
+ DIR="${COMPONENT#selinux-}"
+ VERS="$(cat "$DIR/VERSION")"
+ TAG="$COMPONENT-$VERS"
+ tarball="$TAG.tar.gz"

Nevertheless the script is currently using wildcards and your suggestion works, so you can use ls $i-*.tar.gz and I will then propose a new version of my patch to remove this. Or you can include my changes in your patch, if you agree with them. How do you want to proceed?

Thanks,
Nicolas

#4 lore raw
Quoted 72 lines · Nicolas Iooss
Quoted 65 lines · Petr Lautrbach
Quoted 48 lines · Nicolas Iooss
Quoted 47 lines · Petr Lautrbach

Create and publish with sha256sum also tarball called selinux-$VERS.tar.gz with the whole tree. It could be useful for unit testing directly from tarball or backporting patches which affects more subdirectories. Github already provides similar archive called "Source code (tar.gz)" via release assets, but there's no guarantee this file would not change.

---
 scripts/release | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
scripts/release +12 -3
index 895a0e1ca1a1..40a9c06f56b9 100755
@@ -35,6 +35,8 @@ for i in $DIRS_NEED_PREFIX; do
        cd ..
 done
 
+git archive -o $DEST/selinux-$VERS.tar.gz --prefix=selinux-$VERS/ $VERS
+
 cd $DEST
 
 git add .
@@ -54,13 +56,28 @@ echo ""
 echo "[short log](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/shortlog-$RELEASE_TAG.txt)"
 echo ""
 
-for i in *.tar.gz; do
+for i in $DIRS; do
+       tarball=$i-$VERS.tar.gz
+       echo -n "[$tarball](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$tarball) "
+       sha256sum $tarball | cut -d " " -f 1
+       echo ""
+done
 
-       echo -n "[$i](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$i) "
-       sha256sum $i | cut -d " " -f 1
+for i in $DIRS_NEED_PREFIX; do
+       tarball=selinux-$i-$VERS.tar.gz
+       echo -n "[$tarball](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/$tarball) "
+       sha256sum $tarball | cut -d " " -f 1
        echo ""
 done
 
Quoted 12 lines

scripts/release echo "" · line 79

Quoted 7 lines
scripts/release +7 -0
+echo "### Everything"
+
+echo ""
+
+echo -n "[selinux-$VERS.tar.gz](https://github.com/SELinuxProject/selinux/releases/download/$RELEASE_TAG/selinux-$VERS.tar.gz) "
+sha256sum selinux-$VERS.tar.gz | cut -d " " -f 1
+echo ""

Hello, there are at least two issues here:
* The section is named "Everything" but on
https://github.com/SELinuxProject/selinux/wiki/Releases it is named "All in one". What is the proper name?

Quoted 5 lines

I used "All in one" in rc1 release but I didn't announce it properly and it didn't feel good to me. So I sent this patch to make this official. And I like "Everything" more than the original "All in one". I can change it on the release page if the change is accepted or drop it completely if it's denied.

Quoted 5 lines

I find "Everything" to be quite unclear, because for example the archive does not contain the git history... What about "Source repository snapshot", which better describes what the archive really is? This is a personal opinion and I am also fine with keeping "Everything" if you do not like my suggestion.

"Source repository snapshot" works for me.

Quoted 25 lines
Quoted 10 lines
Quoted 5 lines

* $VERS comes from a VERSION file in a subdirectory. It would be more consistent to either use $RELEASE_TAG (which is the content of the main VERSION file) or to use a single $VERS variable (and to verify that the */VERSION files all contain the same content, for example with "diff VERSION $i/VERSION"). Which option would be preferable?

For now I'd use $RELEASE_TAG for selinux-X.Y.tar.gz

and maybe something like:

Review

Quoted 4 lines
(quoted diff) +2 -2
-for i in $DIRS; do
-       tarball=$i-$VERS.tar.gz
+for i in $DIRS; do
+       tarball=`ls $i-*.tar.gz`

I do not like using wildcard patterns. In the patch I sent
(https://lore.kernel.org/selinux/[email protected]/)
I replaced this part with reading $i/VERSION again:

+for COMPONENT in "${DIRS[@]}"; do
+ DIR="${COMPONENT#selinux-}"
+ VERS="$(cat "$DIR/VERSION")"
+ TAG="$COMPONENT-$VERS"
+ tarball="$TAG.tar.gz"

Quoted 5 lines

Nevertheless the script is currently using wildcards and your suggestion works, so you can use ls $i-*.tar.gz and I will then propose a new version of my patch to remove this. Or you can include my changes in your patch, if you agree with them. How do you want to proceed?

I like your patch and I don't think it's neccessary to apply both. Let's drop mine proposal. Please merge my changes into yours and update the patch with "Source repository snapshot"

Thanks!

Quoted 3 lines

Thanks,
Nicolas