summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bracht Laumann Jespersen <t@laumann.xyz>2022-02-19 07:30:27 +0100
committerSam James <sam@gentoo.org>2022-02-20 00:29:57 +0000
commit82efffb36105a798b53d557f43d20be8ece80370 (patch)
tree74c84d39bdf177873d1034953fd2c412fbbec6be /dev-util/its4
parentdev-util/its4: Fix build for clang/LLVM toolchain (diff)
downloadgentoo-82efffb36105a798b53d557f43d20be8ece80370.tar.gz
gentoo-82efffb36105a798b53d557f43d20be8ece80370.tar.bz2
gentoo-82efffb36105a798b53d557f43d20be8ece80370.zip
dev-util/its4: Convert sed lines to patches
Gets rid of the custom src_prepare() function in favor of a PATCHES array. Closes: https://github.com/gentoo/gentoo/pull/24072 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/its4')
-rw-r--r--dev-util/its4/files/its4-1.1.1-r2-cpp-headers-and-opt-flags.patch43
-rw-r--r--dev-util/its4/files/its4-1.1.1-r2-ensure-spaces-in-string-literals.patch47
-rw-r--r--dev-util/its4/its4-1.1.1-r2.ebuild18
3 files changed, 94 insertions, 14 deletions
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
new file mode 100644
index 000000000000..8329bd12cce1
--- /dev/null
+++ b/dev-util/its4/files/its4-1.1.1-r2-cpp-headers-and-opt-flags.patch
@@ -0,0 +1,43 @@
+From 71d766c506c62aa0ad88836e3c10443b90f46898 Mon Sep 17 00:00:00 2001
+From: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
+Date: Sat, 19 Feb 2022 07:17:17 +0100
+Subject: [PATCH] Adjust configure and Makefile.in
+
+---
+ Makefile.in | 4 ++--
+ configure | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 564e13c..66fbb31 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -4,10 +4,10 @@ OBJECTS=token.o lex.o main.o scanner.o resultsdb.o vulndb.o handlers.o \
+ $(EXTRA_OBJS)
+
+ all: $(OBJECTS)
+- $(CC) -o $(PROGNAME) $(OBJECTS)
++ $(CC) $(OPTIMIZATION) $(EXTRA_FLAGS) -o $(PROGNAME) $(OBJECTS)
+
+ pure: $(OBJECTS)
+- purify $(CC) -o $(PROGNAME) $(OBJECTS)
++ purify $(CC) $(OPTIMIZATION) $(EXTRA_FLAGS) -o $(PROGNAME) $(OBJECTS)
+
+ .C.o:
+ $(CC) -c -DDATA_DIR=$(INSTALL_DATADIR) $(EXTRA_FLAGS) ${OPTIMIZATION} $<
+diff --git a/configure b/configure
+index e85410f..12626c4 100755
+--- a/configure
++++ b/configure
+@@ -117,7 +117,7 @@ if test -z "${QUIET}"; then exec 5>&1; else exec 5>/dev/null; fi
+
+ ###### Can we invoke the compiler?
+ cat >tmp.c <<EOF
+-#include <iostream.h>
++#include <iostream>
+ int main(){return 0;}
+ EOF
+ if test -n "${CC}"; then
+--
+2.34.1
+
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
new file mode 100644
index 000000000000..1d65c44bb729
--- /dev/null
+++ b/dev-util/its4/files/its4-1.1.1-r2-ensure-spaces-in-string-literals.patch
@@ -0,0 +1,47 @@
+From 2f0f98aff51bad9474671e73aa29080c541ca055 Mon Sep 17 00:00:00 2001
+From: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
+Date: Sat, 19 Feb 2022 07:19:34 +0100
+Subject: [PATCH] Ensure spaces between string literals
+
+---
+ config.C | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/config.C b/config.C
+index 61282e8..c4cf375 100644
+--- a/config.C
++++ b/config.C
+@@ -103,8 +103,8 @@ NEWLINE
+ " Ignore instances of a particular function name." NEWLINE
+ " This flag can be used as many times as you like." NEWLINE
+ " -I, --ignore-file=filename" NEWLINE
+-" Specify a file to read ignore info from, causing ITS4 to not"NEWLINE
+-" report instances of those functions. Each function to ignore"NEWLINE
++" Specify a file to read ignore info from, causing ITS4 to not" NEWLINE
++" report instances of those functions. Each function to ignore" NEWLINE
+ " should be on its own line." NEWLINE
+ " -l, --limit=function" NEWLINE
+ " Tells ITS4 not to scan for any functions, except those" NEWLINE
+@@ -112,7 +112,7 @@ NEWLINE
+ " times as you want." NEWLINE
+ " -m, --input-mode"
+ NEWLINE
+-" Tells ITS4 to print out all non-argv spots at which input can"NEWLINE
++" Tells ITS4 to print out all non-argv spots at which input can" NEWLINE
+ " enter. This option causes some other options to be ignored." NEWLINE
+ " Most importantly, the regular scan does not happen, no" NEWLINE
+ " severities are visibly reported, and the cutoff is ignored." NEWLINE
+@@ -347,8 +347,8 @@ void ParseOptions(int argc, char **argv, int &index)
+ case 'o':
+ if(!optarg)
+ {
+- fprintf(stderr, "Warning: option 'o' needs an argument."NEWLINE);
+- fprintf(stderr, "Writing to stdout."NEWLINE);
++ fprintf(stderr, "Warning: option 'o' needs an argument." NEWLINE);
++ fprintf(stderr, "Writing to stdout." NEWLINE);
+ continue;
+ }
+ SetOutputFile(optarg);
+--
+2.34.1
+
diff --git a/dev-util/its4/its4-1.1.1-r2.ebuild b/dev-util/its4/its4-1.1.1-r2.ebuild
index 86e78a42d315..0be321963bb4 100644
--- a/dev-util/its4/its4-1.1.1-r2.ebuild
+++ b/dev-util/its4/its4-1.1.1-r2.ebuild
@@ -15,20 +15,10 @@ KEYWORDS="~amd64 ~ppc ~x86"
S="${WORKDIR}/${PN}"
-src_prepare() {
- sed -i \
- -e 's,iostream.h,iostream,g'\
- "${S}"/configure || die
- sed -i \
- -e 's/$(CC) -o/$(CC) $(OPTIMIZATION) $(EXTRA_FLAGS) -o/' \
- "${S}"/Makefile.in || die
-
- # Bug 738936 fails to compile with clang/LLVM toolchain
- sed -i \
- -e 's/"NEWLINE/" NEWLINE/g'\
- "${S}"/config.C || die
- eapply_user
-}
+PATCHES=(
+ "${FILESDIR}/${PN}-1.1.1-r2-cpp-headers-and-opt-flags.patch"
+ "${FILESDIR}/${PN}-1.1.1-r2-ensure-spaces-in-string-literals.patch" # bug 738936
+)
src_configure() {
# WARNING