summaryrefslogtreecommitdiff
path: root/update-readmes
blob: 2d4ada25e7992d15cd157944d84b60584a8e7f52 (plain)
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
#!/bin/bash
#
# update-readmes
#
# Updates a module's README and MAINTAINERS files from the copy in the
# common submodule.

README_FILES="README MAINTAINERS"

if [ ! -f "common/update-readmes" -o ! -f configure.ac ]; then
  echo "Run ./common/update-readmes from the top-level source directory of a GStreamer module";
  exit 1;
fi

MAJOR_VERSION=`grep '^AC_INIT' configure.ac | sed -e 's/[^0-9]*\([0-9]\)\.\([0-9]*\).*/\1/'`
MINOR_VERSION=`grep '^AC_INIT' configure.ac | sed -e 's/[^0-9]*\([0-9]\)\.\([0-9]*\).*/\2/'`

if test x$MAJOR_VERSION = x -o x$MINOR_VERSION = x ; then
  echo "Failed to extract major/minor version";
  exit 1;
fi

let m=$MINOR_VERSION%2
if test $m = 0; then
  VERSION="$MAJOR_VERSION.$MINOR_VERSION.x stable series"
else
  VERSION="$MAJOR_VERSION.$MINOR_VERSION.x development series"
fi
#echo "$VERSION"

for f in $README_FILES ; do
 cp --preserve --update --verbose "common/$f" $f || {
   echo "Failed to update $f"
   exit 1;
 }
done