Permalink
Browse files

Don't require "package require Tcllauncher" to get the support procs,…

… something introduced in Tcllauncher 1.3 -- the package is now auto-required by the tcllauncher executable.

Better document the daemonize proc.

Version bump to 1.4.
BUGZID: 8455
  • Loading branch information...
lehenbauer committed Apr 2, 2013
1 parent 108bd31 commit 14a682e49ca9ec9ab515b3a2714483f3d929695e
Showing with 21 additions and 6 deletions.
  1. +1 −1 .gitignore
  2. +1 −1 configure.in
  3. +1 −1 pkgIndex.tcl.in
  4. +9 −3 tcllauncher-support.tcl
  5. +9 −0 unix/tclAppInit.c
View
@@ -8,6 +8,6 @@ pkgIndex.tcl
*.so
*.dylib
tcllauncher
-libtcllauncher.so*
+libTcllauncher.so*
tcllauncher-support.tcl
.*.swp
View
@@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
# so you can encode the package version directly into the source files.
#-----------------------------------------------------------------------
-AC_INIT([tcllauncher], [1.3])
+AC_INIT([Tcllauncher], [1.4])
#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
View
@@ -1,5 +1,5 @@
#
# Tcl package index file
#
-package ifneeded Tcllauncher @PACKAGE_VERSION@ \
+package ifneeded @PACKAGE_NAME@ @PACKAGE_VERSION@ \
[list load [file join $dir @PKG_LIB_FILE@] @PACKAGE_NAME@]\n[list source [file join $dir tcllauncher-support.tcl]]
View
@@ -56,9 +56,15 @@ proc require_user_and_group {user group} {
}
#
-# daemonize - rough tclx-based copy of BSD 4.4's daemon library routine
+# daemonize - rough tclx-based copy of BSD 4.4's "daemon" library routine
+#
+# usage: daemonize ?-noclose? ?-nochdir?
+#
+# detaches the process from the controlling terminal by forking, having
+# the child become a process group leader, changing directory to / (by
+# default) and closing and reopening stdin, stdout and stderr to and
+# from /dev/null.
#
-
proc daemonize {args} {
set doClose 1
set doChdir 1
@@ -248,4 +254,4 @@ proc pidfile_remove {} {
} ;# namespace tcllauncher
-package provide Tcllauncher 1.3
+package provide Tcllauncher 1.4
View
@@ -148,6 +148,15 @@ Tcl_AppInit(interp)
* where "Mod" is the name of the module.
*/
+ /*
+ * package require the tcllauncher package so that the helper routines
+ * will get loaded via the normal package mechanism. doing it this
+ * way then tcllauncher apps don't have to package require tcllauncher
+ */
+ if (Tcl_PkgRequire (interp, PACKAGE_NAME, PACKAGE_VERSION, 1) == NULL) {
+ return TCL_ERROR;
+ }
+
/*
* Call Tcl_CreateCommand for application-specific commands, if
* they weren't already created by the init procedures called above.

0 comments on commit 14a682e

Please sign in to comment.