Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/its4/, dev-util/its4/files/
Date: Sun, 20 Feb 2022 00:31:39
Message-Id: 1645316997.82efffb36105a798b53d557f43d20be8ece80370.sam@gentoo
1 commit: 82efffb36105a798b53d557f43d20be8ece80370
2 Author: Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
3 AuthorDate: Sat Feb 19 06:30:27 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 20 00:29:57 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82efffb3
7
8 dev-util/its4: Convert sed lines to patches
9
10 Gets rid of the custom src_prepare() function in favor of a PATCHES
11 array.
12 Closes: https://github.com/gentoo/gentoo/pull/24072
13
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 .../its4-1.1.1-r2-cpp-headers-and-opt-flags.patch | 43 ++++++++++++++++++++
17 ...1.1.1-r2-ensure-spaces-in-string-literals.patch | 47 ++++++++++++++++++++++
18 dev-util/its4/its4-1.1.1-r2.ebuild | 18 ++-------
19 3 files changed, 94 insertions(+), 14 deletions(-)
20
21 diff --git a/dev-util/its4/files/its4-1.1.1-r2-cpp-headers-and-opt-flags.patch b/dev-util/its4/files/its4-1.1.1-r2-cpp-headers-and-opt-flags.patch
22 new file mode 100644
23 index 000000000000..8329bd12cce1
24 --- /dev/null
25 +++ b/dev-util/its4/files/its4-1.1.1-r2-cpp-headers-and-opt-flags.patch
26 @@ -0,0 +1,43 @@
27 +From 71d766c506c62aa0ad88836e3c10443b90f46898 Mon Sep 17 00:00:00 2001
28 +From: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
29 +Date: Sat, 19 Feb 2022 07:17:17 +0100
30 +Subject: [PATCH] Adjust configure and Makefile.in
31 +
32 +---
33 + Makefile.in | 4 ++--
34 + configure | 2 +-
35 + 2 files changed, 3 insertions(+), 3 deletions(-)
36 +
37 +diff --git a/Makefile.in b/Makefile.in
38 +index 564e13c..66fbb31 100644
39 +--- a/Makefile.in
40 ++++ b/Makefile.in
41 +@@ -4,10 +4,10 @@ OBJECTS=token.o lex.o main.o scanner.o resultsdb.o vulndb.o handlers.o \
42 + $(EXTRA_OBJS)
43 +
44 + all: $(OBJECTS)
45 +- $(CC) -o $(PROGNAME) $(OBJECTS)
46 ++ $(CC) $(OPTIMIZATION) $(EXTRA_FLAGS) -o $(PROGNAME) $(OBJECTS)
47 +
48 + pure: $(OBJECTS)
49 +- purify $(CC) -o $(PROGNAME) $(OBJECTS)
50 ++ purify $(CC) $(OPTIMIZATION) $(EXTRA_FLAGS) -o $(PROGNAME) $(OBJECTS)
51 +
52 + .C.o:
53 + $(CC) -c -DDATA_DIR=$(INSTALL_DATADIR) $(EXTRA_FLAGS) ${OPTIMIZATION} $<
54 +diff --git a/configure b/configure
55 +index e85410f..12626c4 100755
56 +--- a/configure
57 ++++ b/configure
58 +@@ -117,7 +117,7 @@ if test -z "${QUIET}"; then exec 5>&1; else exec 5>/dev/null; fi
59 +
60 + ###### Can we invoke the compiler?
61 + cat >tmp.c <<EOF
62 +-#include <iostream.h>
63 ++#include <iostream>
64 + int main(){return 0;}
65 + EOF
66 + if test -n "${CC}"; then
67 +--
68 +2.34.1
69 +
70
71 diff --git a/dev-util/its4/files/its4-1.1.1-r2-ensure-spaces-in-string-literals.patch b/dev-util/its4/files/its4-1.1.1-r2-ensure-spaces-in-string-literals.patch
72 new file mode 100644
73 index 000000000000..1d65c44bb729
74 --- /dev/null
75 +++ b/dev-util/its4/files/its4-1.1.1-r2-ensure-spaces-in-string-literals.patch
76 @@ -0,0 +1,47 @@
77 +From 2f0f98aff51bad9474671e73aa29080c541ca055 Mon Sep 17 00:00:00 2001
78 +From: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
79 +Date: Sat, 19 Feb 2022 07:19:34 +0100
80 +Subject: [PATCH] Ensure spaces between string literals
81 +
82 +---
83 + config.C | 10 +++++-----
84 + 1 file changed, 5 insertions(+), 5 deletions(-)
85 +
86 +diff --git a/config.C b/config.C
87 +index 61282e8..c4cf375 100644
88 +--- a/config.C
89 ++++ b/config.C
90 +@@ -103,8 +103,8 @@ NEWLINE
91 + " Ignore instances of a particular function name." NEWLINE
92 + " This flag can be used as many times as you like." NEWLINE
93 + " -I, --ignore-file=filename" NEWLINE
94 +-" Specify a file to read ignore info from, causing ITS4 to not"NEWLINE
95 +-" report instances of those functions. Each function to ignore"NEWLINE
96 ++" Specify a file to read ignore info from, causing ITS4 to not" NEWLINE
97 ++" report instances of those functions. Each function to ignore" NEWLINE
98 + " should be on its own line." NEWLINE
99 + " -l, --limit=function" NEWLINE
100 + " Tells ITS4 not to scan for any functions, except those" NEWLINE
101 +@@ -112,7 +112,7 @@ NEWLINE
102 + " times as you want." NEWLINE
103 + " -m, --input-mode"
104 + NEWLINE
105 +-" Tells ITS4 to print out all non-argv spots at which input can"NEWLINE
106 ++" Tells ITS4 to print out all non-argv spots at which input can" NEWLINE
107 + " enter. This option causes some other options to be ignored." NEWLINE
108 + " Most importantly, the regular scan does not happen, no" NEWLINE
109 + " severities are visibly reported, and the cutoff is ignored." NEWLINE
110 +@@ -347,8 +347,8 @@ void ParseOptions(int argc, char **argv, int &index)
111 + case 'o':
112 + if(!optarg)
113 + {
114 +- fprintf(stderr, "Warning: option 'o' needs an argument."NEWLINE);
115 +- fprintf(stderr, "Writing to stdout."NEWLINE);
116 ++ fprintf(stderr, "Warning: option 'o' needs an argument." NEWLINE);
117 ++ fprintf(stderr, "Writing to stdout." NEWLINE);
118 + continue;
119 + }
120 + SetOutputFile(optarg);
121 +--
122 +2.34.1
123 +
124
125 diff --git a/dev-util/its4/its4-1.1.1-r2.ebuild b/dev-util/its4/its4-1.1.1-r2.ebuild
126 index 86e78a42d315..0be321963bb4 100644
127 --- a/dev-util/its4/its4-1.1.1-r2.ebuild
128 +++ b/dev-util/its4/its4-1.1.1-r2.ebuild
129 @@ -15,20 +15,10 @@ KEYWORDS="~amd64 ~ppc ~x86"
130
131 S="${WORKDIR}/${PN}"
132
133 -src_prepare() {
134 - sed -i \
135 - -e 's,iostream.h,iostream,g'\
136 - "${S}"/configure || die
137 - sed -i \
138 - -e 's/$(CC) -o/$(CC) $(OPTIMIZATION) $(EXTRA_FLAGS) -o/' \
139 - "${S}"/Makefile.in || die
140 -
141 - # Bug 738936 fails to compile with clang/LLVM toolchain
142 - sed -i \
143 - -e 's/"NEWLINE/" NEWLINE/g'\
144 - "${S}"/config.C || die
145 - eapply_user
146 -}
147 +PATCHES=(
148 + "${FILESDIR}/${PN}-1.1.1-r2-cpp-headers-and-opt-flags.patch"
149 + "${FILESDIR}/${PN}-1.1.1-r2-ensure-spaces-in-string-literals.patch" # bug 738936
150 +)
151
152 src_configure() {
153 # WARNING