HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

suggestions for changes to tkhylafax-3.0



I'm attaching a patch file for some improvements to tkhylafax.

1.  The fields that pick up the comments, etc., for the cover sheet
wouldn't correctly pass the characters ['"$\] to the cover sheet
program, so, for example, if you wanted to include a price with a $
sign, you couldn't.

2.  I've added a system-wide default resource file, to be put in the
directory '/usr/local/lib/tkhylafax-3.0, or wherever the TCL source
lives.  It's name is 'tkhylafax-defaults'.

3.  I've added a hook to pick up the invocation of 'wish', and used the
value in the Makefile to change it.  The change to the Makefile also
cleans up the patch of the 'tkhylafax' main source file, but REQUIRES
that the name of the original file be changed to 'tkhylafax.unpatched',
i.e, after applying the patch file, you need to 

	mv tkhylafax tkhylafax.unpatched

Thanks for putting this program together, and I hope you find these
changes useful.



*** orig/Makefile	Wed Sep 24 13:32:12 1997
--- Makefile	Wed Sep 24 13:31:03 1997
***************
*** 60,75 ****
  	if [ ! -d $(TCLPRG_DEST) ]; then mkdir -p $(TCLPRG_DEST); fi
  	chmod 775 $(TCLPRG_DEST)
  
! tkhylafax: $(TCLPRG_DEST)
  	@echo "Patching tkhylafax..." 
- 	mv tkhylafax tkhylafax.unpatched
  	sed -e 's|XXX_TKHYLAFAX_XXX|$(TCLLIB_DEST)|g' \
! 	    tkhylafax.unpatched > tkhylafax
  	@echo "Done" 
  	@echo "Installing tkhylafax command..." 
  	cp $(TCLPRG_FILE) $(TCLPRG_DEST)/$@
  	chmod 775 $(TCLPRG_DEST)/$@
- 	mv tkhylafax.unpatched tkhylafax
  	@echo "Done" 
  
  install.man:
--- 60,74 ----
  	if [ ! -d $(TCLPRG_DEST) ]; then mkdir -p $(TCLPRG_DEST); fi
  	chmod 775 $(TCLPRG_DEST)
  
! tkhylafax: $(TCLPRG_DEST) Makefile
  	@echo "Patching tkhylafax..." 
  	sed -e 's|XXX_TKHYLAFAX_XXX|$(TCLLIB_DEST)|g' \
! 	    -e 's|XXX_WISH_XXX|$(WISH)|g' \
! 	    tkhylafax.unpatched > $(TCLPRG_FILE)
  	@echo "Done" 
  	@echo "Installing tkhylafax command..." 
  	cp $(TCLPRG_FILE) $(TCLPRG_DEST)/$@
  	chmod 775 $(TCLPRG_DEST)/$@
  	@echo "Done" 
  
  install.man:
*** orig/preferences.t	Wed Sep 24 13:38:20 1997
--- preferences.t	Wed Sep 24 13:38:57 1997
***************
*** 36,46 ****
  # Set user preferences
  #
  
