Commit 49f8c405 authored by Tim Mooney's avatar Tim Mooney Committed by Sebastian Dröge

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
parent 12af1052
......@@ -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>' | \
......
......@@ -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])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment