On Fri, Jan 29, 2021 at 9:06 PM Petr Lautrbach <plautrba@xxxxxxxxxx> wrote: > > 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. > > Signed-off-by: Petr Lautrbach <plautrba@xxxxxxxxxx> > --- > scripts/release | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > > diff --git a/scripts/release b/scripts/release > index 895a0e1ca1a1..40a9c06f56b9 100755 > --- a/scripts/release > +++ b/scripts/release > @@ -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 "" 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