File: getsource.sh

package info (click to toggle)
mediawiki2latex 7.46-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,628 kB
  • sloc: haskell: 10,197; python: 370; cpp: 181; sh: 39; makefile: 37
file content (31 lines) | stat: -rwxr-xr-x 1,071 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

if ! dh_testdir; then
    echo The command $0 should be called inside a main debian source directory.
    exit 1
fi

lastversion=$(git ls-remote git://git.code.sf.net/p/wb2pdf/git |  sed -n 's%.*refs/tags/\(v[.0-9]*\).*%\1%p' | uniq | sort | tail -1 | tr -d 'v')
echo "The version in the Git repository is $lastversion."

currentversion=$(dpkg-parsechangelog| sed -n 's/Version: \(.*\)-.*/\1/p')

if  [ "$currentversion" = "$lastversion" ] || \
    [ "$currentversion" \> "$lastversion" ] ; then
    echo "The current version is $currentversion. Giving up"
    exit 1
else
    # going to work in the parent directory
    cd ..

    git clone git://git.code.sf.net/p/wb2pdf/git mediawiki2latex-$lastversion
    cd mediawiki2latex-$lastversion
    git checkout tags/v$lastversion
    cd ..
    tar czf mediawiki2latex_$lastversion.orig.tar.gz mediawiki2latex-$lastversion --exclude=.git --exclude=.gitignore

    # clean the temporary dir
    rm -rf mediawiki2latex-$lastversion

    echo "Done: made the new archive mediawiki2latex_$lastversion.orig.tar.gz"
fi