Commit 4a5dd291 authored by Markus Koschany's avatar Markus Koschany

Imported Debian patch 1.7.12~a+ds-1

parents 16e4c673 acb78720
File mode changed from 100755 to 100644
tofrodos (1.7.8.debian.1-2) unstable; urgency=low
With this release the symlinks "unix2dos" and "dos2unix" are dropped from the
package. This will allow the introduction of the original dos2unix package,
which also supports conversion to MacOS style files.
Should you have scripts depending on these symlinks, I recommend using
shell-aliases, like in the following example for bash:
alias unix2dos="/usr/bin/fromdos -u" (or todos)
alias dos2unix="/usr/bin/fromdos -d" (or just fromdos)
-- Alexander Reichle-Schmehl <tolimar@debian.org> Thu, 21 Jan 2010 20:59:11 +0100
This package uses quilt for patch management, for more information see
the file /usr/share/doc/quilt/README.source in the quilt package.
tofrodos (1.7.12~a+ds-1) unstable; urgency=low
[ Alexander Reichle-Schmehl ]
* Fix last changelog entry, remove the "NOT RELEASED YET" entry.
(Closes: #645830) Thanks to Josh Triplett for noticing!
[ Markus Koschany ]
* New Maintainer. (Closes: #726553)
* New upstream release. (Closes: #692421)
* Switch to source format 3.0.
* Bump compat level to 9 and require debhelper >= 9.
* Bump Standards-Version to 3.9.4, no changes.
* Improve watch file. Thanks to Bart Martens.
* Drop README.source and build-dependency on quilt. Source format 3.0 uses
quilt by default.
* Drop NEWS file because it is obsolete.
* Register tofrodos.html with doc-base.
* Switch to dh sequencer.
* Enable all hardening build flags.
* debian/control:
- Convert svn repository to Git repository. Change VCS-fields accordingly.
- Drop Conflicts field in debian/control. It is obsolete.
* Add DEP-3 header to FTBFS_non-linux.patch.
* Update debian/copyright to copyright format 1.0.
-- Markus Koschany <apo@gambaru.de> Thu, 17 Oct 2013 14:29:41 +0200
tofrodos (1.7.9.debian.1-1) unstable; urgency=low
* NOT RELEASED YET
* Fix Vcs-Svn header in debian/control
* New upstream release
* Add recommended targets build-arch and build-indep to debian/rules
......
Source: tofrodos
Section: utils
Priority: optional
Maintainer: Alexander Reichle-Schmehl <tolimar@debian.org>
Build-Depends: debhelper (>= 5), quilt
Standards-Version: 3.9.2
Maintainer: Markus Koschany <apo@gambaru.de>
Build-Depends:
debhelper (>= 9)
Standards-Version: 3.9.4
Homepage: http://www.thefreecountry.com/tofrodos/index.shtml
Vcs-Svn: svn://svn.debian.org/svn/collab-maint/deb-maint/tofrodos/trunk/
Vcs-Browser: http://svn.debian.org/viewsvn/collab-maint/deb-maint/tofrodos/
Vcs-Git: git://anonscm.debian.org/collab-maint/tofrodos.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/tofrodos.git
Package: tofrodos
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Conflicts: sysutils (<= 2.0.0-1)
Depends:
${misc:Depends},
${shlibs:Depends}
Description: Converts DOS <-> Unix text files, alias tofromdos
DOS text files traditionally have CR/LF (carriage return/line feed) pairs
as their new line delimiters while Unix text files traditionally have
......
This package was debianized by Alexander Schmehl <tolimar@debian.org> on
Sun, 24 Feb 2008 17:53:08 +0100.
It is based on the package formerly maintained by Florian Ernst
<florian@debian.org>.
It was downloaded from <http://www.thefreecountry.com/tofrodos/index.shtml>
The only change to the original source tarball is the removal of fromdos.exe
and todos.exe.
Upstream Author:
Christopher Heng
Copyright:
Copyright (C) 1996-2005 Christopher Heng
License:
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
On Debian systems, the complete text of the GNU General Public License version
2 can be found in `/usr/share/common-licenses/GPL-2'.
The Debian packaging is (C) 2008, Alexander Schmehl <tolimar@debian.org> and is
licensed under the GPL-2, see above.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Tofrodos
Source: http://www.thefreecountry.com/tofrodos/index.shtml
Comment:
The only change to the original source tarball is the removal of fromdos.exe
and todos.exe and recompression with xz.
Files: *
Copyright: 1996-2012 Christopher Heng
License: GPL-2
Files: debian/*
Copyright: 2005-2006, Florian Ernst <florian@debian.org>
2008-2013, Alexander Reichle-Schmehl <tolimar@debian.org>
2013, Markus Koschany <apo@gambaru.de>
License: GPL-2
License: GPL-2
On Debian systems, the complete text of the GNU General Public License version
2 can be found in `/usr/share/common-licenses/GPL-2'.
usr/bin
usr/share/man/man1
Document: tofrodos
Title: Debian tofrodos manual
Author: Christopher Heng
Abstract: This manual describes the functionality of tofrodos.
Section: File Management
Format: HTML
Index: /usr/share/doc/tofrodos/tofrodos.html
Files: /usr/share/doc/tofrodos/tofrodos.html
readme.txt
tofrodos.html
## 02_FTBFS_non-linux.dpatch by Guillem Jover <guillem@debian.org>
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix FTBFS on non Linux systems
From: Guillem Jover <guillem@debian.org>
Date: Thu, 18 Oct 2011 19:06:01 +0200
Subject: FTBFS_non-linux
---
src/config.h | 4 +++-
src/tofrodos.c | 13 ++++++++++---
src/config.h | 4 +++-
src/tofrodos.c | 13 ++++++++++---
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/config.h b/src/config.h
index ff6adc1..91a7480 100644
--- a/src/config.h
+++ b/src/config.h
@@ -102,7 +102,9 @@ extern "C" {
@@ -96,7 +96,9 @@ extern "C" {
#endif
#endif
......@@ -20,9 +22,11 @@
#if !defined(LINUX)
#define LINUX
#endif
diff --git a/src/tofrodos.c b/src/tofrodos.c
index e9b8e9c..a9c5dc3 100644
--- a/src/tofrodos.c
+++ b/src/tofrodos.c
@@ -443,7 +443,7 @@ static int convert ( FILE * infp, FILE *
@@ -418,7 +418,7 @@ static int convert ( FILE * infp, FILE * outfp )
static int openandconvert_preamble ( char * filename )
{
struct stat statbuf ;
......@@ -31,7 +35,7 @@
int len ;
/* get the file information */
@@ -461,16 +461,23 @@ static int openandconvert_preamble ( cha
@@ -436,16 +436,23 @@ static int openandconvert_preamble ( char * filename )
/* eg, #define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK) */
/* or something like that. */
......
FTBFS_non-linux.diff
FTBFS_non-linux.patch
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
#export DH_VERBOSE=1
PACKAGE = $(shell dh_listpackages)
TMPDIR = $(CURDIR)/debian/$(PACKAGE)
INSTALL = install
CFLAGS = -Wall -g
CFLAGS+=$(shell getconf LFS_CFLAGS)
LDFLAGS+=$(shell getconf LFS_LDFLAGS)
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
include /usr/share/quilt/quilt.make
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: patch
dh_testdir
cd $(CURDIR)/src && $(MAKE) CDEBUG="$(CFLAGS)" LDEBUG="-g"
touch $@
clean: unpatch
dh_testdir
dh_testroot
rm -f build-stamp
cd $(CURDIR)/src && $(MAKE) -i distclean
dh_clean
install: build
dh_testdir
dh_testroot
dh_installdirs usr/bin usr/share/man/man1
cd $(CURDIR)/src && $(MAKE) install BINDIR="$(TMPDIR)/usr/bin" MANDIR="$(TMPDIR)/usr/share/man/man1"
binary-indep: build install
# We have nothing to do by default.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs tofrodos.html
dh_installman
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
PKD = $(abspath $(dir $(MAKEFILE_LIST)))
PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
UVER = $(shell dpkg-parsechangelog -l$(PKD)/changelog -SVersion | cut -d- -f1)
DTYPE = +ds
VER ?= $(subst $(DTYPE),,$(UVER))
%:
dh $@
override_dh_auto_clean:
cd $(CURDIR)/src \
&& $(MAKE) clean \
&& $(RM) -r -v fromdos todos
override_dh_auto_build:
cd $(CURDIR)/src && $(MAKE) CDEBUG="$(CFLAGS)" LDEBUG="$(LDFLAGS)"
override_dh_auto_install:
cd $(CURDIR)/src && $(MAKE) install \
BINDIR=$(CURDIR)/debian/tofrodos/usr/bin \
MANDIR=$(CURDIR)/debian/tofrodos/usr/share/man/man1
## http://wiki.debian.org/onlyjob/get-orig-source
.PHONY: get-orig-source
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE))
@
$(PKG)_$(VER)$(DTYPE).orig.tar.xz:
@echo "# Downloading..."
uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(PKD)
$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
@echo "# Extracting..."
mkdir $(PKG)-$(VER) \
&& tar -xf $(PKG)_$(VER).orig.tar.* --directory $(PKG)-$(VER) --strip-components 1 \
|| $(RM) -r $(PKG)-$(VER)
@echo "# Cleaning-up..."
cd $(PKG)-$(VER) \
&& $(RM) -v \
*.exe
@echo "# Packing..."
find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \
| XZ_OPT="-6v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
&& $(RM) -r "$(PKG)-$(VER)"
version=3
opts=dversionmangle=s/\.debian\.\d+$// \
http://www.thefreecountry.com/tofrodos/index.shtml \
http://tofrodos.sourceforge.net/download/tofrodos-([\d\.]+)\.tar\.gz
opts=uversionmangle=s/(\d)[\.\-]?((rc|pre|dev|beta|alpha|b|a)\d*)$/$1~$2/,dversionmangle=s/\+(dfsg|debian|ds|repack|repacked)// \
http://www.thefreecountry.com/tofrodos/index.shtml .*/tofrodos-(\d.*)\.(?:tgz|tbz2|tar\.(?:gz|bz2|xz))
Distribution file list and directory structure
Copyright (c) 2002-2008 by Christopher Heng. All rights reserved.
-----------------------------------------------------------------
Copyright 2002-2012 by Christopher Heng. All rights reserved.
-------------------------------------------------------------
# Main directory
......@@ -33,10 +33,6 @@ src\
# Makefiles for other MSDOS/Windows compilers
makefile.bc Borland C++ 4.5x/5.0x Makefile
makefile.dj2 DJGPP 2.X Makefile
makefile.dm Digital Mars Makefile
makefile.lcc LCC-Win32 Makefile
makefile.min MinGW Makefile
makefile.wcc Watcom Makefile
makefile.vs7 Visual Studio .NET 2003 makefile
......@@ -50,7 +46,7 @@ src\
src\lib\
mktemp.c mktemp() for deficient systems
mktemp.c mkstemp() for deficient systems
mktemp.h
getopt.c getopt() for deficient systems
getopt.h
......
This diff is collapsed.
# makefile.gcc Makefile for building with the GNU C compiler on Linux.
# Copyright (c) 1996-2005 by Christopher Heng. All rights reserved.
# $Id: makefile.gcc,v 1.2 2005/03/06 05:40:49 chris Exp $ /*
# Copyright 1996-2012 by Christopher Heng. All rights reserved.
# This makefile requires the GNU make to work (we use the GNU extensions).
......@@ -18,10 +16,6 @@ CDEBUG = -O2
LDEBUG = -s
endif
ifndef VERSTR
VERSTR = 0.0
endif
# programs
CC = gcc
CD = cd
......@@ -34,8 +28,6 @@ MAKE = make
MKDIR = mkdir
MV = mv
RM = rm -f
TAR = tar
ZIP = zip
# flags
CFLAGS = $(DEFINES) $(TFLAG) $(CDEBUG) -c -Wall
......@@ -45,50 +37,20 @@ INSTALLDATAFLAGS = -m 644
LDFLAGS = $(LDEBUG)
LNFLAGS = -sf
RMRECURFLAGS = -rf
TARFLAGS = cvf
ZIPSRCFLAGS = -r -9
# directories
BINDIR = /usr/bin
DISTDIR = tofrodos-$(VERSTR)
LIBDIR = lib
LIBDISTDIR = $(DISTDIR)/lib
MANDIR = /usr/man/man1
# filenames
FROMDOS = fromdos
FROMDOSMAN = fromdos.1
FROMDOSTXT = fromdos.txt
TARGZNAME = $(TARNAME).gz
TARNAME = tofrodos-$(VERSTR).tar
TODOS = todos
ZIPSRCNAME = tfd.zip
# lists of filenames
DISTFILES = config.h \
copying \
emsg.c \
emsg.h \
fromdos \
init.c \
makefile.bc \
makefile.gcc \
makefile.vc \
makefile.wcc \
readme.txt \
todos16.exe \
todos32.exe \
tofrodos.c \
tofrodos.h \
tofrodos.lsm \
utility.c \
utility.h \
version.h \
$(FROMDOSMAN)
LIBDISTFILES = $(LIBDIR)/getopt.c \
$(LIBDIR)/getopt.h \
$(LIBDIR)/mktemp.c \
$(LIBDIR)/mktemp.h
OBJS = emsg.o \
init.o \
tofrodos.o \
......@@ -107,17 +69,6 @@ clean:
clobber: clean
$(RM) $(FROMDOS) $(TODOS)
dist: $(DISTFILES) $(DISTDIR) $(LIBDISTDIR)
$(CP) $(DISTFILES) $(DISTDIR)
$(CP) $(LIBDISTFILES) $(LIBDISTDIR)
$(MV) $(DISTDIR)/makefile.gcc $(DISTDIR)/Makefile
$(MV) $(DISTDIR)/copying $(DISTDIR)/COPYING
$(MV) $(DISTDIR)/readme.txt $(DISTDIR)/README.TXT
($(CD) $(DISTDIR) ; $(LN) $(LNFLAGS) fromdos todos)
distclean: clobber
$(RM) $(RMRECURFLAGS) $(DISTDIR)
install: installman
$(INSTALL) $(INSTALLBINFLAGS) $(FROMDOS) $(BINDIR)
($(CD) $(BINDIR) ; $(LN) $(LNFLAGS) fromdos todos)
......@@ -126,16 +77,8 @@ installman: $(FROMDOSMAN)
$(INSTALL) $(INSTALLDATAFLAGS) $(FROMDOSMAN) $(MANDIR)
($(CD) $(MANDIR) ; $(LN) $(LNFLAGS) fromdos.1 todos.1)
save:
$(ZIP) $(ZIPSRCFLAGS) $(ZIPSRCNAME) *
tardist: $(TARGZNAME)
# real rules
$(DISTDIR):
$(MKDIR) $(DISTDIR)
$(FROMDOS): $(OBJS)
$(CC) $(LDFLAGS) -o $(FROMDOS) $(OBJS)
......@@ -143,13 +86,6 @@ $(FROMDOSTXT): $(FROMDOSMAN)
gtbl $(FROMDOSMAN) | groff -Tascii -mandoc | \
troff -Tascii -mandoc | grotty > $@
$(LIBDISTDIR):
$(MKDIR) $(LIBDISTDIR)
$(TARGZNAME): dist
$(TAR) $(TARFLAGS) $(TARNAME) $(DISTDIR)
$(GZIP) $(GZIPFLAGS) $(TARNAME)
$(TODOS): $(FROMDOS)
$(LN) $(LNFLAGS) $(FROMDOS) $(TODOS)
......@@ -159,17 +95,3 @@ init.o: init.c config.h emsg.h tofrodos.h utility.h version.h
tofrodos.o: tofrodos.c config.h emsg.h tofrodos.h utility.h version.h
utility.o: utility.c config.h emsg.h tofrodos.h utility.h
# The following information is for the information of the maintainer of
# the package only.
# To make the distribution tar file, you need to define VERSTR to the
# version number. Eg, for a version 1.0 release, define VERSTR=1.0
# Hence a make command line would read
# make VERSTR=1.0 tardist
# If VERSTR is not defined at any time, it defaults to 0.0 (to remind
# you that you forgot something!).
#
# Before making tardist, you need to compile in DOS first.
/*
config.h Handles system dependencies.
Copyright (c) 1996-2008 by Christopher Heng. All rights reserved.
Copyright (c) 1996-2012 by Christopher Heng. All rights reserved.
*/
/*
......@@ -22,7 +22,7 @@
MSDOS MSDOS
WIN32 WIN32
2. You need a getopt() implementation. It must support the
2. You will need a getopt() implementation. It must support the
usual behaviour of the Unix getopt(), plus the variables
optind, opterr, and optarg.
......@@ -41,9 +41,9 @@
4. Note that on MSDOS systems, you will need _splitpath()
and _makepath(). If you use DJGPP, you probably can get away
with defining _splitpath() to call fnsplit(), etc (which I have
done below). Otherwise, you will need to roll your own version.
I think all the commercial MSDOS C compilers have these functions.
with defining _splitpath() to call fnsplit(), etc. Otherwise,
you will need to roll your own version. I think all the
commercial MSDOS C compilers have these functions.
5. You will also need stricmp() and strnicmp() on MSDOS or
strcasecmp() or strncasecmp() on Unix. If you have stricmp() and/or
......@@ -54,22 +54,16 @@
defining UNIX here will cause the compiler to use strcasecmp()
and strncasecmp().
6. You will need a mktemp(). On Unix systems, this is probably
6. You will need mkstemp(). On Unix systems, this is probably
declared in <unistd.h>.
Digital Mars declares mktemp() in io.h.
I have supplied my own mktemp.c and mktemp.h for use with the
Open Watcom C (Windows/DOS) and Visual C++ (Windows) compilers
that includes my implementation of mkstemp(). If your system
does not have mkstemp(), you might try to see if you can use
this. (It's in the lib directory.)
Borland declares mktemp() in dir.h. If you are writing or using
a replacement mktemp() you should put the prototype in a
header called mktemp.h and define HAVE_MKTEMP_H.
Visual C++ declares mktemp() in io.h.
I have supplied my own mktemp.c and mktemp.h for use with
Watcom C/C++ 10.X since these versions of the compiler do not
have mktemp().
If your compiler has mktemp() declared somewhere else (other
If your compiler has mkstemp() declared somewhere else (other
than unistd.h on Unix), define MKTEMP_HEADER to be the name
of the header, eg <whatever.h> (include the angle brackets or
double quotes), and HAVE_MKTEMP_H to force inclusion of the
......@@ -121,9 +115,6 @@ extern "C" {
#if !defined(WIN32)
#define WIN32
#endif
#if defined(__BORLANDC__) && defined(MSDOS) /* Borland always defines MSDOS */
#undef MSDOS
#endif
#endif
#if defined(__APPLE__)
......@@ -140,53 +131,18 @@ extern "C" {
#define HAVE_UNISTD_H
#endif
#if defined(__WATCOMC__) /* this works on my system only */
#if !defined(HAVE_GETOPT_H)
#define HAVE_GETOPT_H
#endif
#if defined(WIN32) || defined(MSDOS)
#if !defined(HAVE_MKTEMP_H)
#define HAVE_MKTEMP_H
#endif
#if !defined(MKTEMP_HEADER)
#define MKTEMP_HEADER <mktemp.h>
#endif
#endif
#if defined(__BORLANDC__) /* Borland declares mktemp() in dir.h */
#if !defined(HAVE_GETOPT_H)
#define HAVE_GETOPT_H
#endif
#if !defined(HAVE_MKTEMP_H)
#define HAVE_MKTEMP_H
#endif
#if !defined(MKTEMP_HEADER)
#define MKTEMP_HEADER <dir.h>
#endif
#endif
#if defined(__SC__) /* Digital Mars declares mktemp() in <io.h> */
#if !defined(HAVE_GETOPT_H)
#define HAVE_GETOPT_H
#endif
#endif
#if defined(__LCC__) /* LCC-Win32 compiler declares mktemp() in io.h */
#if !defined(HAVE_GETOPT_H)
#define HAVE_GETOPT_H
#endif
#endif
#if defined(_MSC_VER) /* Visual C++ declares mktemp() in <io.h> */
/* which is already included for other reasons. */
#if !defined(HAVE_GETOPT_H)
#define HAVE_GETOPT_H
#endif
#endif
#if defined(__DJGPP__) || defined(__GO32__)
#define HAVE_UNISTD_H /* djgpp has unistd.h which also defines getopt() */
#endif
#if defined(__MINGW32__)
#define HAVE_GETOPT_H
#endif
......@@ -203,20 +159,9 @@ extern "C" {
#endif
#endif
/* if you are using a Unix-type system that has the function mkstemp() */
/* define HAVE_MKSTEMP here. If not, just leave it undefined; */
/* mktemp() will be used instead. */
#if defined(LINUX)
#define HAVE_MKSTEMP
#endif
/* Borland, Digital Mars, LCC-Win32, Microsoft's compiler have */
/* S_IREAD and S_IWRITE in their sys/stat.h instead of S_IRUSR */
/* and S_IWUSR which are used by the Unix and Watcom compilers. */
/* Borland's 4.52 compiler however defines these in its 32 bit */
/* compiler. Since I can't be sure which versions have already */
/* defined these, I define it for all Borland 32 bit targets. */
#if defined(_MSC_VER) || defined(__SC__) || defined(__LCC__) || (defined(__BORLANDC__) && !defined(__FLAT__))
/* Microsoft's compiler havs S_IREAD and S_IWRITE in its sys/stat.h */
/* but not S_IRUSR and S_IWUSR which I use. */
#if defined(_MSC_VER)
#define S_IRUSR S_IREAD
#define S_IWUSR S_IWRITE
#endif
......@@ -245,18 +190,6 @@ extern "C" {
/* End of block that is relevant for Unix-type systems only */
/* djgpp does not have _splitpath() and _makepath(), but they do have */
/* functional equivalents which are declared in <dir.h> */
#if defined(__DJGPP__) || defined(__GO32__)
#define _splitpath fnsplit
#define _makepath fnmerge
#endif
/* Later versions of LCC-Win32 no longer declares utime() */
#if defined(__LCC__)
#define utime(a,b) _utime(a,b)
#endif
#if defined(__cplusplus)
}
#endif
......
/*
emsg.c Initialisation functions.
Copyright (c) 2005 by Christopher Heng. All rights reserved.
emsg.c Error message printing functions.
Copyright (c) 2005-2012 by Christopher Heng. All rights reserved.
$Id: emsg.c,v 1.3 2005/03/14 14:18:40 chris Exp $
*/
/* this should always be first */
......
/*
emsg.h Error messages.
Copyright (c) 1996-2003 by Christopher Heng. All rights reserved.
$Id: emsg.h,v 1.4 2005/03/14 14:18:40 chris Exp $
Copyright (c) 1996-2012 by Christopher Heng. All rights reserved.
*/
#if !defined(EMSG_H_INCLUDED)
......@@ -16,29 +14,29 @@ extern "C" {
#define EMSG_BAKFILENAME "File cannot have a .bak extension "\
"when used with -b flag.\n"
#define EMSG_CONVERT "File read/write error while "\
"converting %s.\n"
"converting \"%s\".\n"
#define EMSG_INTERNAL "Internal error: %s.\n"
#define EMSG_NOFILENAME "Need to specify filename or redirect "\
"stdin.\n"
#define EMSG_NOMEM "Insufficient memory to run program.\n"
#define EMSG_NOTEMPNAME "Unable to create temporary file for converting %s.\n"
#define EMSG_OPENFILE "Unable to open file %s.\n"
#define EMSG_NOTEMPNAME "Unable to generate temporary filename for converting \"%s\".\n"
#define EMSG_OPENFILE "Unable to open file \"%s\".\n"
#define EMSG_SIGNAL "Terminated by user.\n"
#define EMSG_WRONGDOSVER "Requires DOS 3.1 and above.\n"
#define EMSG_ACCESSFILE "Unable to access file %s.\n"
#define EMSG_NOTREADABLE "No read permission for %s.\n"
#define EMSG_NOTWRITEABLE "No write permission for %s. Use -f to force conversion.\n"
#define EMSG_CHOWN "Unable to change ownership of %s.\n"
#define EMSG_SYMLINK "Unable to dereference symbolic link %s.\n"
#define EMSG_CREATETEMP "Unable to create temporary file %s for converting %s.\n"
#define EMSG_ERRORLOG "%s: Unable to create error log file %s. Defaulting to stderr.\n" /* special case with progname */
#define EMSG_ACCESSFILE "Unable to access file \"%s\".\n"
#define EMSG_NOTREADABLE "No read permission for \"%s\".\n"
#define EMSG_NOTWRITEABLE "No write permission for \"%s\". Use -f to force conversion.\n"
#define EMSG_CHOWN "Unable to change ownership of \"%s\".\n"
#define EMSG_SYMLINK "Unable to dereference symbolic link \"%s\".\n"
#define EMSG_CREATETEMP "Unable to create temporary file \"%s\" for converting \"%s\".\n"
#define EMSG_ERRORLOG "%s: Unable to create error log file \"%s\". Defaulting to stderr.\n" /* special case with progname */
/* internal error macros */
#define EINTNL_DIRECTION "unknown direction"
/* verbose messages */
#define VERBOSE_CONVERTING "Converting %s\n"
#define VERBOSE_SYMLINKSRC "%s resolves to %s\n"
#define VERBOSE_CONVERTING "Converting \"%s\"\n"
#define VERBOSE_SYMLINKSRC "\"%s\" resolves to \"%s\"\n"
/* function declarations */
extern void emsg ( char * message, ... );
......
.TH tofrodos 1 "Version 1.7.9" "2011"
.TH tofrodos 1 "Version 1.7.12" "2012"
.SH NAME
tofrodos
\- Converts text files between DOS and Unix formats.
......@@ -38,14 +38,14 @@ linefeeds to carriage return pairs. The default is to convert linefeeds
only if they are not already preceded by a carriage return.
.TP
.BI \-b
Make a backup of original file. The original
file is renamed with the original filename and a
Make a backup of original file. The original file with a
.I .bak
extension. For example, a file called "filename.ext" becomes "filename.ext.bak".
extension appended to the original filename, silently replacing any existing file of that name.
For example, a file called "filename.ext" becomes "filename.ext.bak" replacing any existing file
having the name "filename.ext.bak".
Important: the program behaves differently if it is compiled for DOS (as compared to being compiled for Windows, Linux,
Mac OS X or other systems). In view of the filename restrictions present on DOS, the DOS executable
will strip the original file extension, if any, from the file
before appending the
will strip the original file extension, if any, from the file before appending the
.I .bak
extension. For example, "filename.ext" becomes "filename.bak".
.TP
......@@ -95,10 +95,11 @@ command line option error will be issued to stderr instead and not logged.
Overwrite the original file (no backup). This is the default.
.TP
.BI \-p
Preserve file ownership and time. On systems like Linux, the file
ownership will only be preserved if the user is root, otherwise it
Preserve file ownership and time on Unix-type systems (like Linux). On Windows and MSDOS, it only
preserves the file time. Note that on many Unix-type systems, including Linux, the file
ownership will only be preserved if the program is run as root, otherwise it
will just set the file time and silently fail the change of file
ownership. If you want a warning message when the file ownership
ownership. On such systems, if you want a warning message when the file ownership
cannot be changed, use \-v.
.TP
.BI \-u
......@@ -111,8 +112,15 @@ Verbose.
.TP
.BI \-V
Show version message and quit.
.SH EXIT CODE
Tofrodos terminates with an exit code of 0 on success and 1 on error.
.PP
If the program is invoked with multiple files on the command line, the default behaviour is to skip to the next
file in the list if an error is encountered with any file. In such a case, the exit code returned will the