bug-coreutils
[Top][All Lists]
Advanced

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

more 5.3.0 issues on cygwin


From: Eric Blake
Subject: more 5.3.0 issues on cygwin
Date: Mon, 17 Jan 2005 06:12:57 -0700
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

First, a ping on
http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00063.html,
regarding non-portable group names (I have a cygwin box with the primary
group name of "Domain Users", which breaks the assumptions of
tests/group-names that group names are space-separated).

Next, another $(EXEEXT) bug was still floating around, this time in
tests/Makefile.am, breaking the tests/help-version script.  I think it
would be easier to make the all_programs.list target of src/Makefile strip
$(EXEEXT) rather than forcing all callers (currently man/Makefile and
tests/Makefile) to do so, hence the attached patch.  This also stops
listing programs twice in the output, when they appear in both
EXTRA_PROGRAMS and in OPTIONAL_BIN_PROGRAMS or DF_PROG.

Finally, here are some trivial changes that have been part of the cygwin
release.  There are other changes in the cygwin install, but they are not
trivial (for example, making cp, mv, and ln smart enough to auto-append
.exe to the target if it was implied from the source name, since cygwin's
stat() on `progname' is designed to work even if the file is really named
`progname.exe').

2005-01-17  Eric Blake  <address@hidden>  (tiny change)

        * src/Makefile.am (all_programs.list): Strip $(EXEEXT) and remove
        duplicates.
        * man/Makefile.am (all_programs): Revert previous patch; updated
        all_programs.list fixes this.
        (.x.1): No need to add $(EXEEXT).

2005-01-03  Corinna Vinschen  <address@hidden>  (tiny change)

        * src/install.c (strip): Check for .exe here since strip doesn't.
        * src/system.h: Use S_BLKSIZE value for ST_NBLOCKSIZE where
        available.
        * src/od.c (OPENMODE): New macro.
        (open_next_file): Use OPENMODE in fopen call.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB67nY84KuGfSFAYARAuL1AKCaEDY9WJC64Bs8zm6fYDK76yL+NACggo2D
SCGG2xDjXdlK7+fNNSrqHBw=
=mgTZ
-----END PGP SIGNATURE-----
Index: man/Makefile.am
===================================================================
RCS file: /cvsroot/coreutils/coreutils/man/Makefile.am,v
retrieving revision 1.36
diff -u -p -r1.36 Makefile.am
--- man/Makefile.am     11 Jan 2005 16:51:03 -0000      1.36
+++ man/Makefile.am     17 Jan 2005 13:09:06 -0000
@@ -128,10 +128,10 @@ mapped_name = `echo $*|sed 's/install/gi
        @rm -f $@
        @echo "Updating man page $@";           \
        mkdir $t;                               \
-       (cd $t && $(LN_S) ../../src/$(mapped_name)$(EXEEXT) $*$(EXEEXT)); \
+       (cd $t && $(LN_S) ../../src/$(mapped_name) $*); \
        $(PERL) -- $(srcdir)/help2man           \
            --include=$(srcdir)/$*.x            \
-           --output=$@ $t/$*$(EXEEXT)
+           --output=$@ $t/$*
        @chmod a-w $@
        @rm -rf $t
 
@@ -155,7 +155,7 @@ check-x-vs-1:
 
 all_programs =                                                         \
       (cd ../src && MAKEFLAGS= $(MAKE) -s all_programs.list)           \
-       | sed -e 's,$(EXEEXT)$$,,' | grep -v '\['
+       | grep -v '\['
 
 .PHONY: check-programs-vs-x
 check-programs-vs-x:
Index: src/Makefile.am
===================================================================
RCS file: /cvsroot/coreutils/coreutils/src/Makefile.am,v
retrieving revision 1.48
diff -u -p -r1.48 Makefile.am
--- src/Makefile.am     11 Jan 2005 16:50:27 -0000      1.48
+++ src/Makefile.am     17 Jan 2005 13:09:06 -0000
@@ -228,7 +228,8 @@ all_programs = \
   $(EXTRA_PROGRAMS)
 
 all_programs.list:
-       @echo $(all_programs) | tr ' ' '\n' | $(ASSORT)
+       @echo $(all_programs) | tr ' ' '\n' | sed -e 's,$(EXEEXT)$$,,' \
+         | $(ASSORT) -u
 
 pm = progs-makefile
 pr = progs-readme
Index: src/system.h
===================================================================
RCS file: /cvsroot/coreutils/coreutils/src/system.h,v
retrieving revision 1.98
diff -u -p -r1.98 system.h
--- src/system.h        3 Jan 2005 23:43:39 -0000       1.98
+++ src/system.h        17 Jan 2005 13:09:06 -0000
@@ -337,7 +337,11 @@ initialize_exit_failure (int status)
 #endif
 
 #ifndef ST_NBLOCKSIZE
-# define ST_NBLOCKSIZE 512
+# ifdef S_BLKSIZE
+#  define ST_NBLOCKSIZE S_BLKSIZE
+# else
+#  define ST_NBLOCKSIZE 512
+# endif
 #endif
 
 /* Redirection and wildcarding when done by the utility itself.
Index: src/install.c
===================================================================
RCS file: /cvsroot/coreutils/coreutils/src/install.c,v
retrieving revision 1.172
diff -u -p -r1.172 install.c
--- src/install.c       26 Nov 2004 07:39:32 -0000      1.172
+++ src/install.c       17 Jan 2005 13:09:07 -0000
@@ -566,6 +566,20 @@ strip (const char *path)
       error (EXIT_FAILURE, errno, _("fork system call failed"));
       break;
     case 0:                    /* Child. */
+#ifdef __CYGWIN__
+      {
+       /* Unfortunately we have to check for .exe here since strip doesn't. */
+       char *p;
+       if ((p = strchr (path, '\0') - 4) <= path
+           || strcasecmp (p, ".exe") != 0)
+         {
+           p = alloca (strlen (path) + 5);
+           strcat (strcpy (p, path), ".exe");
+           if (!access (p, F_OK))
+             path = p;
+         }
+      }
+#endif
       execlp ("strip", "strip", path, NULL);
       error (EXIT_FAILURE, errno, _("cannot run strip"));
       break;
Index: src/od.c
===================================================================
RCS file: /cvsroot/coreutils/coreutils/src/od.c,v
retrieving revision 1.152
diff -u -p -r1.152 od.c
--- src/od.c    28 Sep 2004 01:09:03 -0000      1.152
+++ src/od.c    17 Jan 2005 13:09:07 -0000
@@ -70,6 +70,12 @@ typedef unsigned long long int ulonglong
 typedef unsigned long int ulonglong_t;
 #endif
 
+#ifdef O_BINARY
+# define OPENMODE "rb"
+#else
+# define OPENMODE "r"
+#endif
+
 enum size_spec
   {
     NO_SIZE,
@@ -906,7 +912,7 @@ open_next_file (void)
        }
       else
        {
-         in_stream = fopen (input_filename, "r");
+         in_stream = fopen (input_filename, OPENMODE);
          if (in_stream == NULL)
            {
              error (0, errno, "%s", input_filename);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]