mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Robert Schwebel <r.schwebel@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Robert Schwebel <r.schwebel@pengutronix.de>
Subject: [ptxdist] [PATCH 08/28] bing: clean up patches
Date: Sun, 30 Oct 2011 23:00:39 +0100	[thread overview]
Message-ID: <1320012059-24971-8-git-send-email-r.schwebel@pengutronix.de> (raw)
In-Reply-To: <1320012059-24971-1-git-send-email-r.schwebel@pengutronix.de>

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
 ...pt-makefile-for-Linux-add-destdir-support.patch |   66 +++++++++++
 .../bing_src-1.1.3/0002-bing_1.1.3-2.diff.patch    |  121 ++++++++++++++++++++
 .../bing_src-1.1.3/adapt_makefile_for_linux.diff   |   64 ----------
 patches/bing_src-1.1.3/bing_1.1.3-2.diff           |  109 ------------------
 patches/bing_src-1.1.3/series                      |    2 -
 5 files changed, 187 insertions(+), 175 deletions(-)
 create mode 100644 patches/bing_src-1.1.3/0001-Adapt-makefile-for-Linux-add-destdir-support.patch
 create mode 100644 patches/bing_src-1.1.3/0002-bing_1.1.3-2.diff.patch
 delete mode 100644 patches/bing_src-1.1.3/adapt_makefile_for_linux.diff
 delete mode 100644 patches/bing_src-1.1.3/bing_1.1.3-2.diff
 delete mode 100644 patches/bing_src-1.1.3/series

