Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package makedepend for openSUSE:Factory 
checked in at 2022-12-15 19:23:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/makedepend (Old)
 and      /work/SRC/openSUSE:Factory/.makedepend.new.1835 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "makedepend"

Thu Dec 15 19:23:32 2022 rev:11 rq:1042621 version:1.0.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/makedepend/makedepend.changes    2022-11-09 
12:56:00.635865959 +0100
+++ /work/SRC/openSUSE:Factory/.makedepend.new.1835/makedepend.changes  
2022-12-15 19:23:36.407510652 +0100
@@ -1,0 +2,6 @@
+Tue Dec  6 11:04:15 UTC 2022 - Stefan Dirsch <sndir...@suse.com>
+
+- issue2-mr7.patch
+  * Bug #2: fix regression introduced by fix for bug #1 
+
+-------------------------------------------------------------------

New:
----
  issue2-mr7.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ makedepend.spec ++++++
--- /var/tmp/diff_new_pack.NWmlrZ/_old  2022-12-15 19:23:36.803512905 +0100
+++ /var/tmp/diff_new_pack.NWmlrZ/_new  2022-12-15 19:23:36.807512928 +0100
@@ -24,6 +24,7 @@
 Group:          Development/Tools/Building
 URL:            http://xorg.freedesktop.org/
 Source0:        
http://xorg.freedesktop.org/releases/individual/util/%{name}-%{version}.tar.xz
+Patch0:         issue2-mr7.patch
 BuildRequires:  pkg-config
 BuildRequires:  pkgconfig(xproto) >= 7.0.17
 # This was part of the xorg-x11-util-devel package up to version 7.6
@@ -41,6 +42,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %configure

++++++ issue2-mr7.patch ++++++
>From 654f6355d501153fe1fbdbc073cb72fd6355e194 Mon Sep 17 00:00:00 2001
From: Alan Coopersmith <alan.coopersm...@oracle.com>
Date: Mon, 5 Dec 2022 15:48:17 -0800
Subject: [PATCH] Bug #2: fix regression introduced by fix for bug #1

Refactor code to find the full file path before comparing against
existing items in the list so that we stop adding duplicate entries
for all the files in the system include path and with larger amounts
of code hitting the MAXFILES limit.

Fixes: 3dc64b0 ("Add test case for bug #1 + proposed fix.")
Closes: #2

Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com>
---
 include.c | 101 ++++++++++++++++++++++++++----------------------------
 1 file changed, 49 insertions(+), 52 deletions(-)

diff --git a/include.c b/include.c
index 697e9de..57e2b24 100644
--- a/include.c
+++ b/include.c
@@ -222,60 +222,17 @@ inc_clean (void)
        }
 }
 
-struct inclist *
-inc_path(const char *file, const char *include, int type)
+/*
+ * Return full path for the "include" file of the given "type",
+ * which may be found relative to the source file "file".
+ */
+static const char *
+find_full_inc_path(const char *file, const char *include, int type)
 {
        static char             path[ BUFSIZ ];
        register const char     **pp, *p;
-       register struct inclist *ip;
        struct stat             st;
 
-       /*
-        * Check all previously found include files for a path that
-        * has already been expanded.
-        */
-       if ((type == INCLUDE) || (type == INCLUDEDOT))
-               inclistnext = inclist;
-       ip = inclistnext;
-
-       for (; ip->i_file; ip++) {
-               if ((strcmp(ip->i_incstring, include) == 0) &&
-                   !(ip->i_flags & INCLUDED_SYM)) {
-                       /*
-                        * Same filename but same file ?
-                        */
-                       char r_include[PATHMAX+1];
-                       char r_saved_path[PATHMAX+1];
-                       char* ptr;
-                       ptr = realpath(include, r_include);
-                       ptr = realpath(ip->i_file, r_saved_path);
-                       if (!strcmp(r_include, r_saved_path)) {
-                               inclistnext = ip + 1;
-                               return ip;
-                       }
-
-                       /*
-                        * Check if we have a header in the same dir
-                        */
-                       for (p=file+strlen(file); p>file; p--)
-                               if (*p == '/')
-                                       break;
-                       if (p == file) {
-                               strcpy(path, include);
-                       } else {
-                               strncpy(path, file, (p-file) + 1);
-                               path[ (p-file) + 1 ] = '\0';
-                               strcpy(path + (p-file) + 1, include);
-                       }
-                       remove_dotdot(path);
-                       ptr = realpath(path, r_include);
-                       if (!strcmp(r_include, r_saved_path)) {
-                               inclistnext = ip + 1;
-                               return ip;
-                       }
-               }
-       }
-
        if (inclistnext == inclist) {
                /*
                 * If the path was surrounded by "" or is an absolute path,
@@ -285,7 +242,7 @@ inc_path(const char *file, const char *include, int type)
                    (type == INCLUDENEXTDOT) ||
                    (*include == '/')) {
                        if (stat(include, &st) == 0 && !S_ISDIR(st.st_mode))
-                               return newinclude(include, include);
+                               return include;
                        if (show_where_not)
                                warning1("\tnot in %s\n", include);
                }
@@ -307,7 +264,7 @@ inc_path(const char *file, const char *include, int type)
                        }
                        remove_dotdot(path);
                        if (stat(path, &st) == 0 && !S_ISDIR(st.st_mode))
-                               return newinclude(path, include);
+                               return path;
                        if (show_where_not)
                                warning1("\tnot in %s\n", path);
                }
@@ -326,7 +283,7 @@ inc_path(const char *file, const char *include, int type)
                remove_dotdot(path);
                if (stat(path, &st) == 0 && !S_ISDIR(st.st_mode)) {
                        includedirsnext = pp + 1;
-                       return newinclude(path, include);
+                       return path;
                }
                if (show_where_not)
                        warning1("\tnot in %s\n", path);
@@ -334,3 +291,43 @@ inc_path(const char *file, const char *include, int type)
 
        return NULL;
 }
+
+struct inclist *
+inc_path(const char *file, const char *include, int type)
+{
+       const char      *fp;
+       struct inclist  *ip;
+       char r_include[PATHMAX+1];
+
+       /*
+        * Check all previously found include files for a path that
+        * has already been expanded.
+        */
+       if ((type == INCLUDE) || (type == INCLUDEDOT))
+               inclistnext = inclist;
+       ip = inclistnext;
+
+       fp = find_full_inc_path(file, include, type);
+       if (fp == NULL)
+               return NULL;
+       if (realpath(fp, r_include) == NULL)
+               return NULL;
+
+       for (; ip->i_file; ip++) {
+               if ((strcmp(ip->i_incstring, include) == 0) &&
+                   !(ip->i_flags & INCLUDED_SYM)) {
+                       /*
+                        * Same filename but same file ?
+                        */
+                       char r_saved_path[PATHMAX+1];
+                       if (realpath(ip->i_file, r_saved_path) == NULL)
+                               continue;
+                       if (!strcmp(r_include, r_saved_path)) {
+                               inclistnext = ip + 1;
+                               return ip;
+                       }
+               }
+       }
+
+       return newinclude(fp, include);
+}
-- 
GitLab

Reply via email to