pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
shebang for tcl postgresql modules
2+ messages / 2 participants
[nested] [flat]

* shebang for tcl postgresql modules
@ 2015-03-12 10:17  Jozef Mlich <jmlich@redhat.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Jozef Mlich @ 2015-03-12 10:17 UTC (permalink / raw)
  To: pgsql-hackers

Dear hackers,

I would like to ask you if is there any reason to pretend tcl scripts
are shell scripts?

I am speaking namely about these files

http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/pl/tcl/modules/pltcl_delmod.in...
http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/pl/tcl/modules/pltcl_listmod.i...
http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/pl/tcl/modules/pltcl_loadmod.i...


Here is the part of code I am speaking about:

#! /bin/sh
# Start tclsh \
exec @TCLSH@ "$0" "$@"

instead of
#! /usr/bin/tclsh

or 
#! @TCLSH@

I am asking because our test suite is triggering errors on this [1]. In
this case, it seems easier to modify code rather then test suite. Please
apply attached patch if there is no particular reason for use
of /bin/sh.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1199464


-- 
Jozef Mlich <jmlich@redhat.com>
Associate Software Engineer - EMEA ENG Developer Experience
Mobile: +420 604 217 719
http://cz.redhat.com/
Red Hat, Inc.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

tcl-shebang.patch (text/x-patch, 1.0K) download diff --git a/src/pl/tcl/modules/pltcl_delmod.in b/src/pl/tcl/modules/pltcl_delmod.in index daa4fac..6b8cda4 100644 --- a/src/pl/tcl/modules/pltcl_delmod.in +++ b/src/pl/tcl/modules/pltcl_delmod.in @@ -1,8 +1,6 @@ -#! /bin/sh +#! @TCLSH@ # src/pl/tcl/modules/pltcl_delmod.in # -# Start tclsh \ -exec @TCLSH@ "$0" "$@" # # Code still has to be documented diff --git a/src/pl/tcl/modules/pltcl_listmod.in b/src/pl/tcl/modules/pltcl_listmod.in index 7d930ff..c3ea138 100644 --- a/src/pl/tcl/modules/pltcl_listmod.in +++ b/src/pl/tcl/modules/pltcl_listmod.in @@ -1,8 +1,6 @@ -#! /bin/sh +#! @TCLSH@ # src/pl/tcl/modules/pltcl_listmod.in # -# Start tclsh \ -exec @TCLSH@ "$0" "$@" # # Code still has to be documented diff --git a/src/pl/tcl/modules/pltcl_loadmod.in b/src/pl/tcl/modules/pltcl_loadmod.in index 645c6bb..06b459b 100644 --- a/src/pl/tcl/modules/pltcl_loadmod.in +++ b/src/pl/tcl/modules/pltcl_loadmod.in @@ -1,6 +1,5 @@ -#! /bin/sh -# Start tclsh \ -exec @TCLSH@ "$0" "$@" +#! @TCLSH@ +# # # Code still has to be documented
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: shebang for tcl postgresql modules
@ 2015-03-12 13:57  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Jozef Mlich <jmlich@redhat.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2015-03-12 13:57 UTC (permalink / raw)
  To: Jozef Mlich <jmlich@redhat.com>; +Cc: pgsql-hackers

Jozef Mlich <jmlich@redhat.com> writes:
> I would like to ask you if is there any reason to pretend tcl scripts
> are shell scripts?

That is the time-honored standard formatting for tcl scripts, see for
example page 2 here:
http://www.tcl.tk/doc/styleGuide.pdf

While we might get away with ignoring that convention for this specific
use-case, it carries a risk of breaking things, eg for people who have
multiple Tcl installations.  I'm disinclined to change it, especially
not if the reason is "rpmdiff is too dumb to recognize tcl scripts".
Somebody's gonna need to fix that anyway.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-03-12 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-03-12 10:17 shebang for tcl postgresql modules Jozef Mlich <jmlich@redhat.com>
2015-03-12 13:57 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox