[saods9] 01/02: New environment var DS9_HOME to allow relocation of ds9
Ole Streicher
olebole at moszumanska.debian.org
Thu Apr 16 15:40:50 UTC 2015
This is an automated email from the git hooks/post-receive script.
olebole pushed a commit to branch debian
in repository saods9.
commit 099c6ed05fd84b6575821e2231052b8848f37644
Author: Ole Streicher <olebole at debian.org>
Date: Thu Apr 16 17:38:22 2015 +0200
New environment var DS9_HOME to allow relocation of ds9
---
debian/patches/ds9_fix_docdir.patch | 8 ++++----
debian/patches/ds9_use_filesystem.patch | 33 ++++++++++++++++++++++++++-------
2 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/debian/patches/ds9_fix_docdir.patch b/debian/patches/ds9_fix_docdir.patch
index e0e9919..759ac83 100644
--- a/debian/patches/ds9_fix_docdir.patch
+++ b/debian/patches/ds9_fix_docdir.patch
@@ -35,10 +35,10 @@ Description: Instead putting the documentation into the common shared
}
--- a/src/ds9.tcl
+++ b/src/ds9.tcl
-@@ -201,6 +201,7 @@
- # set to absolute path so that if -cd command is used,
- # so we can still find our files
- set ds9(root) "/usr/share/saods9"
+@@ -206,6 +206,7 @@
+ } else {
+ set ds9(root) "/usr/share/saods9"
+ }
+ set ds9(doc) "/usr/share/doc/saods9-doc"
package require msgcat
diff --git a/debian/patches/ds9_use_filesystem.patch b/debian/patches/ds9_use_filesystem.patch
index ef1ced2..3597e16 100644
--- a/debian/patches/ds9_use_filesystem.patch
+++ b/debian/patches/ds9_use_filesystem.patch
@@ -1,6 +1,11 @@
Author: Ole Streicher <debian at liska.ath.cx>
-Description: Store all files in the usual FHS directories instead of
- building a zipfile and using a special tcl filesystem driver to access it.
+Description: Store all files in the usual FHS directories
+ The original way was to build a zipfile and use a special tcl filesystem
+ driver to access it.
+ .
+ Additionally, we introduce a new environment variable, "DS9_HOME" which
+ points to the basedir of the tcl script. This allows relocation of
+ ds9, which is used for testing.
--- a/ds9/Makefile.unix
+++ b/ds9/Makefile.unix
@@ -35,13 +35,8 @@
@@ -33,7 +38,7 @@ Description: Store all files in the usual FHS directories instead of
int Tkblt_Init(Tcl_Interp*);
int Tclcheckdns_Init(Tcl_Interp*);
-@@ -52,13 +49,8 @@
+@@ -52,13 +49,15 @@
// do this first
Tcl_FindExecutable((*argvPtr)[0]);
@@ -44,11 +49,18 @@ Description: Store all files in the usual FHS directories instead of
-
// startup script
- Tcl_Obj *path = Tcl_NewStringObj("./zvfsmntpt/src/ds9.tcl",-1);
-+ Tcl_Obj *path = Tcl_NewStringObj("/usr/share/saods9/src/ds9.tcl",-1);
++ char *env;
++ if (getenv("DS9_HOME") != NULL) {
++ env = (char *)alloca(strlen(getenv("DS9_HOME")) + 16);
++ sprintf(env, "%s/src/ds9.tcl", getenv("DS9_HOME"));
++ } else {
++ env = (char *)"/usr/share/saods9/src/ds9.tcl";
++ }
++ Tcl_Obj *path = Tcl_NewStringObj(env,-1);
Tcl_SetStartupScript(path, NULL);
return TCL_OK;
-@@ -69,37 +61,6 @@
+@@ -69,37 +68,6 @@
// save interp for cputs function
global_interp = interp;
@@ -88,12 +100,19 @@ Description: Store all files in the usual FHS directories instead of
return TCL_ERROR;
--- a/src/ds9.tcl
+++ b/src/ds9.tcl
-@@ -200,7 +200,7 @@
+@@ -198,9 +198,14 @@
+
+ switch $ds9(wm) {
x11 {
++ global env
# set to absolute path so that if -cd command is used,
# so we can still find our files
- set ds9(root) [file normalize [file join [pwd] zvfsmntpt]]
-+ set ds9(root) "/usr/share/saods9"
++ if { [info exists env(DS9_HOME) ] } {
++ set ds9(root) $env(DS9_HOME)
++ } else {
++ set ds9(root) "/usr/share/saods9"
++ }
package require msgcat
package require http
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/saods9.git
More information about the debian-science-commits
mailing list