changeset 547:181928a65a25

* ecosadmin.tcl, fs/rom/current/support/file2c.tcl, hal/arm/aeb/current/src/flash_cksum.tcl, hal/arm/e7t/current/src/flash_cksum.tcl, hal/mips/ref4955/current/misc/slow_cat.tcl, hal/mips/ref4955/current/misc/swap4.tcl, pkgconf/fixhtml.tcl, services/memalloc/common/current/src/heapgen.tcl: Accommodate tclsh83 on Cygwin in Tcl scripts.
author jld
date Wed, 29 Jan 2003 12:45:01 +0000
parents bd1ddaaaf796
children fb853432c81a
files packages/ChangeLog packages/ecosadmin.tcl packages/fs/rom/current/ChangeLog packages/fs/rom/current/support/file2c.tcl packages/hal/arm/aeb/current/ChangeLog packages/hal/arm/aeb/current/src/flash_cksum.tcl packages/hal/arm/e7t/current/ChangeLog packages/hal/arm/e7t/current/src/flash_cksum.tcl packages/hal/mips/ref4955/current/ChangeLog packages/hal/mips/ref4955/current/misc/slow_cat.tcl packages/hal/mips/ref4955/current/misc/swap4.tcl packages/pkgconf/fixhtml.tcl packages/services/memalloc/common/current/ChangeLog packages/services/memalloc/common/current/src/heapgen.tcl
diffstat 14 files changed, 84 insertions(+), 84 deletions(-) [+]
line wrap: on
line diff
--- a/packages/ChangeLog
+++ b/packages/ChangeLog
@@ -1,3 +1,11 @@
+2003-01-29  John Dallaway  <jld@ecoscentric.com>
+
+	* ecosadmin.tcl: Accommodate UNIX-style paths under Cygwin when
+	adding packages.
+
+	* pkgconf/fixhtml.tcl: Accommodate latest Cygwin Tcl shell
+	(tclsh83.exe)
+
 2003-01-24  Knud Woehler <knud.woehler@microplex.de>
 2003-01-24  Mark Salter  <msalter@redhat.com>
 
--- a/packages/ecosadmin.tcl
+++ b/packages/ecosadmin.tcl
@@ -1,15 +1,9 @@
-#!/bin/sh
-# these lines restart using the tcl shell \
-  exec sh -c "if ( echo | tclsh ) 2>/dev/null ; then \
-      exec tclsh \"${0}\" ${1+${*}} ; \
-    elif ( echo | tclsh83 ) 2>/dev/null ; then \
-      exec tclsh83 \"${0}\" ${1+${*}} ; \
-    elif ( echo | cygtclsh80 ) 2>/dev/null ; then \
-      exec cygtclsh80 \"${0}\" ${1+${*}} ; \
-    else \
-      echo Could not find TCL interpreter ; \
-      exit 1 ; \
-    fi"
+#!/bin/bash
+# restart using a Tcl shell \
+    exec sh -c 'for tclshell in tclsh tclsh83 cygtclsh80 ; do \
+            ( echo | $tclshell ) 2> /dev/null && exec $tclshell "`( cygpath -w \"$0\" ) 2> /dev/null || echo $0`" "$@" ; \
+        done ; \
+        echo "ecosadmin.tcl: cannot find Tcl shell" ; exit 1' "$0" "$@"
 
 # {{{  Banner
 
@@ -467,12 +461,9 @@ proc ecosadmin::parse_arguments { argv0 
 		}
 	} 
 
-	# Under Windows it is desirable to do some checking on any directories that
-	# have been provided. Some cygwin pathnames that a user might supply are
-	# not acceptable to Tcl.
-	if { $ecosadmin::windows_host } {
-		set ecosadmin::component_repository [get_pathname_for_tcl $ecosadmin::component_repository]
-	}
+	# Convert user-specified UNIX-style Cygwin pathnames to Windows Tcl-style as necessary
+	set ecosadmin::component_repository [get_pathname_for_tcl $ecosadmin::component_repository]
+	set ecosadmin::add_package [get_pathname_for_tcl $ecosadmin::add_package]
 }
 
 #
--- a/packages/fs/rom/current/ChangeLog
+++ b/packages/fs/rom/current/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-29  John Dallaway  <jld@ecoscentric.com>
+
+	* support/file2c.tcl: Accommodate latest Cygwin Tcl shell
+	(tclsh83.exe)
+
 2002-04-15  Bart Veer  <bartv@redhat.com>
 
 	* support/file2c.tcl:
