source: branches/2.2/filemanager/tp/dompdf/lib/ttf2ufm/ttf2ufm-src/scripts/mkrel @ 3019

Revision 3019, 2.5 KB checked in by amuller, 14 years ago (diff)

Ticket #1135 - Corrigindo CSS e adicionando filemanager

Line 
1#!/bin/sh
2#
3# See COPYRIGHT
4#
5# Script to create a release or shapshot archive.
6# Also checks for very basic inconsistences.
7# Expects that it would be run from the current directory of ttf2pt1,
8# and that the parent directory is the place to create archives.
9# Expects that the CVS environment variables are set properly.
10
11VER=`grep TTF2PT1_VERSION version.h | cut -d\" -f2`
12
13case "$1" in
14snapshot)
15        echo "$VER" | egrep '^[0-9][0-9]*\.[0-9].*-CURRENT$' || {
16                echo "mkrel: version.h must contain *-CURRENT to create a snapshot" >&2
17                exit 1
18        }
19        grep "^current$" CHANGES.html >/dev/null || {
20                echo "mkrel: CHANGES.html must list 'current' to create a snapshot" >&2
21                exit 1
22        }
23        snapdate=`date "+ %y  %m  %d " | sed 's/ \([0-9]\) / 0& /g;s/ //g'`
24        NEWVER=`echo "$VER" | sed "s/-CURRENT/-SNAP-$snapdate/"`
25        TAG="-D tomorrow"
26        ;;
27release)
28        echo "$VER" | egrep '^[0-9][0-9]*\.[0-9][.0-9]*$' || {
29                echo "mkrel: version.h must not be -CURRENT to create a release" >&2
30                exit 1
31        }
32        grep "^$VER -- " CHANGES.html >/dev/null || {
33                echo "mkrel: CHANGES.html must list the same version as version.h" >&2
34                exit 1
35        }
36        NEWVER="$VER"
37        TAG=`echo "-r ttf2pt1-$VER" | sed \
38                's/\(-[0-9][0-9]*\.[0-9]\)$/&.0/;s/\./-/g'`
39        ;;
40*)
41        echo "use: mkrel [snapshot|release]" >&2
42        exit 1
43        ;;
44esac
45
46cd .. || {
47        echo "mkrel: can't cd to .." >&2
48        exit 1
49}
50
51rm -f ttf2pt1-$NEWVER.tgz ttf2pt1-$NEWVER.zip
52rm -rf ttf2pt1-$NEWVER
53
54echo "cvs -z9 export $TAG -d ttf2pt1-$NEWVER ttf2pt1"
55cvs -z9 export $TAG -d ttf2pt1-$NEWVER ttf2pt1 || {
56        echo "mkrel: unable to export from CVS" >&2
57        echo "mkrel: check that the CVS tree is properly tagged" >&2
58        exit 1
59}
60
61
62# a little bit more for snapshot: correct the version
63(
64case "$1" in
65snapshot)
66        cd ttf2pt1-$NEWVER || {
67                echo "mkrel: can't cd to ../ttf2pt1-$NEWVER" >&2
68                exit 1
69        }
70
71        sed "s/^current\$/$NEWVER/" <CHANGES.html >CHANGES.html.new \
72        && mv CHANGES.html.new CHANGES.html || {
73                echo "mkrel: can't update CHANGES.html" >&2
74                exit 1
75        }
76
77        sed "s/\".*-CURRENT\"/\"$NEWVER\"/" <version.h >version.h.new \
78        && mv version.h.new version.h || {
79                echo "mkrel: can't update version.h" >&2
80                exit 1
81        }
82        ;;
83esac
84)
85
86# generate the man pages - in case if the users would have no pod2man
87(
88        cd ttf2pt1-$NEWVER || {
89                echo "mkrel: can't cd to ../ttf2pt1-$NEWVER" >&2
90                exit 1
91        }
92
93        make mans
94)
95
96tar czvf ttf2pt1-$NEWVER.tgz ttf2pt1-$NEWVER || {
97        echo "mkrel: can't create .tgz archive" >&2
98        exit 1
99}
100
101zip -u -r ttf2pt1-$NEWVER.zip ttf2pt1-$NEWVER || {
102        echo "mkrel: can't create .zip archive" >&2
103        exit 1
104}
Note: See TracBrowser for help on using the repository browser.