router/Makefile: changed the way how patches are apllied/reverted

arm-ng
pedro 8 years ago committed by kille72
parent 7fbe92baef
commit f38c1f8ec6

@ -18,6 +18,23 @@ include common.mak
export PARALLEL_BUILD := -j`grep -c '^processor' /proc/cpuinfo` export PARALLEL_BUILD := -j`grep -c '^processor' /proc/cpuinfo`
define patch_files =
find patches/$(1) -maxdepth 1 -type f -name '*.patch' | sort -t '\0' -n | while read FILE; do \
( if ! patch -p0 -Rf --dry-run --silent < $$FILE 2>/dev/null; then \
patch -p0 < $$FILE; \
fi ) \
done
endef
define unpatch_files =
find patches/$(1) -maxdepth 1 -type f -name '*.patch' | sort -t '\0' -n | while read FILE; do \
( if patch -p0 -Rf --dry-run --silent < $$FILE 2>/dev/null; then \
patch -p0 -Rf < $$FILE; \
fi ) \
done
endef
# #
# #
# #
@ -926,9 +943,7 @@ bridge-install:
dnsmasq: $(if $(TCONFIG_DNSSEC),nettle,) dnsmasq: $(if $(TCONFIG_DNSSEC),nettle,)
@$(SEP) @$(SEP)
( if ! patch -R -f -d dnsmasq/src --dry-run --silent < patches/dnsmasq/101-tomato-specific.patch 2>/dev/null; then \ $(call patch_files,dnsmasq)
patch -b -d dnsmasq/src < patches/dnsmasq/101-tomato-specific.patch; \
fi )
@$(MAKE) -C dnsmasq $(PARALLEL_BUILD) \ @$(MAKE) -C dnsmasq $(PARALLEL_BUILD) \
COPTS="$(if $(TCONFIG_DNSSEC),-I$(TOP)/nettle/include -I$(TOP)/gmp -DHAVE_DNSSEC -DHAVE_DNSSEC_STATIC,) \ COPTS="$(if $(TCONFIG_DNSSEC),-I$(TOP)/nettle/include -I$(TOP)/gmp -DHAVE_DNSSEC -DHAVE_DNSSEC_STATIC,) \
$(if $(TCONFIG_IPV6),-DUSE_IPV6,-DNO_IPV6) \ $(if $(TCONFIG_IPV6),-DUSE_IPV6,-DNO_IPV6) \
@ -941,6 +956,9 @@ dnsmasq-install:
install -D dnsmasq/src/dnsmasq $(INSTALLDIR)/dnsmasq/usr/sbin/dnsmasq install -D dnsmasq/src/dnsmasq $(INSTALLDIR)/dnsmasq/usr/sbin/dnsmasq
$(STRIP) $(INSTALLDIR)/dnsmasq/usr/sbin/dnsmasq $(STRIP) $(INSTALLDIR)/dnsmasq/usr/sbin/dnsmasq
dnsmasq-clean:
$(call unpatch_files,dnsmasq)
nettle/stamp-h1: gmp nettle/stamp-h1: gmp
@cd nettle && CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) \ @cd nettle && CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) \
CPPFLAGS="-I$(TOP)/gmp" \ CPPFLAGS="-I$(TOP)/gmp" \
@ -1973,9 +1991,7 @@ libpng-clean:
php/stamp-h1: pcre zlib libiconv sqlite libxml2 libpng jpeg libcurl php/stamp-h1: pcre zlib libiconv sqlite libxml2 libpng jpeg libcurl
@$(SEP) @$(SEP)
( if ! patch -R -f -d php --dry-run --silent < patches/php/101-fix-cross-compiling-issue.patch 2>/dev/null; then \ $(call patch_files,php)
patch -b -d php < patches/php/101-fix-cross-compiling-issue.patch; \
fi )
cd php && CC=$(CC) CXX=$(ARCH)-g++ AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) \ cd php && CC=$(CC) CXX=$(ARCH)-g++ AR=$(AR) RANLIB=$(RANLIB) LD=$(LD) \
CFLAGS="-Os -Wall -I$(TOP)/zlib -I$(TOP)/libxml2/include/libxml -I$(TOP)/libxml2/include -I$(TOP)/pcre -I$(TOP)/libiconv/include \ CFLAGS="-Os -Wall -I$(TOP)/zlib -I$(TOP)/libxml2/include/libxml -I$(TOP)/libxml2/include -I$(TOP)/pcre -I$(TOP)/libiconv/include \
-I$(TOP)/libpng/staged/usr/include -I$(TOP)/libcurl/staged/include" \ -I$(TOP)/libpng/staged/usr/include -I$(TOP)/libcurl/staged/include" \
@ -2055,6 +2071,7 @@ php: php/stamp-h1
php-clean: php-clean:
-@$(MAKE) -C php clean -@$(MAKE) -C php clean
-@rm php/stamp-h1 -@rm php/stamp-h1
$(call unpatch_files,php)
php-install: php-install:
@$(SEP) @$(SEP)
@ -2147,12 +2164,7 @@ libncurses-install:
mysql/stamp-h1: openssl zlib libncurses mysql/stamp-h1: openssl zlib libncurses
@$(SEP) @$(SEP)
@cp -f $(TOP)/patches/mysql/.host.tgz $(TOP)/mysql/ || true @cp -f $(TOP)/patches/mysql/.host.tgz $(TOP)/mysql/ || true
( if ! patch -R -f -d mysql/sql --dry-run --silent < patches/mysql/101-bison-compat.patch 2>/dev/null; then \ $(call patch_files,mysql)
patch -b -d mysql/sql < patches/mysql/101-bison-compat.patch; \
fi )
( if ! patch -p0 -R -f --dry-run --silent < patches/mysql/201-fix-cross-compiling.patch 2>/dev/null; then \
patch -p0 -b < patches/mysql/201-fix-cross-compiling.patch; \
fi )
cd mysql && \ cd mysql && \
CFLAGS="-O2 -Wall -fno-delete-null-pointer-checks -funit-at-a-time --param large-function-growth=800 \ CFLAGS="-O2 -Wall -fno-delete-null-pointer-checks -funit-at-a-time --param large-function-growth=800 \
--param max-inline-insns-single=3000 -ffunction-sections -fdata-sections -I$(TOP)/zlib \ --param max-inline-insns-single=3000 -ffunction-sections -fdata-sections -I$(TOP)/zlib \
@ -2191,6 +2203,7 @@ mysql-clean:
-@rm -f mysql/stamp-h1 -@rm -f mysql/stamp-h1
-@rm -rf mysql/staged mysql/host -@rm -rf mysql/staged mysql/host
-@rm -f mysql/.host.tgz -@rm -f mysql/.host.tgz
$(call unpatch_files,mysql)
mysql-install: mysql-install:
install -d $(INSTALLDIR)/mysql/usr/bin install -d $(INSTALLDIR)/mysql/usr/bin
@ -2283,12 +2296,7 @@ openvpn_plugin_auth_nvram: nvram$(BCMEX)
#shibby #shibby
nano/stamp-h1: libncurses nano/stamp-h1: libncurses
( if ! patch -p0 -Rf --dry-run --silent < patches/nano/101-do-not-build-doc.patch 2>/dev/null; then \ $(call patch_files,nano)
patch -p0 -b < patches/nano/101-do-not-build-doc.patch; \
fi )
( if ! patch -p0 -Rf --dry-run --silent < patches/nano/102-fix-build-with-tiny-option.patch 2>/dev/null; then \
patch -p0 -b < patches/nano/102-fix-build-with-tiny-option.patch; \
fi )
cd nano && CC=$(CC) STRIP=$(STRIP) \ cd nano && CC=$(CC) STRIP=$(STRIP) \
autoreconf && \ autoreconf && \
CFLAGS="-Os -Wall $(EXTRACFLAGS) -I$(TOP)/libncurses/staged/usr/include -ffunction-sections -fdata-sections" \ CFLAGS="-Os -Wall $(EXTRACFLAGS) -I$(TOP)/libncurses/staged/usr/include -ffunction-sections -fdata-sections" \
@ -2305,6 +2313,7 @@ nano: nano/stamp-h1
nano-clean: nano-clean:
-@$(MAKE) -C nano clean -@$(MAKE) -C nano clean
@rm -f nano/stamp-h1 nano/Makefile nano/src/Makefile @rm -f nano/stamp-h1 nano/Makefile nano/src/Makefile
$(call unpatch_files,nano)
nano-install: nano-install:
install -d $(INSTALLDIR)/nano/usr/sbin install -d $(INSTALLDIR)/nano/usr/sbin

