File: makeasversion

package info (click to toggle)
afterstep 2.2.12-18.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,184 kB
  • sloc: ansic: 201,695; sh: 5,894; xml: 3,721; makefile: 2,094; perl: 1,558; cpp: 811
file content (75 lines) | stat: -rwxr-xr-x 1,720 bytes parent folder | download | duplicates (9)
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
75
#!/bin/sh

tab="	"

files="doc/languages/README.* README autoconf/configure.in"

usage()
{
  echo "Usage:"
  echo "makeasversion <version>"
  echo "  <version> is of the form major.minor.patchlevel"
  exit 1
}

# make sure we have a (valid) new version
if test "x$1" = "x"; then
  echo "makeasversion: no version passed on command line"
  echo ""
  usage
fi

if ! echo $1 | grep -q -E '^[0-9]+[.][0-9]+[.][0-9]+$'; then
  echo "makeasversion: invalid version passed on command line"
  echo "Valid versions are of the form major.minor.patchlevel (eg, 1.7.0)."
  echo ""
  usage
fi

# get the current version number
version=`grep "^version=" autoconf/configure.in | cut -f2 -d\"`

if test "x$version" = "x"; then
  echo "makeasversion: unable to determine old version from autoconf/configure.in"
  exit 1
fi

echo "Old version was $version."
echo "New version is $1."
echo ""

for i in README doc/languages/README.*; do
  echo $i
  cat $i | sed "s/AfterStep $version/AfterStep $1/" > /tmp/makeasversion.tmp
  mv /tmp/makeasversion.tmp $i
done


for i in afterstep/base.*bpp.in; do
  echo $i
  cat $i | sed "s/AfterStep $version/AfterStep $1/" > /tmp/makeasversion.tmp
  mv /tmp/makeasversion.tmp $i
done

i="autoconf/configure.in"
echo $i
cat $i | sed "s/^version=\"$version\"/version=\"$1\"/" > /tmp/makeasversion.tmp
mv /tmp/makeasversion.tmp $i

i="AfterStep.spec"
echo $i
cat $i | sed -e "s/^\(%define.*fver.*\)$version/\1$1/" \
             -e "s/^\(%define.*version.*\)$version/\1$1/" > /tmp/makeasversion.tmp
mv /tmp/makeasversion.tmp $i

echo ""
echo ""
echo "Unless an error was printed, makeasversion was successful!  Please"
echo "be sure to run:"
echo "make config"
echo "to update the configure script."