diff --git a/generate-tarball.sh b/generate-tarball.sh index 6c6ebb4..00acaa3 100644 --- a/generate-tarball.sh +++ b/generate-tarball.sh @@ -3,19 +3,24 @@ set -e name=plexus-languages version="$(sed -n 's/Version:\s*//p' *.spec)" +pkgdir=`cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd` + +tmpdir=`mktemp -d` +echo $tmpdir +trap 'rm -r "$tmpdir"' EXIT +pushd "$tmpdir" >/dev/null # RETRIEVE wget "https://github.com/codehaus-plexus/plexus-languages/archive/plexus-languages-${version}.tar.gz" -O "${name}-${version}.orig.tar.gz" -rm -rf tarball-tmp -mkdir tarball-tmp -cd tarball-tmp +treeroot="$tmpdir/tree" +mkdir "$tmpdir/tree" +pushd "$treeroot" >/dev/null + tar xf "../${name}-${version}.orig.tar.gz" # CLEAN TARBALL find -name '*.jar' -delete find -name '*.class' -delete -tar cJf "../${name}-${version}.tar.xz" * -cd .. -rm -r tarball-tmp "${name}-${version}.orig.tar.gz" +tar cJf "$pkgdir/${name}-${version}.tar.xz" * diff --git a/plexus-languages.changes b/plexus-languages.changes index 484eecd..7c88a3b 100644 --- a/plexus-languages.changes +++ b/plexus-languages.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Feb 17 13:40:16 UTC 2021 - Matthias Gerstner + +- generate-tarball.sh: use safe temporary directory, avoid accidental deletion + of *.jar, *.class in CWD. + ------------------------------------------------------------------- Thu Nov 21 19:33:41 UTC 2019 - Fridrich Strba diff --git a/plexus-languages.spec b/plexus-languages.spec index 833dbcd..a2dd8a3 100644 --- a/plexus-languages.spec +++ b/plexus-languages.spec @@ -1,7 +1,7 @@ # # spec file for package plexus-languages # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed