2 # Shell script to extract the date given a release version and a .doap file
4 if test "x$1" = "x" -o "x$2" = "x" -o ! -s "$2"; then
5 echo "Usage: $0 RELEASE-VERSION-NUMBER DOAP-FILE" >&2;
9 if ! grep '<Project' "$2" >/dev/null ; then
10 echo "$2 does not look lika a .doap file" >&2;
14 if ! grep "$1" "$2" >/dev/null ; then
15 echo "$2 contains no reference to a version $1" >&2;
21 if ($0~"<release>") {x=1; chunk=""}
23 if ($0~"<revision>") { chunk = chunk $0 }
24 if ($0~"<created>") { chunk = chunk $0 }
26 if ($0~"</release>") {x=0; print chunk}
29 grep '<revision>'"$1"'</revision>' | \
31 sed -e 's/^.*<created>//' -e 's/<\/created>.*$//'