! proc initPreference { {filename {}} } {
  
      global env
  
!     if {$filename != ""} {
          set database $filename
      } elseif {[info exists env(TKHYLAFAX_DEFAULTS)]} {
          set database $env(TKHYLAFAX_DEFAULTS)
--- 36,46 ----
  # Set user preferences
  #
  
! proc initPreference { filename } {
  
      global env
  
!     if {$filename != "" && [file exists $filename]} {
          set database $filename
      } elseif {[info exists env(TKHYLAFAX_DEFAULTS)]} {
          set database $env(TKHYLAFAX_DEFAULTS)
*** orig/faxIt.t	Wed Sep 24 13:40:31 1997
--- faxIt.t	Wed Sep 24 13:42:38 1997
***************
*** 67,76 ****
  
      if {[string length $Th_Info(name)]} {
          # This MUST appear.
!         append options " -d \"$Th_Info(name)@$Th_Info(phone)\""
  
          # Make an ID string for later usage
!         append options " -i \"$Th_Info(name)@$Th_Info(company)\"" 
      } else {
          # This MUST appear.
          append options " -d $Th_Info(phone)"
--- 67,78 ----
  
      if {[string length $Th_Info(name)]} {
          # This MUST appear.
! 	regsub -all {["'$\\]} $Th_Info(name) {\\&} name
!         append options " -d \"$name@$Th_Info(phone)\""
  
          # Make an ID string for later usage
! 	regsub -all {["'$\\]} $Th_Info(company) {\\&} company
!         append options " -i \"$name@$company\"" 
      } else {
          # This MUST appear.
          append options " -d $Th_Info(phone)"
***************
*** 91,115 ****
  	# Make command. Ignore the following options: -k -s -h -v 
  	append faxcmd "sendfax "
  
!          foreach ln [lsort [array name Comments]] { 
  	    append comments "$Comments($ln) "
!          }    
  
  	set comments [string trim $comments]
  	if {[string length $comments]} {
  	    append faxcmd " -c \"$comments\""
  	}
  
  	if {[string length $Th_Info(regard)]} {
! 	    append faxcmd " -r \"$Th_Info(regard)\""
  	}
  
  	if {[string length $Th_Info(company)]} {
! 	    append faxcmd " -x \"$Th_Info(company)\""
  	}
  
  	if {[string length $Th_Info(location)]} {
! 	    append faxcmd " -y \"$Th_Info(location)\""
  	}
  
  	append faxcmd $options
--- 93,121 ----
  	# Make command. Ignore the following options: -k -s -h -v 
  	append faxcmd "sendfax "
  
!         foreach ln [lsort [array name Comments]] { 
  	    append comments "$Comments($ln) "
!         }    
  
  	set comments [string trim $comments]
  	if {[string length $comments]} {
+ 	    regsub -all {["'$\\]} $comments {\\&} comments
  	    append faxcmd " -c \"$comments\""
  	}
  
  	if {[string length $Th_Info(regard)]} {
! 	    regsub -all {["'$\\]} $Th_Info(regard) {\\&} regarding
! 	    append faxcmd " -r \"$regarding\""
  	}
  
  	if {[string length $Th_Info(company)]} {
! 	    regsub -all {["'$\\]} $Th_Info(company) {\\&} company
! 	    append faxcmd " -x \"$company\""
  	}
  
  	if {[string length $Th_Info(location)]} {
! 	    regsub -all {["'$\\]} $Th_Info(location) {\\&} location
! 	    append faxcmd " -y \"$location\""
  	}
  
  	append faxcmd $options
*** orig/mkCover.t	Wed Sep 24 13:40:31 1997
--- mkCover.t	Wed Sep 24 13:42:38 1997
***************
*** 52,74 ****
  
      set comments [string trim $comments]
      if {[string length $comments]} {
  	append faxcmd " -c \"$comments\""
      }
  
      if {[string length $Th_Info(regard)]} {
! 	append faxcmd " -r \"$Th_Info(regard)\""
      }
  
      if {[string length $Th_Info(company)]} {
! 	append faxcmd " -x \"$Th_Info(company)\""
      }
  
      if {[string length $Th_Info(location)]} {
! 	append faxcmd " -l \"$Th_Info(location)\""
      }
  
      if {[string length $Th_Info(name)]} {
! 	append faxcmd " -t \"$Th_Info(name)\""
      } else {
  	append faxcmd " -t \"Unknown\""  
      }
--- 52,79 ----
  
      set comments [string trim $comments]
      if {[string length $comments]} {
+ 	regsub -all {["'$\\]} $comments {\\&} comments
  	append faxcmd " -c \"$comments\""
      }
  
      if {[string length $Th_Info(regard)]} {
! 	regsub -all {["'$\\]} $Th_Info(regard) {\\&} regarding
! 	append faxcmd " -r \"$regarding\""
      }
  
      if {[string length $Th_Info(company)]} {
! 	regsub -all {["'$\\]} $Th_Info(company) {\\&} company
! 	append faxcmd " -x \"$company\""
      }
  
      if {[string length $Th_Info(location)]} {
! 	regsub -all {["'$\\]} $Th_Info(location) {\\&} location
! 	append faxcmd " -l \"$location\""
      }
  
      if {[string length $Th_Info(name)]} {
! 	regsub -all {["'$\\]} $Th_Info(name) {\\&} name
! 	append faxcmd " -t \"$name\""
      } else {
  	append faxcmd " -t \"Unknown\""  
      }
***************
*** 122,128 ****
  	}
      } else {
  	if {[string length $Th_Info(from)]} {
! 	    append faxcmd " -f \"$Th_Info(from)\""
  	} else {
  	    append faxcmd " -f \"Unknown\""
  	}
--- 127,134 ----
  	}
      } else {
  	if {[string length $Th_Info(from)]} {
! 	    regsub -all {["'$\\]} $Th_Info(from) {\\&} from
! 	    append faxcmd " -f \"$from\""
  	} else {
  	    append faxcmd " -f \"Unknown\""
  	}
*** orig/tkhylafax	Wed Sep 24 13:34:59 1997
--- tkhylafax	Wed Sep 24 13:46:00 1997
***************
*** 1,6 ****
  #!/bin/sh
  #\
! exec wish "$0" ${1+"$@"}
  
  #
  # 
--- 1,6 ----
  #!/bin/sh
  #\
! exec XXX_WISH_XXX "$0" ${1+"$@"}
  
  #
  # 
***************
*** 349,355 ****
  }
  
  lappend auto_path $Th_Info(libraryPath)
! initPreference
  setOptions
  initRolodex
  initBatch
--- 349,355 ----
  }
  
  lappend auto_path $Th_Info(libraryPath)
! initPreference $Th_Info(libraryPath)/tkhylafax-defaults
  setOptions
  initRolodex
  initBatch
*** orig/tkhylafax.man	Wed Sep 24 13:47:46 1997
--- tkhylafax.man	Wed Sep 24 13:49:22 1997
***************
*** 235,240 ****
--- 235,242 ----
  A legal line in this file, for example, would be ``*faxResolution: high''. A 
  ``!'' in the first column of any line is treated as a comment. A 
  sample .tkhylafax-default file is included in this distribution.
+ If no such file in the user's home directory is found, the system-wide
+ resource file '/usr/local/lib/tkhylafax-3.0/tkhylafax-defaults is used.
  
  I'm thinking of adding a 
  .I few




Project hosted by iFAX Solutions