Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jun 2020 10:54:25 +0000 (UTC)
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r538386 - in head/devel/gmake: . files
Message-ID:  <202006101054.05AAsP2j084395@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tijl
Date: Wed Jun 10 10:54:24 2020
New Revision: 538386
URL: https://svnweb.freebsd.org/changeset/ports/538386

Log:
  Fix broken patch (missing @) by using the upstream version now that it's
  available.
  
  PR:		246615
  Reported by:	jkim
  Obtained from:	https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commit;h=6e6abd0cdfe4bb96f6412aebc511f10bf254a820

Added:
  head/devel/gmake/files/patch-10-6e6abd0c
     - copied, changed from r538385, head/devel/gmake/files/patch-10-4c1009ec
Deleted:
  head/devel/gmake/files/patch-10-4c1009ec
Modified:
  head/devel/gmake/Makefile

Modified: head/devel/gmake/Makefile
==============================================================================
--- head/devel/gmake/Makefile	Wed Jun 10 10:37:48 2020	(r538385)
+++ head/devel/gmake/Makefile	Wed Jun 10 10:54:24 2020	(r538386)
@@ -3,7 +3,7 @@
 
 PORTNAME=	gmake
 PORTVERSION=	4.3
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	devel
 MASTER_SITES=	GNU/make
 DISTNAME=	make-${PORTVERSION}

Copied and modified: head/devel/gmake/files/patch-10-6e6abd0c (from r538385, head/devel/gmake/files/patch-10-4c1009ec)
==============================================================================
--- head/devel/gmake/files/patch-10-4c1009ec	Wed Jun 10 10:37:48 2020	(r538385, copy source)
+++ head/devel/gmake/files/patch-10-6e6abd0c	Wed Jun 10 10:54:24 2020	(r538386)
@@ -1,8 +1,22 @@
-Backport of gnulib git commit 4c1009ec93e12ee34acd27f6d7e25442bedc16f2.
+From: Bruno Haible <bruno@clisp.org>
+Date: Sat, 23 May 2020 10:19:34 +0000 (+0200)
+Subject: findprog-in: Ignore directories.
+X-Git-Url: https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff_plain;h=6e6abd0cdfe4bb96f6412aebc511f10bf254a820
 
-When the file found in a PATH element is a directory, continue searching.
+findprog-in: Ignore directories.
 
---- lib/findprog-in.c.orig	2020-01-19 20:34:01 UTC
+Reported by Frederick Eaton via Dmitry Goncharov in
+<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00003.html>.
+
+* lib/findprog-in.c (find_in_given_path): When the file found is a
+directory, set errno to EACCES and, during a PATH search, continue
+searching.
+* modules/findprog-in (Depends-on): Add sys_stat, stat.
+---
+
+diff --git a/lib/findprog-in.c b/lib/findprog-in.c
+index c254f2f..0f76e36 100644
+--- lib/findprog-in.c
 +++ lib/findprog-in.c
 @@ -26,6 +26,7 @@
  #include <stdlib.h>
@@ -12,21 +26,102 @@ When the file found in a PATH element is a directory, 
  
  #include "filename.h"
  #include "concat-filename.h"
-@@ -190,6 +191,7 @@ find_in_given_path (const char *progname, const char *
-           dir = ".";
+@@ -58,8 +59,8 @@ static const char * const suffixes[] =
+     /* Note: The cmd.exe program does a different lookup: It searches according
+        to the PATHEXT environment variable.
+        See <https://stackoverflow.com/questions/7839150/>.
+-       Also, it executes files ending .bat and .cmd directly without letting the
+-       kernel interpret the program file.  */
++       Also, it executes files ending in .bat and .cmd directly without letting
++       the kernel interpret the program file.  */
+     #elif defined __CYGWIN__
+     "", ".exe", ".com"
+     #elif defined __EMX__
+@@ -136,14 +137,26 @@ find_in_given_path (const char *progname, const char *path,
+                        call access() despite its design flaw.  */
+                     if (eaccess (progpathname, X_OK) == 0)
+                       {
+-                        /* Found!  */
+-                        if (strcmp (progpathname, progname) == 0)
++                        /* Check that the progpathname does not point to a
++                           directory.  */
++                        struct stat statbuf;
++
++                        if (stat (progpathname, &statbuf) >= 0)
+                           {
+-                            free (progpathname);
+-                            return progname;
++                            if (! S_ISDIR (statbuf.st_mode))
++                              {
++                                /* Found!  */
++                                if (strcmp (progpathname, progname) == 0)
++                                  {
++                                    free (progpathname);
++                                    return progname;
++                                  }
++                                else
++                                  return progpathname;
++                              }
++
++                            errno = EACCES;
+                           }
+-                        else
+-                          return progpathname;
+                       }
  
-         /* Try all platform-dependent suffixes.  */
-+        struct stat st;
-         for (i = 0; i < sizeof (suffixes) / sizeof (suffixes[0]); i++)
-           {
-             const char *suffix = suffixes[i];
-@ -208,7 +210,8 @@ find_in_given_path (const char *progname, const char *
-                    use it.  On other systems, let's hope that this program
-                    is not installed setuid or setgid, so that it is ok to
+                     if (errno != ENOENT)
+@@ -210,25 +223,37 @@ find_in_given_path (const char *progname, const char *path,
                     call access() despite its design flaw.  */
--                if (eaccess (progpathname, X_OK) == 0)
-+                if (eaccess (progpathname, X_OK) == 0 &&
-+                        stat(progpathname, &st) == 0 && ! S_ISDIR(st.st_mode))
+                 if (eaccess (progpathname, X_OK) == 0)
                    {
-                     /* Found!  */
-                     if (strcmp (progpathname, progname) == 0)
+-                    /* Found!  */
+-                    if (strcmp (progpathname, progname) == 0)
++                    /* Check that the progpathname does not point to a
++                       directory.  */
++                    struct stat statbuf;
++
++                    if (stat (progpathname, &statbuf) >= 0)
+                       {
+-                        free (progpathname);
+-
+-                        /* Add the "./" prefix for real, that
+-                           xconcatenated_filename() optimized away.  This
+-                           avoids a second PATH search when the caller uses
+-                           execl/execv/execlp/execvp.  */
+-                        progpathname =
+-                          XNMALLOC (2 + strlen (progname) + 1, char);
+-                        progpathname[0] = '.';
+-                        progpathname[1] = NATIVE_SLASH;
+-                        memcpy (progpathname + 2, progname,
+-                                strlen (progname) + 1);
+-                      }
++                        if (! S_ISDIR (statbuf.st_mode))
++                          {
++                            /* Found!  */
++                            if (strcmp (progpathname, progname) == 0)
++                              {
++                                free (progpathname);
++
++                                /* Add the "./" prefix for real, that
++                                   xconcatenated_filename() optimized away.
++                                   This avoids a second PATH search when the
++                                   caller uses execl/execv/execlp/execvp.  */
++                                progpathname =
++                                  XNMALLOC (2 + strlen (progname) + 1, char);
++                                progpathname[0] = '.';
++                                progpathname[1] = NATIVE_SLASH;
++                                memcpy (progpathname + 2, progname,
++                                        strlen (progname) + 1);
++                              }
++
++                            free (path_copy);
++                            return progpathname;
++                          }
+ 
+-                    free (path_copy);
+-                    return progpathname;
++                        errno = EACCES;
++                      }
+                   }
+ 
+                 if (errno != ENOENT)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006101054.05AAsP2j084395>