mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
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>
This commit is contained in:
committed by
Sam James
parent
5973f2fdae
commit
82efffb361
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user