--- a/packages/fs/rom/current/support/file2c.tcl
+++ b/packages/fs/rom/current/support/file2c.tcl
@@ -1,13 +1,9 @@
-#!/bin/sh
-# these lines restart using the tcl shell \
-  exec sh -c "if ( echo | tclsh ) 2>/dev/null ; then \
-      exec tclsh \"${0}\" ${1+${*}} ; \
-    elif ( echo | cygtclsh80 ) 2>/dev/null ; then \
-      exec cygtclsh80 \"${0}\" ${1+${*}} ; \
-    else \
-      echo Could not find TCL interpreter ; \
-      exit 1 ; \
-    fi"
+#!/bin/bash
+# restart using a Tcl shell \
+    exec sh -c 'for tclshell in tclsh tclsh83 cygtclsh80 ; do \
+            ( echo | $tclshell ) 2> /dev/null && exec $tclshell "`( cygpath -w \"$0\" ) 2> /dev/null || echo $0`" "$@" ; \
+        done ; \
+        echo "file2c.tcl: cannot find Tcl shell" ; exit 1' "$0" "$@"
 
 #===============================================================================
 #
--- a/packages/hal/arm/aeb/current/ChangeLog
+++ b/packages/hal/arm/aeb/current/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-29  John Dallaway  <jld@ecoscentric.com>
+
+	* src/flash_cksum.tcl: Accommodate latest Cygwin Tcl shell
+	(tclsh83.exe)
+
 2002-05-23  Jesper Skov  <jskov@redhat.com>
 
 	* cdl/hal_arm_aeb.cdl: Don't run cache tests.
--- a/packages/hal/arm/aeb/current/src/flash_cksum.tcl
+++ b/packages/hal/arm/aeb/current/src/flash_cksum.tcl
@@ -1,13 +1,9 @@
-#!/bin/sh
-# these lines restart using the tcl shell \
-  exec sh -c "if ( echo | tclsh ) 2>/dev/null ; then \
-      exec tclsh \"${0}\" ${1+${*}} ; \
-    elif ( echo | cygtclsh80 ) 2>/dev/null ; then \
-      exec cygtclsh80 \"${0}\" ${1+${*}} ; \
-    else \
-      echo Could not find TCL interpreter ; \
-      exit 1 ; \
-    fi"
+#!/bin/bash
+# restart using a Tcl shell \
+    exec sh -c 'for tclshell in tclsh tclsh83 cygtclsh80 ; do \
+            ( echo | $tclshell ) 2> /dev/null && exec $tclshell "`( cygpath -w \"$0\" ) 2> /dev/null || echo $0`" "$@" ; \
+        done ; \
+        echo "flash_cksum.tcl: cannot find Tcl shell" ; exit 1' "$0" "$@"
 
 #===============================================================================
 #
--- a/packages/hal/arm/e7t/current/ChangeLog
+++ b/packages/hal/arm/e7t/current/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-29  John Dallaway  <jld@ecoscentric.com>
+
+	* src/flash_cksum.tcl: Accommodate latest Cygwin Tcl shell
+	(tclsh83.exe)
+
 2002-10-19  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* include/hal_platform_setup.h (PLATFORM_SETUP1): Only define if
--- a/packages/hal/arm/e7t/current/src/flash_cksum.tcl
+++ b/packages/hal/arm/e7t/current/src/flash_cksum.tcl
@@ -1,13 +1,9 @@
-#!/bin/sh
-# these lines restart using the tcl shell \
-  exec sh -c "if ( echo | tclsh ) 2>/dev/null ; then \
-      exec tclsh \"${0}\" ${1+${*}} ; \
-    elif ( echo | cygtclsh80 ) 2>/dev/null ; then \
-      exec cygtclsh80 \"${0}\" ${1+${*}} ; \
-    else \
-      echo Could not find TCL interpreter ; \
-      exit 1 ; \
-    fi"
+#!/bin/bash
+# restart using a Tcl shell \
+    exec sh -c 'for tclshell in tclsh tclsh83 cygtclsh80 ; do \
+            ( echo | $tclshell ) 2> /dev/null && exec $tclshell "`( cygpath -w \"$0\" ) 2> /dev/null || echo $0`" "$@" ; \
+        done ; \
+        echo "flash_cksum.tcl: cannot find Tcl shell" ; exit 1' "$0" "$@"
 
 #===============================================================================
 #
--- a/packages/hal/mips/ref4955/current/ChangeLog
+++ b/packages/hal/mips/ref4955/current/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-29  John Dallaway  <jld@ecoscentric.com>
+
+	* misc/slow_cat.tcl, misc/swap4.tcl:
+	Accommodate latest Cygwin Tcl shell (tclsh83.exe)
+
 2002-08-06  Gary Thomas  <gary@chez-thomas.org>
 2002-08-06  Motoya Kurotsu <kurotsu@allied-telesis.co.jp>	
 
