After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 698086 - Bashishm in src/photos-generate-about breaks build with /bin/sh -> /bin/dash
Bashishm in src/photos-generate-about breaks build with /bin/sh -> /bin/dash
Status: RESOLVED FIXED
Product: gnome-photos
Classification: Applications
Component: general
3.8.x
Other Linux
: Normal major
: ---
Assigned To: GNOME photos maintainer(s)
GNOME photos maintainer(s)
: 699383 704945 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-04-15 20:29 UTC by Jeremy Bicha
Modified: 2013-07-27 13:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
buildlog (382.34 KB, application/octet-stream)
2013-04-15 20:29 UTC, Jeremy Bicha
  Details
fix (1.33 KB, patch)
2013-05-05 19:57 UTC, Adam Dingle
reviewed Details | Review
Avoid bash-specific syntax in photos-generate-about (1.33 KB, patch)
2013-05-14 11:27 UTC, Debarshi Ray
committed Details | Review

Description Jeremy Bicha 2013-04-15 20:29:00 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'
....
Comment 1 Jeremy Bicha 2013-04-15 20:39:36 UTC
By the way, 3.7.2 builds fine, it's 3.7.3 and newer that fail to build here.
Comment 2 Adam Dingle 2013-05-05 19:51:49 UTC
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.
Comment 3 Adam Dingle 2013-05-05 19:57:09 UTC
Created attachment 243353 [details] [review]
fix

Here's a fix.
Comment 4 Debarshi Ray 2013-05-14 11:21:20 UTC
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.
Comment 5 Debarshi Ray 2013-05-14 11:27:49 UTC
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.
Comment 6 Debarshi Ray 2013-05-14 11:28:16 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
Comment 7 Debarshi Ray 2013-05-14 13:01:03 UTC
*** Bug 699383 has been marked as a duplicate of this bug. ***
Comment 8 Debarshi Ray 2013-07-27 13:32:21 UTC
*** Bug 704945 has been marked as a duplicate of this bug. ***