Message-ID: <39A3A41B.6EBAFD04@softhome.net> Date: Wed, 23 Aug 2000 12:14:51 +0200 From: Laurynas Biveinis X-Mailer: Mozilla 4.74 [en] (Win98; U) X-Accept-Language: lt,en MIME-Version: 1.0 To: DJGPP Workers Subject: Patch for fileutils to support symlinks Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com It is by no means complete, and somebody who knows sed should patch djgpp/config.sed to DTRT with makefiles, which are patched manually in this patch. Laurynas diff -urp filutil3.16/src/Makefile filutil3.16.my/src/Makefile --- filutil3.16/src/Makefile Fri May 26 20:40:58 2000 +++ filutil3.16.my/src/Makefile Wed Aug 23 12:02:34 2000 @@ -388,13 +388,11 @@ $(dir_OBJECTS): ../config.h dir: $(dir_OBJECTS) $(dir_DEPENDENCIES) ln $(LINK) $(dir_LDFLAGS) $(dir_OBJECTS) $(dir_LDADD) $(LIBS) ./ln -s $@ d - stubedit d.exe argv0=dir $(vdir_OBJECTS): ../config.h vdir: $(vdir_OBJECTS) $(vdir_DEPENDENCIES) ln $(LINK) $(vdir_LDFLAGS) $(vdir_OBJECTS) $(vdir_LDADD) $(LIBS) ./ln -s $@ v - stubedit v.exe argv0=vdir $(ls_OBJECTS): ../config.h ls: $(ls_OBJECTS) $(ls_DEPENDENCIES) @@ -404,7 +402,6 @@ $(mkdir_OBJECTS): ../config.h mkdir: $(mkdir_OBJECTS) $(mkdir_DEPENDENCIES) ln $(LINK) $(mkdir_LDFLAGS) $(mkdir_OBJECTS) $(mkdir_LDADD) $(LIBS) ./ln -s $@ gmkdir - stubedit gmkdir.exe argv0=mkdir $(mkfifo_OBJECTS): ../config.h mkfifo: $(mkfifo_OBJECTS) $(mkfifo_DEPENDENCIES) @@ -426,7 +423,6 @@ $(rmdir_OBJECTS): ../config.h rmdir: $(rmdir_OBJECTS) $(rmdir_DEPENDENCIES) ln $(LINK) $(rmdir_LDFLAGS) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS) ./ln -s $@ grmdir - stubedit grmdir.exe argv0=rmdir $(sync_OBJECTS): ../config.h sync: $(sync_OBJECTS) $(sync_DEPENDENCIES) diff -urp filutil3.16/src/djstart.c filutil3.16.my/src/djstart.c --- filutil3.16/src/djstart.c Fri May 26 18:27:10 2000 +++ filutil3.16.my/src/djstart.c Wed Aug 23 12:00:40 2000 @@ -179,11 +179,4 @@ djgpp_fileutils_startup (void) init_file_io (argv0base); } -/* DJGPP doesn't have `lstat', since MS-DOS doesn't - support links. Here's a trivial substitute that will do. */ -int lstat (const char *fname, struct stat *st_buf) -{ - return stat (fname, st_buf); -} - #endif /* __DJGPP__ */ diff -urp filutil3.16/src/ln.c filutil3.16.my/src/ln.c --- filutil3.16/src/ln.c Fri May 26 18:27:10 2000 +++ filutil3.16.my/src/ln.c Wed Aug 23 12:01:50 2000 @@ -30,16 +30,6 @@ #include "backupfile.h" #include "error.h" -#ifdef __DJGPP__ -/* DJGPP doesn't have S_ISLNK defined, because MS-DOS doesn't support links. - However, DJGPP's `link' simulates hard links by copying, and we can - have ``symbolic links'' for DJGPP .EXE programs. Therefore, just - for the purpose of this program, it makes sense to define S_ISLNK - so we could have working `ln'. */ - -#define S_ISLNK(x) (0) /* defined, but no file is a link */ -#endif - int link (); /* Some systems don't declare this anywhere. */ #ifdef S_ISLNK