3 # Text file conversion script for packaging on Windows
5 # This script copies a text file from a source to a destination,
6 # converting line endings and adding a ".txt" filename extension
7 # if needed. If the destination is a directory the source file
8 # name is used. Newer files will not be overwritten.
10 # The destination file should be double-clickable and usable
11 # when Notepad is the default editor.
13 # Copyright 2013 Gerald Combs <gerald@wireshark.org>
17 # Wireshark - Network traffic analyzer
18 # By Gerald Combs <gerald@wireshark.org>
19 # Copyright 1998 Gerald Combs
21 # This program is free software; you can redistribute it and/or
22 # modify it under the terms of the GNU General Public License
23 # as published by the Free Software Foundation; either version 2
24 # of the License, or (at your option) any later version.
26 # This program is distributed in the hope that it will be useful,
27 # but WITHOUT ANY WARRANTY; without even the implied warranty of
28 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 # GNU General Public License for more details.
31 # You should have received a copy of the GNU General Public License
32 # along with this program; if not, write to the Free Software
33 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
43 echo " $0 <source file> <destination file>"
48 if [ -z "$SRC" -o -z "$DST" ] ; then
52 if [ ! -r "$SRC" ] ; then
53 err_exit
"Can't read $SRC"
56 if [ -f "$DST" -a "$DST" -nt "SRC" ]; then
60 if [ -d "$DST" ] ; then
61 DSTBASE
=`basename "$SRC" txt`
62 DST
="$DST/$DSTBASE.txt"
64 DSTDIR
=`dirname "$DST"`
65 DSTBASE
=`basename "$DST" txt`
66 DST
="$DSTDIR/$DSTBASE.txt"