Mail Archives: djgpp-announce/2010/05/16/19:31:32
This is a port of GNU patch 2.6.1 to MSDOS/DJGPP.
Patch is a program to apply patches to files. It accepts a "patch script",
usually produced by file-comparison utility such as Diff, and produces
modified files by applying this script to old versions of files.
More often than not, Patch is used with text, usually source, files.
But it can also patch binary files, although the patch scripts for binary
files tend to be large.
DJGPP specific changes.
=======================
The port offers the same djgpp specific functionality than the previous
port. These are:
- support for numbered backups even on 8+3 file systems;
- Patch can now ignore the CR characters at the end of each line
of the patch script, so patching Unix-style text files does not
convert them to DOS-style files anymore (if you use the --binary
switch).
To build this port you will need:
- to have an OS with LFN support to configure and compile the source
package. I have no plans to support SFN systems to build the patch
binaries.
- to have libsupp-6.4 or later installed. The library will provide certain
amount of multibyte wrapper functions without them it will not be possible
to compile the sources.
- if you use djdev204 you will have to adjust your /dev/env/DJDIR/include/time.h.
_rdtsc declaration and definition both needs static as qualifier and the
extern qualifier removed from the declaration.
- to run the test suite you will need to install mktmpNNb.zip
As usual, all djgpp specific files (config.bat, diffs, README files, etc.)
are located in the /djgpp subdir.
Please note that there is a /pc/djgpp directory that contains files that are
part of the official FSF patch distribution. I have inspected those files
but I have never used them nor I have plans to change this in the future.
Due to the massive use of gnulib code it is no longer possible to compile the
official FSF distribution out-of-the-box. So I will neither try to use those
files nor to keep them up to date. I will only use my own ones. If someone
else would like to keep those files up to date it will be OK with me.
Please also note that some of the tests of the test suite will fail. This is
not a port issue but a test suite issue. The test suite is very posix centric
so that some test will fail in an environment like DOS/Windows. One of the
tests/preserve-mode-and-time stamp will fail because the unix file attributes
do not match the DOS/Windows file attributes so the fileutils do not return
what the test script expects. Four of the 22 tests/crlf-handling are known
to fail. One of the 5 test in tests/remember-backup-files and one of the 2
tests in tests/remember-reject-files fail. I was not able to figure out what
is going wrong here. If I run every test alone, every test passes, so this
seems to be a test suite issue. Anyway the patch port works for those tested
features as it shall do.
The most notorious change between this patch version and the previous one is
that this one uses a hash table to administrate the names of the files it
wants to modify or create. The hash keys are created using the st_dev and
st_ino values. Especially DJGPP creates the st_ino value using the starting
cluster of the file. This has the consequence that every time the file is
changed by the patch program by appending some new content it gets a new
st_ino. This has the consequence that stat()ing again produces a different
st_ino for the same file and indeed a new hash key that makes it impossible
to find the already existing entry for this file in the hash table. This has
the nasty consequence, that when patch appends something new to this file, it
does not see that the file already exists and instead of appending to it, it
creates a new one at the same location with the same name overwriting the
old one with the new contains. To solve this issue it was necessary to create
unique and persistent inode numbers for every file produced by patch.
Wrapper functions to stat, fstat, open, fopen, close and fclose have been
written that will keep in sync file name, file descriptor and invented inode
number for every file produced by patch. See /pc/pc_inode.c for details
concerning the implementation.
Please note that the FSF distribution of patch no longer can be compiled with
DJGPP out-of-the-box. If something seems not to work with this port, please
report it first at c.o.m.d. and not at bug-patch AT gnu DOT org. The maintainer will
have no idea about what I have done.
For further information about GNU patch please read the info docs and NEWS
file.
The port consists of two packages that can be downloaded from ftp.delorie.com
and mirrors as (time stamp 2010-05-15):
Patch 2.6.1 binary and man format documentation:
ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/pat261b.zip
Patch 2.6.1 source:
ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/pat261s.zip
For the convenience of the WinXP users the binaries has been produced
a second time using the djdev204 beta library. This package is available
at ftp.delorie.com and mirrors as (time stamp 2010-05-15):
Patch 2.6.1 binary and man format documentation:
ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/pat261b.zip
Send Patch specific bug reports to <bug-patch AT gnu DOT org>.
Send suggestions and bug reports concerning the DJGPP port
to comp.os.msdos.djgpp or <djgpp AT delorie DOT com>.
Enjoy.
Guerrero, Juan Manuel <juan DOT guerrero AT gmx DOT de>
- Raw text -