diff --git a/patches/bing_src-1.1.3/0001-Adapt-makefile-for-Linux-add-destdir-support.patch b/patches/bing_src-1.1.3/0001-Adapt-makefile-for-Linux-add-destdir-support.patch
new file mode 100644
index 0000000..745704f
--- /dev/null
+++ b/patches/bing_src-1.1.3/0001-Adapt-makefile-for-Linux-add-destdir-support.patch
@@ -0,0 +1,66 @@
+From 46a7925ba445f1e92dfb467bd714073ea5c1459f Mon Sep 17 00:00:00 2001
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Date: Sat, 29 Oct 2011 18:55:06 +0200
+Subject: [PATCH 1/2] Adapt makefile for Linux, add destdir support
+
+Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ Makefile |   16 ++++++++--------
+ 1 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 0964851..4281cb4 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,9 +9,9 @@
+ #
+ ##########
+ 
+-BINDIR=/usr/local/bin
+-MANDIR=/usr/local/man
+-
++PREFIX ?= /usr
++BINDIR = $(PREFIX)/sbin
++MANDIR = $(PREFIX)/man
+ 
+ ##########
+ #
+@@ -21,7 +21,7 @@ MANDIR=/usr/local/man
+ 
+ # Uncomment if you need the 4.4 BSD compatibility includes.
+ #  -> required on Linux (and Win32)
+-#COMPAT_INCS = -Iinclude
++COMPAT_INCS = -Iinclude
+ 
+ # Maybe specify some specific compatibility options
+ #  -> on AIX activate the BSD mode
+@@ -37,7 +37,7 @@ MANDIR=/usr/local/man
+ 
+ # Define to use srandom/random rather than srand/rand
+ #  -> required on SunOS 4.1.3, SunOS 5, AIX 2 (BOSX 2 really), OSF1 V2.0
+-NO_SNPRINTF = -DNO_SNPRINTF=1
++#NO_SNPRINTF = -DNO_SNPRINTF=1
+ 
+ # Define if you lack strerror()
+ #NO_STRERROR = -DNO_STRERROR=1
+@@ -47,7 +47,7 @@ NO_SNPRINTF = -DNO_SNPRINTF=1
+ #  -> if you want to debug bing define
+ #COPTIM = -g
+ #  -> on Linux, SunOS 4 and OSF1 V2.0 you may specify
+-#COPTIM = -O2
++COPTIM = -O2
+ #  -> on Solaris you may use
+ #COPTIM = -O
+ # on some hosts like AIX, HP-UX the optimisation options are already set
+@@ -109,5 +109,5 @@ clean:
+ 	$(RM) -f bing bing.ps bing.0 $(OBJS)
+ 
+ install: bing unix/bing.8
+-	$(INSTALL) -m 644 -o man -g man unix/bing.8 $(MANDIR)/man8
+-	$(INSTALL) -m 4555 -o root -g staff bing $(BINDIR)
++	$(INSTALL) -m 644 unix/bing.8 $(DESTDIR)$(MANDIR)/man8
++	$(INSTALL) -m 4555 -o root bing $(DESTDIR)$(BINDIR)
+-- 
+1.7.7
+
diff --git a/patches/bing_src-1.1.3/0002-bing_1.1.3-2.diff.patch b/patches/bing_src-1.1.3/0002-bing_1.1.3-2.diff.patch
new file mode 100644
index 0000000..5ccd6d5
--- /dev/null
+++ b/patches/bing_src-1.1.3/0002-bing_1.1.3-2.diff.patch
@@ -0,0 +1,121 @@
+From 6e62471f30d379a9592ed2e68c65b5a468191bce Mon Sep 17 00:00:00 2001
+From: unknown author <unknown.author@example.com>
+Date: Sat, 29 Oct 2011 18:55:06 +0200
+Subject: [PATCH 2/2] bing_1.1.3-2.diff
+
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ bing.c |   63 ++++++++++++++++++++++++++++++---------------------------------
+ 1 files changed, 30 insertions(+), 33 deletions(-)
+
+diff --git a/bing.c b/bing.c
+index aa078f9..e1094e9 100644
+--- a/bing.c
++++ b/bing.c
+@@ -104,7 +104,9 @@ static char rcsid[] = "$Id: bing.c,v 1.17 1997/01/23 21:00:03 pb Exp $";
+ #include <math.h>
+ 
+ /* More specific includes/declarations */
++#ifndef __GNU__
+ #include <limits.h>
++#endif /* __GNU__ */
+ #include <ctype.h>
+ #include <string.h>
+ #include <memory.h>
+@@ -152,7 +154,9 @@ char* __progname;
+  * standard libraries.
+  */
+ #include <netinet/ip.h>
++#ifndef __GNU__
+ #include <netinet/ip_var.h>
++#endif /* __GNU__ */
+ #include <netinet/ip_icmp.h>
+ 
+ #include "mod_icmp.h"
+@@ -320,9 +324,7 @@ struct timestats {
+ 
+ struct hoststats {
+ 	/* Host info */
+-	char hnamebuf[MAXHOSTNAMELEN];
+ 	char *hostname;
+-	struct sockaddr_in whereto;
+ 	struct sockaddr_in *to;
+ 	struct timestats *ts;
+ };
+@@ -365,28 +367,19 @@ void set_ip(hs, target)
+ 	struct hoststats *hs;
+ 	char *target;
+ {
+-	struct hostent *hp;
++	struct addrinfo hints, *ai;
++	int r;
+ 
+-	hs->to = &hs->whereto;
+-
+-	memset((char *)hs->to, 0, sizeof(struct sockaddr_in));
+-	hs->to->sin_family = AF_INET;
+-	hs->to->sin_addr.s_addr = inet_addr(target);
+-	if (hs->to->sin_addr.s_addr != (u_int)-1)
+-		hs->hostname = target;
+-	else {
+-		hp = gethostbyname(target);
+-		if (!hp) {
+-			(void)fprintf(stderr,
+-			    "bing: unknown host %s\n", target);
+-			exit(1);
+-		}
+-		hs->to->sin_family = hp->h_addrtype;
+-		memcpy((caddr_t)&hs->to->sin_addr, hp->h_addr, hp->h_length);
+-		strncpy(hs->hnamebuf, hp->h_name, sizeof(hs->hnamebuf) - 1);
+-		hs->hnamebuf[sizeof(hs->hnamebuf)-1] = '\0';
+-		hs->hostname = hs->hnamebuf;
++	memset(&hints, 0, sizeof hints);
++	hints.ai_family = AF_INET;
++	hints.ai_flags = AI_CANONNAME;
++	if((r = getaddrinfo(target, NULL, &hints, &ai))) {
++		fprintf(stderr, "bing: couldn't resolve %s: %s\n",
++				target, gai_strerror(r));
++		exit(1);
+ 	}
++	hs->to = (struct sockaddr_in *) ai->ai_addr;
++	hs->hostname = ai->ai_canonname;
+ }
+ 
+ void randomfill(bp, len, seed)
+@@ -677,18 +670,22 @@ char *
+ pr_addr(l)
+ 	u_long l;
+ {
+-	struct hostent *hp;
+-	static char buf[80];
++	static char buf[MAXHOSTNAMELEN+19];
++	struct sockaddr_in sa;
++	int r;
+ 
+-	if ((options & F_NUMERIC) ||
+-	    !(hp = gethostbyaddr((char *)&l, 4, AF_INET)))
+-	    (void)snprintf(snfargs(buf, sizeof(buf), "%s"), 
+-			   inet_ntoa(*(struct in_addr *)&l));
+-	else
+-	    (void)snprintf(snfargs(buf, sizeof(buf), "%s (%s)"),
+-			   hp->h_name,
+-			   inet_ntoa(*(struct in_addr *)&l));
+-	return(buf);
++	sa.sin_family = AF_INET;
++	sa.sin_port = 0;
++	memcpy(&sa.sin_addr, &l, sizeof l);
++
++	r = getnameinfo((struct sockaddr *) &sa, sizeof sa, buf, sizeof buf,
++			NULL, 0, (options & F_NUMERIC) ? NI_NUMERICHOST : 0);
++	if(r) {
++		fprintf(stderr, "bing: getaddrinfo: %s\n", gai_strerror(r));
++		exit(1);
++	}
++
++	return buf;
+ }
+ 
+ /*
+-- 
+1.7.7
+
diff --git a/patches/bing_src-1.1.3/adapt_makefile_for_linux.diff b/patches/bing_src-1.1.3/adapt_makefile_for_linux.diff
deleted file mode 100644
index cb25b4b..0000000
--- a/patches/bing_src-1.1.3/adapt_makefile_for_linux.diff
+++ /dev/null
@@ -1,64 +0,0 @@
-From: Wolfram Sang <w.sang@pengutronix.de>
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Subject: Adapt makefile for Linux, add destdir support
-
-Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
-# 20081124: wsa: there is no upstream anymore :(
-
- Makefile |   16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-Index: Makefile
-===================================================================
---- Makefile.orig
-+++ Makefile
-@@ -9,9 +9,9 @@
- #
- ##########
- 
--BINDIR=/usr/local/bin
--MANDIR=/usr/local/man
--
-+PREFIX ?= /usr
-+BINDIR = $(PREFIX)/sbin
-+MANDIR = $(PREFIX)/man
- 
- ##########
- #
-@@ -21,7 +21,7 @@ MANDIR=/usr/local/man
- 
- # Uncomment if you need the 4.4 BSD compatibility includes.
- #  -> required on Linux (and Win32)
--#COMPAT_INCS = -Iinclude
-+COMPAT_INCS = -Iinclude
- 
- # Maybe specify some specific compatibility options
- #  -> on AIX activate the BSD mode
-@@ -37,7 +37,7 @@ MANDIR=/usr/local/man
- 
- # Define to use srandom/random rather than srand/rand
- #  -> required on SunOS 4.1.3, SunOS 5, AIX 2 (BOSX 2 really), OSF1 V2.0
--NO_SNPRINTF = -DNO_SNPRINTF=1
-+#NO_SNPRINTF = -DNO_SNPRINTF=1
- 
- # Define if you lack strerror()
- #NO_STRERROR = -DNO_STRERROR=1
-@@ -47,7 +47,7 @@ NO_SNPRINTF = -DNO_SNPRINTF=1
- #  -> if you want to debug bing define
- #COPTIM = -g
- #  -> on Linux, SunOS 4 and OSF1 V2.0 you may specify
--#COPTIM = -O2
-+COPTIM = -O2
- #  -> on Solaris you may use
- #COPTIM = -O
- # on some hosts like AIX, HP-UX the optimisation options are already set
-@@ -109,5 +109,5 @@ clean:
- 	$(RM) -f bing bing.ps bing.0 $(OBJS)
- 
- install: bing unix/bing.8
--	$(INSTALL) -m 644 -o man -g man unix/bing.8 $(MANDIR)/man8
--	$(INSTALL) -m 4555 -o root -g staff bing $(BINDIR)
-+	$(INSTALL) -m 644 unix/bing.8 $(DESTDIR)$(MANDIR)/man8
-+	$(INSTALL) -m 4555 -o root bing $(DESTDIR)$(BINDIR)
diff --git a/patches/bing_src-1.1.3/bing_1.1.3-2.diff b/patches/bing_src-1.1.3/bing_1.1.3-2.diff
deleted file mode 100644
index 3e50174..0000000
--- a/patches/bing_src-1.1.3/bing_1.1.3-2.diff
+++ /dev/null
@@ -1,109 +0,0 @@
-From: http://ftp.de.debian.org/debian/pool/main/b/bing/bing_1.1.3-2.diff.gz
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---- bing-1.1.3.orig/bing.c
-+++ bing-1.1.3/bing.c
-@@ -104,7 +104,9 @@
- #include <math.h>
- 
- /* More specific includes/declarations */
-+#ifndef __GNU__
- #include <limits.h>
-+#endif /* __GNU__ */
- #include <ctype.h>
- #include <string.h>
- #include <memory.h>
-@@ -152,7 +154,9 @@
-  * standard libraries.
-  */
- #include <netinet/ip.h>
-+#ifndef __GNU__
- #include <netinet/ip_var.h>
-+#endif /* __GNU__ */
- #include <netinet/ip_icmp.h>
- 
- #include "mod_icmp.h"
-@@ -320,9 +324,7 @@
- 
- struct hoststats {
- 	/* Host info */
--	char hnamebuf[MAXHOSTNAMELEN];
- 	char *hostname;
--	struct sockaddr_in whereto;
- 	struct sockaddr_in *to;
- 	struct timestats *ts;
- };
-@@ -365,28 +367,19 @@
- 	struct hoststats *hs;
- 	char *target;
- {
--	struct hostent *hp;
-+	struct addrinfo hints, *ai;
-+	int r;
- 
--	hs->to = &hs->whereto;
--
--	memset((char *)hs->to, 0, sizeof(struct sockaddr_in));
--	hs->to->sin_family = AF_INET;
--	hs->to->sin_addr.s_addr = inet_addr(target);
--	if (hs->to->sin_addr.s_addr != (u_int)-1)
--		hs->hostname = target;
--	else {
--		hp = gethostbyname(target);
--		if (!hp) {
--			(void)fprintf(stderr,
--			    "bing: unknown host %s\n", target);
--			exit(1);
--		}
--		hs->to->sin_family = hp->h_addrtype;
--		memcpy((caddr_t)&hs->to->sin_addr, hp->h_addr, hp->h_length);
--		strncpy(hs->hnamebuf, hp->h_name, sizeof(hs->hnamebuf) - 1);
--		hs->hnamebuf[sizeof(hs->hnamebuf)-1] = '\0';
--		hs->hostname = hs->hnamebuf;
-+	memset(&hints, 0, sizeof hints);
-+	hints.ai_family = AF_INET;
-+	hints.ai_flags = AI_CANONNAME;
-+	if((r = getaddrinfo(target, NULL, &hints, &ai))) {
-+		fprintf(stderr, "bing: couldn't resolve %s: %s\n",
-+				target, gai_strerror(r));
-+		exit(1);
- 	}
-+	hs->to = (struct sockaddr_in *) ai->ai_addr;
-+	hs->hostname = ai->ai_canonname;
- }
- 
- void randomfill(bp, len, seed)
-@@ -677,18 +670,22 @@
- pr_addr(l)
- 	u_long l;
- {
--	struct hostent *hp;
--	static char buf[80];
-+	static char buf[MAXHOSTNAMELEN+19];
-+	struct sockaddr_in sa;
-+	int r;
-+
-+	sa.sin_family = AF_INET;
-+	sa.sin_port = 0;
-+	memcpy(&sa.sin_addr, &l, sizeof l);
-+
-+	r = getnameinfo((struct sockaddr *) &sa, sizeof sa, buf, sizeof buf,
-+			NULL, 0, (options & F_NUMERIC) ? NI_NUMERICHOST : 0);
-+	if(r) {
-+		fprintf(stderr, "bing: getaddrinfo: %s\n", gai_strerror(r));
-+		exit(1);
-+	}
- 
--	if ((options & F_NUMERIC) ||
--	    !(hp = gethostbyaddr((char *)&l, 4, AF_INET)))
--	    (void)snprintf(snfargs(buf, sizeof(buf), "%s"), 
--			   inet_ntoa(*(struct in_addr *)&l));
--	else
--	    (void)snprintf(snfargs(buf, sizeof(buf), "%s (%s)"),
--			   hp->h_name,
--			   inet_ntoa(*(struct in_addr *)&l));
--	return(buf);
-+	return buf;
- }
- 
- /*
diff --git a/patches/bing_src-1.1.3/series b/patches/bing_src-1.1.3/series
deleted file mode 100644
index c6b8048..0000000
--- a/patches/bing_src-1.1.3/series
+++ /dev/null
@@ -1,2 +0,0 @@
-adapt_makefile_for_linux.diff -p0
-bing_1.1.3-2.diff
-- 
1.7.7


-- 
ptxdist mailing list
ptxdist@pengutronix.de

  parent reply	other threads:[~2011-10-30 22:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-30 22:00 [ptxdist] Patch cleanup Robert Schwebel
2011-10-30 22:00 ` [ptxdist] [PATCH 01/28] canfestival: clean up patches Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 02/28] devicekit-disks: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 03/28] mplayer: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 04/28] policykit: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 05/28] sdl: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 06/28] sdl-mixer: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 07/28] atop: " Robert Schwebel
2011-10-30 22:00   ` Robert Schwebel [this message]
2011-10-30 22:00   ` [ptxdist] [PATCH 09/28] bridge-utils: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 10/28] bzip2: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 11/28] cbmbasic: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 12/28] cpufrequtils: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 13/28] cvs: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 14/28] daemonize: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 15/28] dibbler: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 16/28] e2fsprogs: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 17/28] efax: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 18/28] eggdbus: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 19/28] elektra: remove orphaned package Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 20/28] etherwake: clean up patches Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 21/28] fakeroot: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 22/28] fbtest: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 23/28] font-alias: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 24/28] freetype: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 25/28] glademm: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 26/28] gpsd: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 27/28] gst-plugins-gl: " Robert Schwebel
2011-10-30 22:00   ` [ptxdist] [PATCH 28/28] gtk: " Robert Schwebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320012059-24971-8-git-send-email-r.schwebel@pengutronix.de \
    --to=r.schwebel@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox