pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/pkg_install/files



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Wed Oct 30 16:03:38 UTC 2024

Modified Files:
        pkgsrc/pkgtools/pkg_install/files/add: perform.c
        pkgsrc/pkgtools/pkg_install/files/lib: version.h

Log Message:
pkg_install: Update to 20241030.

Fix the REQUIRES check to also work in destdir (pkg_add -P) mode.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 pkgsrc/pkgtools/pkg_install/files/add/perform.c
cvs rdiff -u -r1.196 -r1.197 pkgsrc/pkgtools/pkg_install/files/lib/version.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/pkg_install/files/add/perform.c
diff -u pkgsrc/pkgtools/pkg_install/files/add/perform.c:1.124 pkgsrc/pkgtools/pkg_install/files/add/perform.c:1.125
--- pkgsrc/pkgtools/pkg_install/files/add/perform.c:1.124       Mon Aug 26 22:37:19 2024
+++ pkgsrc/pkgtools/pkg_install/files/add/perform.c     Wed Oct 30 16:03:38 2024
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.124 2024/08/26 22:37:19 wiz Exp $        */
+/*     $NetBSD: perform.c,v 1.125 2024/10/30 16:03:38 jperkin Exp $    */
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -6,7 +6,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: perform.c,v 1.124 2024/08/26 22:37:19 wiz Exp $");
+__RCSID("$NetBSD: perform.c,v 1.125 2024/10/30 16:03:38 jperkin Exp $");
 
 /*-
  * Copyright (c) 2003 Grant Beattie <grant%NetBSD.org@localhost>
@@ -1132,18 +1132,33 @@ check_requires(struct pkg_task *pkg)
                        next_line = eol + 1;
 
                if (strncmp(data, "REQUIRES=", 9) == 0) {
-                       char *library_name = dup_value(data, eol);
                        struct stat sb;
-                       if (stat(library_name, &sb) != 0 || !S_ISREG(sb.st_mode)) {
-                               warnx("Missing required library: %s", library_name);
+                       int found = 0;
+                       char *libpath = dup_value(data, eol);
+                       /*
+                        * Search both the original path as well as inside
+                        * Destdir if enabled, as files may exist in either
+                        * (e.g. system libraries outside, pkgsrc inside).
+                        */
+                       if (stat(libpath, &sb) == 0 && S_ISREG(sb.st_mode)) {
+                               found = 1;
+                       } else if (Destdir != NULL) {
+                               char *p = xasprintf("%s/%s", Destdir, libpath);
+                               if (stat(p, &sb) == 0 && S_ISREG(sb.st_mode))
+                                       found = 1;
+                               free(p);
+                       }
+
+                       if (!found) {
+                               warnx("Missing required library: %s", libpath);
 #ifdef __NetBSD__
-                               if (strncmp(library_name, "/usr/X11R7", 10) == 0) {
+                               if (strncmp(libpath, "/usr/X11R7", 10) == 0) {
                                        warnx("Please make sure to install the X sets");
                                }
 #endif
                                ret = 1;
                        }
-                       free(library_name);
+                       free(libpath);
                }
        }
 

Index: pkgsrc/pkgtools/pkg_install/files/lib/version.h
diff -u pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.196 pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.197
--- pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.196       Fri Oct 25 07:04:09 2024
+++ pkgsrc/pkgtools/pkg_install/files/lib/version.h     Wed Oct 30 16:03:38 2024
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.196 2024/10/25 07:04:09 ryoon Exp $      */
+/*     $NetBSD: version.h,v 1.197 2024/10/30 16:03:38 jperkin Exp $    */
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -27,6 +27,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION 20241025
+#define PKGTOOLS_VERSION 20241030
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index