pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/cwrappers cwrappers-20150314: Drop trailing /...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6b555c3127d6
branches:  trunk
changeset: 648599:6b555c3127d6
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sun Mar 15 19:16:45 2015 +0000

description:
cwrappers-20150314: Drop trailing / when searching for path names.
If a pattern ends in a slash, consider it as exact match.

diffstat:

 pkgtools/cwrappers/Makefile                         |   4 ++--
 pkgtools/cwrappers/files/bin/generic-transform-cc.c |  12 +++++++++++-
 pkgtools/cwrappers/files/doc/generic-transform.txt  |  14 ++++++++------
 3 files changed, 21 insertions(+), 9 deletions(-)

diffs (67 lines):

diff -r fc56a841bd1a -r 6b555c3127d6 pkgtools/cwrappers/Makefile
--- a/pkgtools/cwrappers/Makefile       Sun Mar 15 19:11:21 2015 +0000
+++ b/pkgtools/cwrappers/Makefile       Sun Mar 15 19:16:45 2015 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.6 2014/11/29 22:19:55 joerg Exp $
+# $NetBSD: Makefile,v 1.7 2015/03/15 19:16:45 joerg Exp $
 
-PKGNAME=               cwrappers-20141129
+PKGNAME=               cwrappers-20150314
 CATEGORIES=            pkgtools sysutils
 
 MAINTAINER=            joerg%NetBSD.org@localhost
diff -r fc56a841bd1a -r 6b555c3127d6 pkgtools/cwrappers/files/bin/generic-transform-cc.c
--- a/pkgtools/cwrappers/files/bin/generic-transform-cc.c       Sun Mar 15 19:11:21 2015 +0000
+++ b/pkgtools/cwrappers/files/bin/generic-transform-cc.c       Sun Mar 15 19:16:45 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: generic-transform-cc.c,v 1.1 2014/09/17 12:40:56 joerg Exp $ */
+/* $NetBSD: generic-transform-cc.c,v 1.2 2015/03/15 19:16:45 joerg Exp $ */
 
 /*-
  * Copyright (c) 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -424,7 +424,17 @@
                if (*path != '/')
                        continue;
 
+               while (len > 1 && path[len - 1] == '/')
+                       --len;
+
                TAILQ_FOREACH(rule, ruleset, link) {
+                       if (rule->src[rule->src_len - 1] == '/') {
+                               if (rule->src_len - 1 != len)
+                                       continue;
+                               if (memcmp(path, rule->src, len) != 0)
+                                       continue;
+                               break;
+                       }
                        if (rule->src_len > len)
                                continue;
                        if (path[rule->src_len] != '\0' &&
diff -r fc56a841bd1a -r 6b555c3127d6 pkgtools/cwrappers/files/doc/generic-transform.txt
--- a/pkgtools/cwrappers/files/doc/generic-transform.txt        Sun Mar 15 19:11:21 2015 +0000
+++ b/pkgtools/cwrappers/files/doc/generic-transform.txt        Sun Mar 15 19:16:45 2015 +0000
@@ -1,4 +1,4 @@
-$NetBSD: generic-transform.txt,v 1.1 2014/09/17 12:40:56 joerg Exp $
+$NetBSD: generic-transform.txt,v 1.2 2015/03/15 19:16:45 joerg Exp $
 
 The third phase of the wrapper processing is the general transformation
 phase.  This phase is the core of the wrapper framework and implements
@@ -16,11 +16,13 @@
 3. For the remaining -I, -Wl,-rpath and -L options a corresponding
 transform rule (transform=I:src:dst, transform=R:src:dst,
 transform=L:src:dst) rule is searched for, so that the path is equal to
-or below src.  If this is a -Wl,-rpath option and the path ends in /.libs,
-it is assume be to handled by libtool internally and implicitly allowed.
-If no such rule is found or dst is empty, the argument is dropped.  
-Otherwise the src part of the path name is replaced with dst. 
-No further transformation is done for this argument in this phase.
+or below src.  Trailing '/' are ignored for this search.  If src ends
+with a '/', path must be equal to src.  If this is a -Wl,-rpath option
+and the path ends in /.libs, it is assume be to handled by libtool
+internally and implicitly allowed.  If no such rule is found or dst is
+empty, the argument is dropped.  Otherwise the src part of the path name
+is replaced with dst.  No further transformation is done for this
+argument in this phase.
 
 4. libtool/shlibtool wrapper only:
 For -l options search for the matching libtool archive, e.g. for -ldst



Home | Main Index | Thread Index | Old Index