X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=gst-plugins-base-subtitles0.10%2Fcommon%2Fextract-release-date-from-doap-file;fp=gst-plugins-base-subtitles0.10%2Fcommon%2Fextract-release-date-from-doap-file;h=f2bc418cd1651da3c9a5dcf7b302aa9ef9ce5ea4;hb=57ba96e291a055f69dbfd4ae9f1ae2390e36986e;hp=0000000000000000000000000000000000000000;hpb=be2c98fb83895d10ac44af7b9a9c3e00ca54bf49;p=mafwsubrenderer diff --git a/gst-plugins-base-subtitles0.10/common/extract-release-date-from-doap-file b/gst-plugins-base-subtitles0.10/common/extract-release-date-from-doap-file new file mode 100755 index 0000000..f2bc418 --- /dev/null +++ b/gst-plugins-base-subtitles0.10/common/extract-release-date-from-doap-file @@ -0,0 +1,32 @@ +#!/bin/sh +# Shell script to extract the date given a release version and a .doap file + +if test "x$1" = "x" -o "x$2" = "x" -o ! -s "$2"; then + echo "Usage: $0 RELEASE-VERSION-NUMBER DOAP-FILE" >&2; + exit 1 +fi + +if ! grep '/dev/null ; then + echo "$2 does not look lika a .doap file" >&2; + exit 1 +fi + +if ! grep "$1" "$2" >/dev/null ; then + echo "$2 contains no reference to a version $1" >&2; + exit 1 +fi + +awk 'BEGIN {x=0} +{ +if ($0~"") {x=1; chunk=""} +if (x==1) { + if ($0~"") { chunk = chunk $0 } + if ($0~"") { chunk = chunk $0 } +} +if ($0~"") {x=0; print chunk} +}' < "$2" | \ +\ +grep ''"$1"'' | \ +\ +sed -e 's/^.*//' -e 's/<\/created>.*$//' +