Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37042364
en ru br
ALT Linux repos
S:5.45.4-alt4
5.0: 5.44-alt3
4.1: 5.44-alt2
4.0: 5.43-alt3
3.0: 5.43-alt1

Other repositories
Upstream:5.44.1

Group :: Development/Tcl
RPM: expect

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: expect-5.43-alt-fixline.patch
Download


diff --git a/fixline1 b/fixline1
index 113e9bb..81e8a02 100755
--- a/fixline1
+++ b/fixline1
@@ -1,8 +1,10 @@
-#!expect --
+#!/usr/bin/tclsh
+# -*- tcl -*-
 # Synopsis: fixline1 newpath < input > output
 # Author: Don Libes
+# Modified by: Sergey Bolshakov <sbolshakov@altlinux.ru>
+# Description: change first line of script to load expect as tcl package
 
-# Description: change first line of script to reflect new binary
 # try to match any of the following first lines
 #!expect ...
 #!../expect ...
@@ -10,16 +12,20 @@
 #!foo/bar/expectk ...
 #!/bin/sh ...  (beginning of multiline #! style)
 #
-set line1 [gets stdin]
-if {"$line1" == "\#!/bin/sh"} {
-    # if multi-line hack already in place, do nothing
-    set header $line1
-} else {
-    # if single-line #!, switch to multi-line rewrite
 
-    regexp "^#!(.*/)*(.*)" $line1 X X tail
-    set header "#!/bin/sh\n"
-    append header "# \\\n"
-    append header "exec $tail "; append header {"$0" ${1+"$@"}}
+set line1 "#!/usr/bin/tclsh"
+set with_tk {}
+
+if {[regexp {^#!(?:.*/)*([^ ]+)} [gets stdin] {} interp]} {
+    switch -exact -- $interp {
+	expectk {
+	    set with_tk {package require Tk}
+	}
+	expect {}
+	default {
+	    error "FIXME: $interp"
+	}
+    }
 }
-puts -nonewline "$header\n[read stdin]"
+
+puts -nonewline "$line1\npackage require Expect\n$with_tk\n[read stdin]"
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin