Bug 3624 - non-portable use of 'head -n1' and 'tail -n1' in Makefile.
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Platform
Version: GIT MASTER
Hardware: PC Solaris
: P3 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks: 3696
 
Reported: 2008-05-04 11:33 EDT by Vincent Cojot
Modified: 2008-06-21 18:04:47 EDT
1 user (show)

See Also:


Attachments
Simple patch to the Makefile. (670 bytes, patch)
2008-05-04 11:34 EDT, Vincent Cojot
alternative patch (3.22 KB, patch)
2008-05-04 12:39 EDT, Ludwig Nussel

Description Vincent Cojot 2008-05-04 11:33:32 EDT
The use of 'head -n1' and 'tail -n1' is not portable. These should be 'head -1' and 'tail -1' respectively.

On solaris, this output:

gmake[1]: Leaving directory `/net/thorbardin/export/home/raistlin/SVN/icculus/quake3-Solaris/trunk'
usage: tail [+/-[n][lbc][f]] [file]
       tail [+/-[n][l][r|f]] [file]
gmake[1]: Entering directory `/net/thorbardin/export/home/raistlin/SVN/icculus/quake3-Solaris/trunk'
Comment 1 Vincent Cojot 2008-05-04 11:34:05 EDT
Created attachment 1746 [details]
Simple patch to the Makefile.
Comment 2 Ludwig Nussel 2008-05-04 12:39:35 EDT
Created attachment 1748 [details]
alternative patch

I'd rather propose this patch. It defines VERSION in the Makefile and avoids the shell hacks completely. That also allows me to define a proper version for the rpm packages.
Comment 3 Vincent Cojot 2008-05-05 15:03:23 EDT
I'm fine with your patch but it kinda defeats the purpose of the Makefile routine that caused me to file this very bug. I am fine with both ideas but I don't know which would be preferable..
Comment 4 Ludwig Nussel 2008-05-06 16:37:51 EDT
patch commited as rev 1340