~ubuntu-branches/ubuntu/saucy/gst0.10-python/saucy

« back to all changes in this revision

Viewing changes to common/extract-release-date-from-doap-file

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2011-01-22 14:16:57 UTC
  • mfrom: (1.3.5 upstream) (18.1.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20110122141657-zbk0crefw35s69d6
Tags: 0.10.21-1
* New upstream stable release, "She used to be an ironhorse, twenty years ago".
  + debian/control:
    - Require GStreamer core/base >= 0.10.32.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Shell script to extract the date given a release version and a .doap file
 
3
 
 
4
if test "x$1" = "x" -o "x$2" = "x" -o ! -s "$2"; then
 
5
  echo "Usage: $0 RELEASE-VERSION-NUMBER DOAP-FILE" >&2;
 
6
  exit 1
 
7
fi
 
8
 
 
9
if ! grep '<Project' "$2" >/dev/null ; then
 
10
  echo "$2 does not look lika a .doap file" >&2;
 
11
  exit 1
 
12
fi
 
13
 
 
14
if ! grep "$1" "$2" >/dev/null ; then
 
15
  echo "$2 contains no reference to a version $1" >&2;
 
16
  exit 1
 
17
fi
 
18
 
 
19
awk 'BEGIN {x=0}
 
20
{
 
21
if ($0~"<release>") {x=1; chunk=""}
 
22
if (x==1) {
 
23
  if ($0~"<revision>") { chunk = chunk $0 }
 
24
  if ($0~"<created>") { chunk = chunk $0 }
 
25
}
 
26
if ($0~"</release>") {x=0; print chunk}
 
27
}' < "$2" | \
 
28
\
 
29
grep '<revision>'"$1"'</revision>' | \
 
30
\
 
31
sed -e 's/^.*<created>//' -e 's/<\/created>.*$//'
 
32