[arch-commits] Commit in networkmanager/trunk (PKGBUILD dnsmasq-path.patch)

Jan Steffens heftig at nymeria.archlinux.org
Mon May 13 07:07:47 EDT 2013


    Date: Monday, May 13, 2013 @ 13:07:47
  Author: heftig
Revision: 185327

Update dnsmasq patch with one sent upstream

Modified:
  networkmanager/trunk/PKGBUILD
  networkmanager/trunk/dnsmasq-path.patch

--------------------+
 PKGBUILD           |   11 +++--
 dnsmasq-path.patch |   98 ++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 85 insertions(+), 24 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2013-05-13 10:37:16 UTC (rev 185326)
+++ PKGBUILD	2013-05-13 11:07:47 UTC (rev 185327)
@@ -31,15 +31,17 @@
 sha256sums=('c366bcded6354d8186ad93c05d26d6a20bc550aa0391f974704e7a60e9f6096b'
             '44b048804c7c0b8b3b0c29b8632b6ad613c397d0a1635ec918e10c0fbcdadf21'
             '25056837ea92e559f09563ed817e3e0cd9333be861b8914e45f62ceaae2e0460'
-            '65124505048cc8396daf0242c9f5d532fa669b4bbca305998c248ab2329490cb')
+            'bc0291f09bbb3aa646af6927a7de64c964f0179cf02b013019b1ac7d49ea6caf')
 
