File: make_snapshot.sh

package info (click to toggle)
ghostscript 10.05.1~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 93,508 kB
  • sloc: ansic: 908,895; python: 7,676; cpp: 6,534; cs: 6,457; sh: 6,168; java: 4,028; perl: 2,373; tcl: 1,639; makefile: 529; awk: 66; yacc: 18
file content (74 lines) | stat: -rwxr-xr-x 2,301 bytes parent folder | download | duplicates (5)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh

# this is a script makes a snapshot of the ghostpdl/gs trunk and 
# uploads it casper. 
# Note that all the code gets pulled to wherever you run it and then
# pushed back to casper, so it takes a few minutes.

# It constructs the snapshot from a clean export from the repository,
# but BASED ON THE REVISIONS IN THE CURRENT CHECKOUT it's run from.
# A little confusing, but it gives you some control over the version
# posted. Run 'svn up' first if you want to do the latest.

# this script must be run from the top level of a ghostpdl working copy

# cut off revision numbers for the changelogs
NEWSREV=8840

# svn urls
SVNROOT=http://svn.ghostscript.com/ghostscript/trunk
ghostpdl_SVNROOT=${SVNROOT}/ghostpdl
gs_SVNROOT=${SVNROOT}/gs

REV=`svn info | grep Revision: | cut -f 2 -d ' '`

CHANGELOG="ghostpdl-r${REV}_NEWS.txt"
echo "creating changelog... ${CHANGELOG}"
svn log -r${REV}:${NEWSREV} $ghostpdl_SVNROOT > ${CHANGELOG}

exportdir="ghostpdl-r${REV}"
if test -d "$exportdir"; then
  echo "export target directory $exportdir already exists!"
  exit 1
fi

echo "creating ${exportdir}.tar.gz ..."

# export the source code
svn export -q -r ${REV} $ghostpdl_SVNROOT ${exportdir}

# remove proprietary subdirectories that might exist
echo "removing proprietary code ... "
for verboten in ufst tools/metro_tests; do
  if test -d $exportdir/$verboten; then
    echo "  $verboten"
    rm -rf $exportdir/$verboten
  fi
done

# copy in the changelogs
cp ${CHANGELOG} ${exportdir}
tar czf $exportdir.tar.gz $exportdir/*
rm -rf $exportdir

#echo $exportdir.tar.gz ready for upload
echo "uploading changelogs and $exportdir.tar.gz ..."
scp ${CHANGELOG} $exportdir.tar.gz \
  www.ghostscript.com:/www/ghostscript.com/snapshots/

echo "updating links ..."
echo "cd /www/ghostscript.com/snapshots/ && \
  if test -w ghostpdl-current.tar.gz; then \
   rm ghostpdl-current.tar.gz; \
   ln -s ${exportdir}.tar.gz ghostpdl-current.tar.gz; \
  fi; \
  if test -w ghostpdl-current_NEWS.txt; then \
   rm ghostpdl-current_NEWS.txt; \
   ln -s ${CHANGELOG} ghostpdl-current_NEWS.txt; \
  fi;" \
  # maintain the legacy current tarball link \
  if test -w ghostpcl-current.tar.gz; then \
   rm ghostpcl-current.tar.gz; \
   ln -s ${exportdir}.tar.gz ghostpcl-current.tar.gz; \
  fi \
	| ssh ghostscript.com