File: get-orig-source

package info (click to toggle)
pmx 2.7.0.ctan20131214-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,564 kB
  • ctags: 3,385
  • sloc: ansic: 39,658; sh: 1,080; makefile: 231
file content (45 lines) | stat: -rwxr-xr-x 1,045 bytes parent folder | download | duplicates (2)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash

version=$1

if [ -z $version ] ; then
  echo "need version as first argument, exiting."
  exit 1
fi

TMP=get-orig-source-tmp
debv=${version}.ctan`date +%Y%m%d`
td=pmx-$debv

TMP=`mktemp -d`
currdir=`pwd`
cd $TMP
wget http://mirrors.ctan.org/support/pmx.zip
unzip pmx.zip
rm pmx.zip
mv pmx $td
cd $td
# we are not sure whether everything is contained in the
# main CTAN dir, and the installation document tells 
# that one should get the following file, so do it
wget http://mirrors.ctan.org/install/support/pmx.tds.zip
# clean out stuff that is replaced by the .tds.zip
rm -r doc scripts tex
# clean out Windows and OSX stuff
rm -r OSX Windows
# unzip further files
unzip pmx.tds.zip
rm pmx.tds.zip
tar -xvf pmx-${version}.tar.gz
rm pmx-${version}.tar.gz
cd ..
tar -cJf pmx_${debv}.orig.tar.xz $td
if [ ! -r $currdir/pmx_${debv}.orig.tar.xz ] ; then 
  mv pmx_${debv}.orig.tar.xz $currdir
  cd $currdir
  rm -r $TMP
else
  echo "pmx_$(debv).orig.tar.xz already exists in $currdir, not replacing it!"
  echo "new one is in $TMP"
fi