GNOME Bugzilla – Bug 698086
Bashishm in src/photos-generate-about breaks build with /bin/sh -> /bin/dash
Last modified: 2013-07-27 13:32:21 UTC
Created attachment 241594 [details] buildlog Ubuntu 13.04 amd64, full build log attached In file included from photos-about-data.c:1:0: photos-about-data.h:1:1: error: unknown type name 'gchar' photos-about-data.h:2:3: warning: initialization from incompatible pointer type [enabled by default] photos-about-data.h:2:3: warning: (near initialization for 'PHOTOS_ARTISTS[0]') [enabled by default] photos-about-data.h:3:3: warning: initialization from incompatible pointer type [enabled by default] photos-about-data.h:3:3: warning: (near initialization for 'PHOTOS_ARTISTS[1]') [enabled by default] photos-about-data.h:4:3: error: 'NULL' undeclared here (not in a function) photos-about-data.h:6:1: error: unknown type name 'gchar' ....
By the way, 3.7.2 builds fine, it's 3.7.3 and newer that fail to build here.
I see this too. Here's the first error that occurs in the build: GEN photos-about-data.c ./photos-generate-about: 23: ./photos-generate-about: [[: not found The problem is that [[ is a bash-ism, the script begins with '#!/bin/sh' and on Ubuntu /bin/sh is not bash.
Created attachment 243353 [details] [review] fix Here's a fix.
Review of attachment 243353 [details] [review]: Thanks for the patch. ::: src/photos-generate-about @@ +34,3 @@ echo "const gchar *PHOTOS_ARTISTS[] = {" while read line; do + [ $(echo "$line" | cut -c1) = "#" ] && The $(echo ...) part should now be enclosed in ""s so that empty lines don't trigger this (harmless?) warning: [: =: unary operator expected @@ +45,3 @@ echo "const gchar *PHOTOS_AUTHORS[] = {" while read line; do + [ $(echo "$line" | cut -c1) = "#" ] && Likewise.
Created attachment 244156 [details] [review] Avoid bash-specific syntax in photos-generate-about I took the liberty to fix up Adam's patch as above and commit it. I hope I got it right.
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
*** Bug 699383 has been marked as a duplicate of this bug. ***
*** Bug 704945 has been marked as a duplicate of this bug. ***