GNOME Bugzilla – Bug 707661
grep and awk portability issues in package release date checking
Last modified: 2013-09-18 16:51:58 UTC
Created attachment 254311 [details] [review] fix non-portable use of grep and awk related to release date checks Building gst-plugins-ugly-0.10.19 on x86_64-pc-solaris2.11 (OpenIndiana oi151a8). I'm using the Oracle Studio 12.3 compiler suite, but this issue isn't related to the compiler. While configuring gst-plugins-ugly, I see checking for GST_BASE... yes checking for GST_CHECK... no configure: No package 'gstreamer-check-0.10' found configure: no gstreamer-check-0.10 >= 0.10.36 (GStreamer Check unittest Library) found checking for GST_PLUGINS_BASE... yes configure: using GStreamer Base Plugins in /usr/lib/amd64/gstreamer-0.10 configure: Using /local/lib/64/gstreamer-0.10 as the plugin install location grep: illegal option -- e Usage: grep [-c|-l|-q] [-r|-R] -hbnsviw pattern file . . . awk: syntax error near line 3 awk: illegal statement near line 3 awk: syntax error near line 4 awk: bailing out near line 4 configure: error: SET_PACKAGE_RELEASE_DATETIME: could not extract release date for release version 0.10.19 from "./gst-plugins-ugly.doap" There are two issues here 1) common/m4/gst-package-release-datetime.m4 uses "grep -e" in a couple places. That's not portable (traditional grep on UNIX systems doesn't accept a -e option) and in this case it's also not needed. The regexes in use are simple and do not require extended regular expression support (a la egrep), so dropping the -e fixes the issue. 2) the common/extract-release-date-from-doap-file uses some non-portable awk syntax: $0 ~ "something" isn't portable, but $0 ~ /something/ would be. Ultimately, I think it would be a better idea to use xsltproc (which is required by pre-reqs of gstreamer, so you can safely assume it's going to be present) and a small .xsl file to get the release date from the .doap file, but that's a separate issue A possible patch for the two portability issues is attached.
commit 49f8c40577806b3de95c3265e5362a5f2b085b2f Author: Tim Mooney <mooney@dogbert.cc.ndsu.nodak.edu> Date: Mon Sep 9 15:19:29 2013 +0200 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