Commit 78a2df56 authored by Andreas Tille's avatar Andreas Tille
Browse files

Use Files-Excluded to strip upstream archive

parent b508d672
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
brig (0.95+dfsg-2) UNRELEASED; urgency=low

  [ Steffen Moeller ]
  * debian/upstream/metadata:
    - yamllint cleanliness
    - addded references to registries

 -- Steffen Moeller <moeller@debian.org>  Sat, 18 Nov 2017 20:58:42 +0100
  [ Andreas Tille ]
  * debian/get-orig-source: Use Files-Excluded to strip upstream archive

 -- Andreas Tille <tille@debian.org>  Thu, 05 Jul 2018 15:56:00 +0200

brig (0.95+dfsg-1) unstable; urgency=low

+1 −3
Original line number Diff line number Diff line
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: BRIG
Source: http://sourceforge.net/projects/brig/files
Files-Excluded: */*.jar
                */.DS_Store
                *.pdf
Files-Excluded: */*.jar */.DS_Store */*.pdf */errorlog.xml */cgview

Files: *
Copyright: 2010-2012 Nabil Alikhan 
+6 −7
Original line number Diff line number Diff line
@@ -12,14 +12,15 @@
COMPRESS=xz

NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
COPYRIGHT=$(pwd)/debian/copyright

set -x
echo args = $@
if ! echo $@ | grep -q upstream-version ; then
    VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
    VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed -e 's/+dfsg[0-9]*//' -e 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
    uscan --force-download
else
    VERSION=`echo $@ | sed "s?^.*--upstream-version \([0-9.]\+\) .*BRIG.*-dist.*?\1?"`
    VERSION=`echo $@ | sed -e 's/+dfsg[0-9]*//' -e "s?^.*--upstream-version \([0-9.]\+\)-[0-9]\+- .*BRIG.*-dist.*?\1?"`
    if echo "$VERSION" | grep -q "upstream-version" ; then
        echo "Unable to parse version number"
        exit
@@ -41,11 +42,9 @@ LC_ALL=C svn --quiet export ${SVNURI} ${NAME}-code
unzip -q ../BRIG-${VERSION}-dist.zip
mv BRIG-${VERSION}-dist ${TARDIR}
cd ${TARDIR}
find . -name "*.jar" -delete
find . -name ".DS_Store" -delete
find . -name "*.pdf" -delete
rm -rf errorlog.xml
rm -rf cgview
# Remove according to "Files-Excluded"
# Its a bit tricky since '*' needs to be escaped ...
for excl in $(grep "^Files-Excluded" ${COPYRIGHT} | sed -e 's/^Files-Excluded: */ /' -e 's/ \*/ \\*/g') ; do find . -path "$(echo $excl | sed 's/^\\//')" | xargs rm -rf ; done
# copy Java source from SVN
mv ../${NAME}-code/BRIG/src .
# Cherry pick from SVN content - no idea what principle upstream followed when creating download archive