@ -1,5 +1,5 @@
--- config.h 2017-05-22 23:58:46.000000000 +0200 --- dnsmasq/src/config.h 2017-05-22 23:58:46.000000000 +0200
+++ config.h 2017-10-03 20:05:34.000000000 +0200 +++ dnsmasq/src/config.h 2017-10-03 20:05:34.000000000 +0200
@@ -73,6 +73,10 @@ HAVE_BROKEN_RTC @@ -73,6 +73,10 @@ HAVE_BROKEN_RTC
NOTE: when enabling or disabling this, be sure to delete any old NOTE: when enabling or disabling this, be sure to delete any old
leases file, otherwise dnsmasq may get very confused. leases file, otherwise dnsmasq may get very confused.
@ -40,8 +40,8 @@
#endif #endif
--- dnsmasq.c 2017-05-22 23:58:46.000000000 +0200 --- dnsmasq/src/dnsmasq.c 2017-05-22 23:58:46.000000000 +0200
+++ dnsmasq.c 2017-10-03 20:05:34.000000000 +0200 +++ dnsmasq/src/dnsmasq.c 2017-10-03 20:05:34.000000000 +0200
@@ -13,6 +13,44 @@ @@ -13,6 +13,44 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
@ -123,8 +123,8 @@
if (daemon->lease_stream) if (daemon->lease_stream)
fclose(daemon->lease_stream); fclose(daemon->lease_stream);
--- dnsmasq.h 2017-05-22 23:58:46.000000000 +0200 --- dnsmasq/src/dnsmasq.h 2017-05-22 23:58:46.000000000 +0200
+++ dnsmasq.h 2017-10-03 20:05:34.000000000 +0200 +++ dnsmasq/src/dnsmasq.h 2017-10-03 20:05:34.000000000 +0200
@@ -1356,6 +1356,12 @@ int make_icmp_sock(void); @@ -1356,6 +1356,12 @@ int make_icmp_sock(void);
int icmp_ping(struct in_addr addr); int icmp_ping(struct in_addr addr);
int delay_dhcp(time_t start, int sec, int fd, uint32_t addr, unsigned short id); int delay_dhcp(time_t start, int sec, int fd, uint32_t addr, unsigned short id);
@ -138,8 +138,8 @@
void queue_event(int event); void queue_event(int event);
void send_alarm(time_t event, time_t now); void send_alarm(time_t event, time_t now);
void send_event(int fd, int event, int data, char *msg); void send_event(int fd, int event, int data, char *msg);
--- lease.c 2017-05-22 23:58:46.000000000 +0200 --- dnsmasq/src/lease.c 2017-05-22 23:58:46.000000000 +0200
+++ lease.c 2017-10-03 20:05:34.000000000 +0200 +++ dnsmasq/src/lease.c 2017-10-03 20:05:34.000000000 +0200
@@ -108,12 +108,15 @@ static int read_leases(time_t now, FILE @@ -108,12 +108,15 @@ static int read_leases(time_t now, FILE
ei = atol(daemon->dhcp_buff3); ei = atol(daemon->dhcp_buff3);

@ -1,5 +1,5 @@
--- a/sql/sql_lex.cc --- mysql/sql/sql_lex.cc
+++ b/sql/sql_lex.cc +++ mysql/sql/sql_lex.cc
@@ -775,14 +775,13 @@ bool consume_comment(Lex_input_stream *l @@ -775,14 +775,13 @@ bool consume_comment(Lex_input_stream *l
(which can't be followed by a signed number) (which can't be followed by a signed number)
*/ */
@ -16,8 +16,8 @@
Lex_input_stream *lip= & thd->m_parser_state->m_lip; Lex_input_stream *lip= & thd->m_parser_state->m_lip;
LEX *lex= thd->lex; LEX *lex= thd->lex;
YYSTYPE *yylval=(YYSTYPE*) arg; YYSTYPE *yylval=(YYSTYPE*) arg;
--- a/sql/sql_lex.h --- mysql/sql/sql_lex.h
+++ b/sql/sql_lex.h +++ mysql/sql/sql_lex.h
@@ -2072,7 +2072,7 @@ extern void lex_init(void); @@ -2072,7 +2072,7 @@ extern void lex_init(void);
extern void lex_free(void); extern void lex_free(void);
extern void lex_start(THD *thd); extern void lex_start(THD *thd);
@ -27,8 +27,8 @@
extern void trim_whitespace(CHARSET_INFO *cs, LEX_STRING *str); extern void trim_whitespace(CHARSET_INFO *cs, LEX_STRING *str);
--- a/sql/sql_parse.cc --- mysql/sql/sql_parse.cc
+++ b/sql/sql_parse.cc +++ mysql/sql/sql_parse.cc
@@ -8012,7 +8012,7 @@ bool check_host_name(LEX_STRING *str) @@ -8012,7 +8012,7 @@ bool check_host_name(LEX_STRING *str)
} }
@ -38,8 +38,8 @@
/** /**
--- a/sql/sql_yacc.yy --- mysql/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy +++ mysql/sql/sql_yacc.yy
@@ -25,17 +25,15 @@ @@ -25,17 +25,15 @@
%{ %{
/* thd is passed as an argument to yyparse(), and subsequently to yylex(). /* thd is passed as an argument to yyparse(), and subsequently to yylex().

@ -1,5 +1,5 @@
--- configure 2017-07-06 01:57:38.000000000 +0200 --- php/configure 2017-07-06 01:57:38.000000000 +0200
+++ configure 2017-09-25 19:24:11.000000000 +0200 +++ php/configure 2017-09-25 19:24:11.000000000 +0200
@@ -36577,6 +36577,9 @@ @@ -36577,6 +36577,9 @@
libmagic/is_tar.c libmagic/magic.c libmagic/print.c \ libmagic/is_tar.c libmagic/magic.c libmagic/print.c \
libmagic/readcdf.c libmagic/softmagic.c" libmagic/readcdf.c libmagic/softmagic.c"

Loading…
Cancel
Save