Mantis - findutils
Viewing Issue Advanced Details
1101 regular use tweak sometimes 2005-07-26 18:10 2011-07-03 09:44
james  
bwalton  
normal  
closed  
no change required  
none    
none  
0001101: gupdatedb mktemp and !
This started as a request for mktemp but even with mktemp gupdatedb needs a tweak. Without CSWmktemp:
$ gupdatedb --old-format
Warning: future versions of findutils will shortly discontinue support for the old locate database format.
/opt/csw/bin/gupdatedb: mktemp: not found
/opt/csw/bin/gupdatedb: !: not found
/opt/csw/bin/gupdatedb: mktemp: not found
/opt/csw/bin/gupdatedb: !: not found

Install CSWmktemp which is not in the findutils depend list and it still fails:

$ gupdatedb --old-format
Warning: future versions of findutils will shortly discontinue support for the old locate database format.
/opt/csw/bin/gupdatedb: !: not found
/opt/csw/bin/gupdatedb: !: not found

becasue the ! is not /bin/sh, I guess the was written for a system that emulated sh with something else, probably bash. #!/bin/ksh at the top will fix it.
Issue History
2009-04-05 05:15 car Assigned To thomas => car
2009-04-05 05:16 car Note Added: 0005852
2009-04-05 05:16 car Status assigned => acknowledged
2009-07-04 01:16 car Note Added: 0006392
2011-05-14 15:05 jay Note Added: 0009048
2011-05-16 10:48 james Note Added: 0009056
2011-05-16 10:49 james Assigned To car => bwalton
2011-05-16 10:56 james Note Edited: 0009056
2011-07-02 19:32 bwalton Note Added: 0009175
2011-07-02 19:32 bwalton Status acknowledged => closed
2011-07-02 19:32 bwalton Resolution open => no change required
2011-07-02 20:15 james Note Added: 0009176
2011-07-03 03:44 bwalton Note Added: 0009177
2011-07-03 09:44 james Note Added: 0009178

Notes
(0005852)
car   
2009-04-05 05:16   
This issue predates my adoption of the package, which doesn't excuse me for not checking that there were no open issues when I took it on. I know about it now, though.
(0006392)
car   
2009-07-04 01:16   
It seems to me that the slightly harder route, to fix the script so that it *is* Bourne shell compatible, is probably the better fix.

At a brief glance, the problem seems to be a couple of if tests unadorned by []. Fixing these certainly gets rid of the warnings and the script appears to function properly afterwards. I'll double-check this later, submit a new package to testing, then submit a patch upstream if this fixes the issue.
(0009048)
jay   
2011-05-14 15:05   
! is required by POSIX. See section 2.9.2 of http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html [^]

It looks like the ultimate problem is that the source distribution hard-codes the interpreter:
$ head -n1 locate/updatedb.sh
#! /bin/sh

In other words, findutils assumes /bin/sh is POSIX-compliant. If that's not true on your systems, you will need to path that I think.

Lack of mktemp is trickier. Looks like you may need your findutils package to depend on something that provides it, if the base OS does not.
(0009056)
james   
2011-05-16 10:48   
(edited on: 2011-05-16 10:56)
The date on the POSIX reference is 2004 and this bug was registered in 2005. It is highly likely at that time, using Solaris 8, /bin/sh was not POSIX compliment. Whether it was or not is not relevant to the fact of the matter being that gupdatedb failed on a target system and was fixable using the suggestion I made in 2005.

On Solaris 9, the current base system, gupdatedb appear to works. Is this proof that if reports are ignored for long enough there exists a probability that bugs will fix themselves? And if we wait long enough this bug report could morph into the complete works of Shakespeare.

(0009175)
bwalton   
2011-07-02 19:32   
Closing this since it only affects Solaris 8 which is not supported any longer.

-Ben
(0009176)
james   
2011-07-02 20:15   
The mktemp errors still applies?
(0009177)
bwalton   
2011-07-03 03:44   
Yes it does. Sorry. I've updated the build recipe and will push an update soon.

Thanks
-Ben
(0009178)
james   
2011-07-03 09:44   
Thanks.