--- a/packages/hal/mips/ref4955/current/misc/slow_cat.tcl
+++ b/packages/hal/mips/ref4955/current/misc/slow_cat.tcl
@@ -1,13 +1,9 @@
-#!/bin/sh
-# these lines restart using the tcl shell \
-  exec sh -c "if ( echo | tclsh ) 2>/dev/null ; then \
-      exec tclsh \"${0}\" ${1+${*}} ; \
-    elif ( echo | cygtclsh80 ) 2>/dev/null ; then \
-      exec cygtclsh80 \"${0}\" ${1+${*}} ; \
-    else \
-      echo Could not find TCL interpreter ; \
-      exit 1 ; \
-    fi"
+#!/bin/bash
+# restart using a Tcl shell \
+    exec sh -c 'for tclshell in tclsh tclsh83 cygtclsh80 ; do \
+            ( echo | $tclshell ) 2> /dev/null && exec $tclshell "`( cygpath -w \"$0\" ) 2> /dev/null || echo $0`" "$@" ; \
+        done ; \
+        echo "slow_cat.tcl: cannot find Tcl shell" ; exit 1' "$0" "$@"
 
 # Can be used like this:
 #  Get flash ready for programming using Minicom or similar
--- a/packages/hal/mips/ref4955/current/misc/swap4.tcl
+++ b/packages/hal/mips/ref4955/current/misc/swap4.tcl
@@ -1,13 +1,9 @@
-#!/bin/sh
-# these lines restart using the tcl shell \
-  exec sh -c "if ( echo | tclsh ) 2>/dev/null ; then \
-      exec tclsh \"${0}\" ${1+${*}} ; \
-    elif ( echo | cygtclsh80 ) 2>/dev/null ; then \
-      exec cygtclsh80 \"${0}\" ${1+${*}} ; \
-    else \
-      echo Could not find TCL interpreter ; \
-      exit 1 ; \
-    fi"
+#!/bin/bash
+# restart using a Tcl shell \
+    exec sh -c 'for tclshell in tclsh tclsh83 cygtclsh80 ; do \
+            ( echo | $tclshell ) 2> /dev/null && exec $tclshell "`( cygpath -w \"$0\" ) 2> /dev/null || echo $0`" "$@" ; \
+        done ; \
+        echo "swap4.tcl: cannot find Tcl shell" ; exit 1' "$0" "$@"
 
 proc filter { input_file output_file } {
     set input_fd [open $input_file  "r"]
--- a/packages/pkgconf/fixhtml.tcl
+++ b/packages/pkgconf/fixhtml.tcl
@@ -1,6 +1,9 @@
-#!/bin/sh
-# the next line restarts using tclsh \
- exec tclsh "$0" ${1+"$@"}
+#!/bin/bash
+# restart using a Tcl shell \
+    exec sh -c 'for tclshell in tclsh tclsh83 cygtclsh80 ; do \
+            ( echo | $tclshell ) 2> /dev/null && exec $tclshell "`( cygpath -w \"$0\" ) 2> /dev/null || echo $0`" "$@" ; \
+        done ; \
+        echo "fixhtml.tcl: cannot find Tcl shell" ; exit 1' "$0" "$@"
 
 #===============================================================================
 #
--- a/packages/services/memalloc/common/current/ChangeLog
+++ b/packages/services/memalloc/common/current/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-29  John Dallaway  <jld@ecoscentric.com>
+
+	* src/heapgen.tcl: Accommodate latest Cygwin Tcl shell
+	(tclsh83.exe)
+
 2002-05-10  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* tests/heaptest.c (test_pat): Make failure messages clearer.
--- a/packages/services/memalloc/common/current/src/heapgen.tcl
+++ b/packages/services/memalloc/common/current/src/heapgen.tcl
@@ -1,16 +1,9 @@
-#!/bin/sh
-# these lines restart using the tcl shell \
-    exec sh -c "if ( echo | cygtclsh80 ) 2>/dev/null ; then \
-      exec cygtclsh80 \"${0}\" \"\`echo \\\"\\\`cygpath -w \\\"${1}\\\" \\\`\\\" |sed 's#\\\\\\\\#/#g'\`\" \"\`echo \\\"\\\`cygpath -w \\\"${2}\\\" \\\`\\\" |sed 's#\\\\\\\\#/#g'\`\" ; \
-    elif ( echo | tclsh ) 2>/dev/null ; then \
-      exec tclsh \"${0}\" ${1+${*}} ; \
-    else \
-      echo Could not find TCL interpreter ; \
-      exit 1 ; \
-    fi"
-
-#FIXMEFIXMEFIXME the above should use cygpath -ws, not cygpath -w but we
-#can't rely on everyone having up-to-date cygwin tools (1.1.5+)
+#!/bin/bash
+# restart using a Tcl shell \
+    exec sh -c 'for tclshell in tclsh tclsh83 cygtclsh80 ; do \
+            ( echo | $tclshell ) 2> /dev/null && exec $tclshell "`( cygpath -w \"$0\" ) 2> /dev/null || echo $0`" "$@" ; \
+        done ; \
+        echo "heapgen.tcl: cannot find Tcl shell" ; exit 1' "$0" "$@"
 
 #===============================================================================
 #