-build() {
+prepare() {
   cd $_pkgname-$pkgver
-
   patch -Np1 -i ../disable_set_hostname.patch
   patch -Np1 -i ../dnsmasq-path.patch
-  #AUTOPOINT="intltoolize -f -c --automake" autoreconf -fi
+  AUTOPOINT="intltoolize -f -c --automake" autoreconf -fi
+}
 
+build() {
+  cd $_pkgname-$pkgver
   ./configure \
     --prefix=/usr \
     --sysconfdir=/etc \
@@ -49,6 +51,7 @@
     --with-dhclient=/usr/sbin/dhclient \
     --with-dhcpcd=/usr/sbin/dhcpcd \
     --with-iptables=/usr/sbin/iptables \
+    --with-dnsmasq=/usr/bin/dnsmasq \
     --with-systemdsystemunitdir=/usr/lib/systemd/system \
     --with-udev-dir=/usr/lib/udev \
     --with-resolvconf=/usr/sbin/resolvconf \

Modified: dnsmasq-path.patch
===================================================================
--- dnsmasq-path.patch	2013-05-13 10:37:16 UTC (rev 185326)
+++ dnsmasq-path.patch	2013-05-13 11:07:47 UTC (rev 185327)
@@ -1,30 +1,88 @@
-diff -u -r NetworkManager-0.9.2.0/src/dns-manager/nm-dns-dnsmasq.c NetworkManager-0.9.2.0-dnsmasq/src/dns-manager/nm-dns-dnsmasq.c
---- NetworkManager-0.9.2.0/src/dns-manager/nm-dns-dnsmasq.c	2011-10-10 23:38:20.000000000 +0200
-+++ NetworkManager-0.9.2.0-dnsmasq/src/dns-manager/nm-dns-dnsmasq.c	2012-03-06 09:07:24.137460927 +0100
-@@ -52,8 +52,11 @@
- find_dnsmasq (void)
+diff --git i/configure.ac w/configure.ac
+index 38f2138..5ccc47d 100644
+--- i/configure.ac
++++ w/configure.ac
+@@ -573,6 +573,16 @@ fi
+ AC_DEFINE_UNQUOTED(IPTABLES_PATH, "$IPTABLES_PATH", [Define to path of iptables binary])
+ AC_SUBST(IPTABLES_PATH)
+ 
++# dnsmasq path
++AC_ARG_WITH(dnsmasq, AS_HELP_STRING([--with-dnsmasq=/path/to/dnsmasq], [path to dnsmasq]))
++if test "x${with_dnsmasq}" = x; then
++  AC_PATH_PROG(DNSMASQ_PATH, dnsmasq, [], $PATH:/sbin:/usr/sbin)
++else
++  DNSMASQ_PATH="$with_dnsmasq"
++fi
++AC_DEFINE_UNQUOTED(DNSMASQ_PATH, "$DNSMASQ_PATH", [Define to path of dnsmasq binary])
++AC_SUBST(DNSMASQ_PATH)
++
+ # system CA certificates path
+ AC_ARG_WITH(system-ca-path, AS_HELP_STRING([--with-system-ca-path=/path/to/ssl/certs], [path to system CA certificates])) 
+ if test "x${with_system_ca_path}" = x; then
+diff --git i/src/dns-manager/nm-dns-dnsmasq.c w/src/dns-manager/nm-dns-dnsmasq.c
+index 61b08c6..50c98bc 100644
+--- i/src/dns-manager/nm-dns-dnsmasq.c
++++ w/src/dns-manager/nm-dns-dnsmasq.c
+@@ -50,7 +50,7 @@ typedef struct {
+ /*******************************************/
+ 
+ static inline const char *
+-find_dnsmasq (void)
++find_dnsmasq (const char *try_first)
  {
  	static const char *paths[] = {
-+		"/usr/local/bin/dnsmasq",
  		"/usr/local/sbin/dnsmasq",
-+		"/usr/bin/dnsmasq",
- 		"/usr/sbin/dnsmasq",
-+		"/bin/dnsmasq",
- 		"/sbin/dnsmasq",
- 		NULL
+@@ -60,6 +60,9 @@ find_dnsmasq (void)
  	};
-diff -u -r NetworkManager-0.9.2.0/src/dnsmasq-manager/nm-dnsmasq-manager.c NetworkManager-0.9.2.0-dnsmasq/src/dnsmasq-manager/nm-dnsmasq-manager.c
---- NetworkManager-0.9.2.0/src/dnsmasq-manager/nm-dnsmasq-manager.c	2011-04-19 07:06:22.000000000 +0200
-+++ NetworkManager-0.9.2.0-dnsmasq/src/dnsmasq-manager/nm-dnsmasq-manager.c	2012-03-06 09:07:58.603851818 +0100
-@@ -170,8 +170,11 @@
- nm_find_dnsmasq (void)
+ 	const char **binary = paths;
+ 
++	if (strlen (try_first) && g_file_test (try_first, G_FILE_TEST_EXISTS))
++		return try_first;
++
+ 	while (*binary != NULL) {
+ 		if (g_file_test (*binary, G_FILE_TEST_EXISTS))
+ 			return *binary;
+@@ -310,7 +313,7 @@ update (NMDnsPlugin *plugin,
+ 	nm_log_dbg (LOGD_DNS, "dnsmasq local caching DNS configuration:");
+ 	nm_log_dbg (LOGD_DNS, "%s", conf->str);
+ 
+-	argv[idx++] = find_dnsmasq ();
++	argv[idx++] = find_dnsmasq (DNSMASQ_PATH);
+ 	argv[idx++] = "--no-resolv";  /* Use only commandline */
+ 	argv[idx++] = "--keep-in-foreground";
+ 	argv[idx++] = "--no-hosts"; /* don't use /etc/hosts to resolve */
+diff --git i/src/dnsmasq-manager/nm-dnsmasq-manager.c w/src/dnsmasq-manager/nm-dnsmasq-manager.c
+index df190dc..5b2ec56 100644
+--- i/src/dnsmasq-manager/nm-dnsmasq-manager.c
++++ w/src/dnsmasq-manager/nm-dnsmasq-manager.c
+@@ -166,7 +166,7 @@ nm_cmd_line_add_string (NMCmdLine *cmd, const char *str)
+ /*******************************************/
+ 
+ static inline const char *
+-nm_find_dnsmasq (void)
++nm_find_dnsmasq (const char *try_first)
  {
  	static const char *dnsmasq_binary_paths[] = {
-+		"/usr/local/bin/dnsmasq",
  		"/usr/local/sbin/dnsmasq",
-+		"/usr/bin/dnsmasq",
- 		"/usr/sbin/dnsmasq",
-+		"/bin/dnsmasq",
+@@ -174,9 +174,11 @@ nm_find_dnsmasq (void)
  		"/sbin/dnsmasq",
  		NULL
  	};
+-
+ 	const char **dnsmasq_binary = dnsmasq_binary_paths;
+ 
++	if (strlen (try_first) && g_file_test (try_first, G_FILE_TEST_EXISTS))
++		return try_first;
++
+ 	while (*dnsmasq_binary != NULL) {
+ 		if (g_file_test (*dnsmasq_binary, G_FILE_TEST_EXISTS))
+ 			break;
+@@ -254,7 +256,7 @@ create_dm_cmd_line (const char *iface,
+ 	char buf[INET_ADDRSTRLEN + 15];
+ 	char localaddr[INET_ADDRSTRLEN + 1];
+ 
+-	dm_binary = nm_find_dnsmasq ();
++	dm_binary = nm_find_dnsmasq (DNSMASQ_PATH);
+ 	if (!dm_binary) {
+ 		g_set_error_literal (error, NM_DNSMASQ_MANAGER_ERROR, NM_DNSMASQ_MANAGER_ERROR_NOT_FOUND,
+ 		                     "Could not find dnsmasq binary.");



More information about the arch-commits mailing list