diff options
author | Tim Mooney <mooney@dogbert.cc.ndsu.nodak.edu> | 2013-09-09 15:19:29 +0200 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-09-09 15:19:29 +0200 |
commit | 49f8c40577806b3de95c3265e5362a5f2b085b2f (patch) | |
tree | 4737a7998d76210d21a242acde6d611c34dc6c25 | |
parent | 12af105243823fc73581db4fd79a46f6d0268dc5 (diff) | |
download | gstreamer-common-49f8c40577806b3de95c3265e5362a5f2b085b2f.tar.gz |
Make package release date extraction portable
The awk and grep calls were not portable before and caused
errors on Solaris.
https://bugzilla.gnome.org/show_bug.cgi?id=707661
-rwxr-xr-x | extract-release-date-from-doap-file | 8 | ||||
-rw-r--r-- | m4/gst-package-release-datetime.m4 | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/extract-release-date-from-doap-file b/extract-release-date-from-doap-file index f2bc418..f57e307 100755 --- a/extract-release-date-from-doap-file +++ b/extract-release-date-from-doap-file @@ -18,12 +18,12 @@ fi awk 'BEGIN {x=0} { -if ($0~"<release>") {x=1; chunk=""} +if ( $0 ~ /<release>/ ) {x=1; chunk=""} if (x==1) { - if ($0~"<revision>") { chunk = chunk $0 } - if ($0~"<created>") { chunk = chunk $0 } + if ($0 ~ /<revision>/) { chunk = chunk $0 } + if ($0 ~ /<created>/) { chunk = chunk $0 } } -if ($0~"</release>") {x=0; print chunk} +if ($0 ~ /<\/release>/) {x=0; print chunk} }' < "$2" | \ \ grep '<revision>'"$1"'</revision>' | \ diff --git a/m4/gst-package-release-datetime.m4 b/m4/gst-package-release-datetime.m4 index 126919b..bc885e3 100644 --- a/m4/gst-package-release-datetime.m4 +++ b/m4/gst-package-release-datetime.m4 @@ -33,7 +33,7 @@ AC_DEFUN([AG_GST_SET_PACKAGE_RELEASE_DATETIME], elif test "x$1" = "xyes"; then dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no], ["YYYY-MM-DD"]) dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([no], [DOAP-FILE], [RELEASE-VERSION]) - if ( echo $1 | grep -e '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then + if ( echo $1 | grep '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then GST_PACKAGE_RELEASE_DATETIME=$1 else dnl we assume the .doap file contains the date as YYYY-MM-DD @@ -47,7 +47,7 @@ AC_DEFUN([AG_GST_SET_PACKAGE_RELEASE_DATETIME], fi fi dnl AG_GST_SET_PACKAGE_RELEASE_DATETIME([YYYY-MM-DD]) - elif ( echo $1 | grep -e '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then + elif ( echo $1 | grep '^20[1-9][0-9]-[0-1][0-9]-[0-3][0-9]' >/dev/null ) ; then GST_PACKAGE_RELEASE_DATETIME=$1 else AC_MSG_WARN([SET_PACKAGE_RELEASE_DATETIME: invalid first argument]) |