pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/pkgtools/cwrappers/files/bin
Module Name: pkgsrc
Committed By: christos
Date: Sun Nov 7 12:38:13 UTC 2021
Modified Files:
pkgsrc/pkgtools/cwrappers/files/bin: cleanup-cc.c common.h
fixup-libtool.c generic-transform-cc.c normalise-cc.c
Log Message:
abstract check for "*path == '/'" to isabs(*path)
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 pkgsrc/pkgtools/cwrappers/files/bin/cleanup-cc.c
cvs rdiff -u -r1.8 -r1.9 pkgsrc/pkgtools/cwrappers/files/bin/common.h
cvs rdiff -u -r1.7 -r1.8 pkgsrc/pkgtools/cwrappers/files/bin/fixup-libtool.c
cvs rdiff -u -r1.4 -r1.5 \
pkgsrc/pkgtools/cwrappers/files/bin/generic-transform-cc.c
cvs rdiff -u -r1.5 -r1.6 pkgsrc/pkgtools/cwrappers/files/bin/normalise-cc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/pkgtools/cwrappers/files/bin/cleanup-cc.c
diff -u pkgsrc/pkgtools/cwrappers/files/bin/cleanup-cc.c:1.3 pkgsrc/pkgtools/cwrappers/files/bin/cleanup-cc.c:1.4
--- pkgsrc/pkgtools/cwrappers/files/bin/cleanup-cc.c:1.3 Sun Jan 10 14:13:05 2016
+++ pkgsrc/pkgtools/cwrappers/files/bin/cleanup-cc.c Sun Nov 7 07:38:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cleanup-cc.c,v 1.3 2016/01/10 19:13:05 bsiegert Exp $ */
+/* $NetBSD: cleanup-cc.c,v 1.4 2021/11/07 12:38:12 christos Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -52,7 +52,7 @@ cleanup_cc(struct arglist *args)
if (arg->val[0] != '-')
continue;
if (strncmp(arg->val, "-Wl,-rpath,", 11) == 0) {
- if (arg->val[11] == '/')
+ if (isabs(arg->val[11]))
continue;
argument_unlink(args, &arg);
continue;
Index: pkgsrc/pkgtools/cwrappers/files/bin/common.h
diff -u pkgsrc/pkgtools/cwrappers/files/bin/common.h:1.8 pkgsrc/pkgtools/cwrappers/files/bin/common.h:1.9
--- pkgsrc/pkgtools/cwrappers/files/bin/common.h:1.8 Tue Nov 7 11:49:22 2017
+++ pkgsrc/pkgtools/cwrappers/files/bin/common.h Sun Nov 7 07:38:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: common.h,v 1.8 2017/11/07 16:49:22 khorben Exp $ */
+/* $NetBSD: common.h,v 1.9 2021/11/07 12:38:12 christos Exp $ */
/*-
* Copyright (c) 2009, 2017 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -121,4 +121,6 @@ void fixup_libtool(struct arglist *);
void mi_vector_hash(const void *, size_t, uint32_t, uint32_t[3]);
#endif
+#define isabs(a) ((a) == '/')
+
#endif
Index: pkgsrc/pkgtools/cwrappers/files/bin/fixup-libtool.c
diff -u pkgsrc/pkgtools/cwrappers/files/bin/fixup-libtool.c:1.7 pkgsrc/pkgtools/cwrappers/files/bin/fixup-libtool.c:1.8
--- pkgsrc/pkgtools/cwrappers/files/bin/fixup-libtool.c:1.7 Sun Apr 19 10:30:07 2015
+++ pkgsrc/pkgtools/cwrappers/files/bin/fixup-libtool.c Sun Nov 7 07:38:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: fixup-libtool.c,v 1.7 2015/04/19 14:30:07 jperkin Exp $ */
+/* $NetBSD: fixup-libtool.c,v 1.8 2021/11/07 12:38:12 christos Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -127,7 +127,7 @@ process_option(struct processing_option
continue;
if (strncmp(line + 2, r->src, r->src_len))
continue;
- if (line[r->src_len + 2] != '/' &&
+ if (!isabs(line[r->src_len + 2]) &&
len != r->src_len + 2)
continue;
line += r->src_len + 2;
@@ -144,7 +144,7 @@ process_option(struct processing_option
if (wlen <= len - 2 &&
strncmp(line + 2, wrksrc, wlen) == 0 &&
- (line[wlen + 2] == '/' || wlen + 2 == len))
+ (isabs(line[wlen + 2]) || wlen + 2 == len))
return;
}
}
@@ -170,17 +170,17 @@ process_option(struct processing_option
goto print_option;
for (eol = line + len - 3; eol > line; --eol) {
- if (*eol == '/')
+ if (isabs(*eol))
break;
}
- if (opt->in_lai && *eol == '/') {
+ if (opt->in_lai && isabs(*eol)) {
TAILQ_FOREACH(r, &unwrap_rules, link) {
if (eol < line + r->src_len)
continue;
if (strncmp(line, r->src, r->src_len))
continue;
- if (line[r->src_len] != '/')
+ if (!isabs(*eol))
continue;
line += r->src_len;
len -= r->src_len;
@@ -212,12 +212,12 @@ process_option(struct processing_option
len == strlen(opt->lafile))
goto print_option;
- if (*line != '/' && line == eol) {
+ if (!isabs(*line) && line == eol) {
process_option(opt, "-L./.libs", 9, in_relink);
goto print_option;
}
- if (*line != '/') {
+ if (!isabs(*line)) {
tmp = xasprintf("-L%*.*s/.libs", (int)(eol - line),
(int)(eol - line), line);
process_option(opt, tmp, strlen(tmp), in_relink);
@@ -230,7 +230,7 @@ process_option(struct processing_option
wlen = strlen(wrksrc);
if (wlen > len ||
- (wlen != len && line[wlen] != '/') ||
+ (wlen != len && !isabs(line[wlen])) ||
strncmp(wrksrc, line, wlen))
goto print_option;
Index: pkgsrc/pkgtools/cwrappers/files/bin/generic-transform-cc.c
diff -u pkgsrc/pkgtools/cwrappers/files/bin/generic-transform-cc.c:1.4 pkgsrc/pkgtools/cwrappers/files/bin/generic-transform-cc.c:1.5
--- pkgsrc/pkgtools/cwrappers/files/bin/generic-transform-cc.c:1.4 Mon Mar 14 16:16:08 2016
+++ pkgsrc/pkgtools/cwrappers/files/bin/generic-transform-cc.c Sun Nov 7 07:38:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: generic-transform-cc.c,v 1.4 2016/03/14 20:16:08 markd Exp $ */
+/* $NetBSD: generic-transform-cc.c,v 1.5 2021/11/07 12:38:12 christos Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -264,7 +264,7 @@ generic_transform_cc_absolute(struct arg
TAILQ_FOREACH(rule, &libpath_rules, link) {
if (rule->src_len > len)
continue;
- if (arg->val[rule->src_len] != '/')
+ if (!isabs(arg->val[rule->src_len]))
continue;
if (strncmp(arg->val, rule->src, rule->src_len))
continue;
@@ -297,7 +297,7 @@ generic_transform_libtool_lib(struct arg
free(fname);
continue;
}
- if (arg2->val[2] == '/') {
+ if (isabs(arg2->val[2])) {
if (wrksrc == NULL)
return 0;
if (strncmp(arg2->val + 2, wrksrc, len))
@@ -346,7 +346,7 @@ generic_transform_cc(struct arglist *arg
continue;
#endif
- if (arg->val[0] == '/') {
+ if (isabs(arg->val[0])) {
#if defined(WRAPPER_LIBTOOL)
generic_transform_cc_absolute(args, arg);
#endif
@@ -435,14 +435,14 @@ generic_transform_cc(struct arglist *arg
} else
continue;
- if (*path != '/')
+ if (!isabs(*path))
continue;
- while (len > 1 && path[len - 1] == '/')
+ while (len > 1 && isabs(path[len - 1]))
--len;
TAILQ_FOREACH(rule, ruleset, link) {
- if (rule->src[rule->src_len - 1] == '/') {
+ if (isabs(rule->src[rule->src_len - 1])) {
if (rule->src_len - 1 != len)
continue;
if (memcmp(path, rule->src, len) != 0)
@@ -452,7 +452,7 @@ generic_transform_cc(struct arglist *arg
if (rule->src_len > len)
continue;
if (path[rule->src_len] != '\0' &&
- path[rule->src_len] != '/')
+ !isabs(path[rule->src_len]))
continue;
if (strncmp(path, rule->src, rule->src_len) == 0)
break;
Index: pkgsrc/pkgtools/cwrappers/files/bin/normalise-cc.c
diff -u pkgsrc/pkgtools/cwrappers/files/bin/normalise-cc.c:1.5 pkgsrc/pkgtools/cwrappers/files/bin/normalise-cc.c:1.6
--- pkgsrc/pkgtools/cwrappers/files/bin/normalise-cc.c:1.5 Sun Jun 11 15:34:43 2017
+++ pkgsrc/pkgtools/cwrappers/files/bin/normalise-cc.c Sun Nov 7 07:38:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: normalise-cc.c,v 1.5 2017/06/11 19:34:43 joerg Exp $ */
+/* $NetBSD: normalise-cc.c,v 1.6 2021/11/07 12:38:12 christos Exp $ */
/*-
* Copyright (c) 2009, 2017 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -44,7 +44,7 @@ normalise_path_list(struct arglist *args
struct argument *arg2;
while ((sep = strchr(val, ':')) != NULL) {
- if (sep == val || (strip_relative && val[0] != '/')) {
+ if (sep == val || (strip_relative && !isabs(val[0]))) {
val = sep + 1;
continue;
}
@@ -53,7 +53,7 @@ normalise_path_list(struct arglist *args
arg = arg2;
val = sep + 1;
}
- if (val[0] == '\0' || (strip_relative && val[0] != '/'))
+ if (val[0] == '\0' || (strip_relative && !isabs(val[0])))
return;
arg2 = argument_new(concat(prefix, val));
TAILQ_INSERT_AFTER(args, arg, arg2, link);
@@ -151,7 +151,7 @@ normalise_cc(struct arglist *args)
arg2 = TAILQ_NEXT(arg2, link);
continue;
}
- if (arg->val[0] == '/') {
+ if (isabs(arg->val[0])) {
next = strrchr(arg->val, '/');
++next;
if (strncmp(next, "lib", 3))
Home |
Main Index |
Thread Index |
Old Index