]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Paul Wouter's release candidate review:
authorWillem Toorop <willem@NLnetLabs.nl>
Thu, 22 Sep 2011 19:55:11 +0000 (19:55 +0000)
committerWillem Toorop <willem@NLnetLabs.nl>
Thu, 22 Sep 2011 19:55:11 +0000 (19:55 +0000)
Removed ipcalc dependency of ldnsx.
Removed the unused function 'ldns_rr_list_contains_name' from ldns-verify-zone.c
And a very ugly syntax error in Makefile.in

Makefile.in
ax_python_module.m4 [deleted file]
configure.ac
contrib/ldnsx/ldnsx.py
examples/ldns-verify-zone.c

index f05aa4f597e8714f62598226a780080074fc2cad..e1399acc4a5347df16309ee8253861f89aa17dfe 100644 (file)
@@ -199,8 +199,8 @@ destclean:  uninstall
 
 install-config:
        if [ $(INSTALL_LDNS_CONFIG) = "yes" ] ; then \
-               $(INSTALL) -d $(DESTDIR)$(bindir) \
-               $(INSTALL) -c -m 755 packaging/ldns-config $(DESTDIR)$(bindir)/ \
+               $(INSTALL) -d $(DESTDIR)$(bindir) \
+               $(INSTALL) -c -m 755 packaging/ldns-config $(DESTDIR)$(bindir)/ \
        fi
 
 uninstall-config:
@@ -215,8 +215,8 @@ install-manpages:   manpages
                        ${INSTALL} -c -m 444 $$f $(DESTDIR)$(mandir)/man3/; \
                done
                if [ $(INSTALL_LDNS_CONFIG) = "yes" ] ; then \
-                       ${INSTALL} -d $(DESTDIR)$(mandir)/man1 \
-                       ${INSTALL} -c -m 444 packaging/ldns-config.1 $(DESTDIR)$(mandir)/man1/ \
+                       ${INSTALL} -d $(DESTDIR)$(mandir)/man1; \
+                       ${INSTALL} -c -m 444 packaging/ldns-config.1 $(DESTDIR)$(mandir)/man1/; \
                fi
 
 uninstall-manpages:
@@ -224,7 +224,7 @@ uninstall-manpages:
                        rm -f $(DESTDIR)$(mandir)/man3/$$i.3 ; done
                rmdir -p $(DESTDIR)$(mandir)/man3 || echo "ok, dir already gone"
                if [ $(INSTALL_LDNS_CONFIG) = "yes" ] ; then \
-                       rm -f $(DESTDIR)$(mandir)/man1/ldns-config.1 \
+                       rm -f $(DESTDIR)$(mandir)/man1/ldns-config.1; \
                        [ ! -d $(DESTDIR)$(mandir)/man1 ] || rmdir -p $(DESTDIR)$(mandir)/man1 || echo "ok, dir already gone"; \
                fi
 
@@ -242,7 +242,7 @@ uninstall-h:
                rm -f  $(DESTDIR)$(includedir)/ldns/net.h
                rm -f  $(DESTDIR)$(includedir)/ldns/util.h
                rm -f  $(DESTDIR)$(includedir)/ldns/common.h
-               [ ! -d $(DESTDIR)$(includedir)/ldns ] || rmdir -p $(DESTDI)$(includedir)/ldns || echo "ok, dir already gone"
+               [ ! -d $(DESTDIR)$(includedir)/ldns ] || rmdir -p $(DESTDIR)$(includedir)/ldns || echo "ok, dir already gone"
                exit 0
 
 install-lib:   lib
@@ -262,7 +262,7 @@ install-pyldns: @PYLDNS@
 
 uninstall-pyldns:      
                rm -f $(DESTDIR)$(python_site)/ldns/*
-               rmdir -p $(DESTDIR)$(python_site)/ldns
+               rmdir $(DESTDIR)$(python_site)/ldns || echo "ok, dir already gone"
 
 install-pyldnsx:
                $(INSTALL) -c -m 644 $(pyldnsxwrapdir)/ldnsx.py $(DESTDIR)$(python_site)/ldnsx.py
diff --git a/ax_python_module.m4 b/ax_python_module.m4
deleted file mode 100644 (file)
index bd70a06..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-# ===========================================================================
-#     http://www.gnu.org/software/autoconf-archive/ax_python_module.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_PYTHON_MODULE(modname[, fatal])
-#
-# DESCRIPTION
-#
-#   Checks for Python module.
-#
-#   If fatal is non-empty then absence of a module will trigger an error.
-#
-# LICENSE
-#
-#   Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved. This file is offered as-is, without any
-#   warranty.
-
-#serial 5
-
-AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
-AC_DEFUN([AX_PYTHON_MODULE],[
-    if test -z $PYTHON;
-    then
-        PYTHON="python"
-    fi
-    PYTHON_NAME=`basename $PYTHON`
-    AC_MSG_CHECKING($PYTHON_NAME module: $1)
-       $PYTHON -c "import $1" 2>/dev/null
-       if test $? -eq 0;
-       then
-               AC_MSG_RESULT(yes)
-               eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
-       else
-               AC_MSG_RESULT(no)
-               eval AS_TR_CPP(HAVE_PYMOD_$1)=no
-               #
-               if test -n "$2"
-               then
-                       AC_MSG_ERROR(failed to find required module $1)
-                       exit 1
-               fi
-       fi
-])
index c3be2ddae3d579e72a89759e4e34bc7db4353710..8c5187868005997636e9356e69a2538c88c26bc9 100644 (file)
@@ -147,11 +147,6 @@ AC_ARG_WITH(pyldnsx, AC_HELP_STRING([--without-pyldnsx],
   [],[ withval="with_pyldns" ])
 if test x_$withval != x_no; then
   if test x_$ldns_with_pyldns != x_no; then
-    # The python ipcalc module is needed for pyldnsx, but it is not
-    # a build dependency
-    #
-    #sinclude(ax_python_module.m4)
-    #AX_PYTHON_MODULE(ipcalc)
     AC_SUBST(PYLDNSX, "pyldnsx")
   else
     if test x_$withval != x_with_pyldns; then
index 9b59c4b26009f66b034b132f5ce3a7cf99ebd912..ee81b2fdaab2cab792d01db4cbc54e24846935c3 100644 (file)
@@ -1,4 +1,5 @@
-# (c) Christopher Olah <colah@xelerance.com>, 2011. Xelerance <http://www.xelerance.com/>.
+# Copyright (C) Xelerance Corp. <http://www.xelerance.com/>.
+# Author: Christopher Olah <colah@xelerance.com>
 # License: BSD
 
 """ Easy DNS (including DNSSEC) via ldns.
@@ -41,15 +42,7 @@ response, else an error message.
 
 """
 
-import time, sys, calendar, warnings
-try:
-       import ipcalc
-except ImportError:
-       print >> sys.stderr, "ldnsx requires the python-ipcalc"
-       print >> sys.stderr, "Fedora/CentOS: yum install python-ipcalc"
-       print >> sys.stderr, "Debian/Ubuntu: apt-get install python-ipcalc"
-       print >> sys.stderr, "openSUSE: zypper in python-ipcalc"
-       sys.exit(1)
+import time, sys, calendar, warnings, socket
 try:
        import ldns
 except ImportError:
@@ -63,11 +56,14 @@ __version__ = "0.1"
 
 def isValidIP(ipaddr):
        try:
-               bits_to_type = { 32 : 4, 128 : 6}
-               bits = len(ipcalc.IP(ipaddr).bin())
-               return bits_to_type[bits]
+               v4 = socket.inet_pton(socket.AF_INET,ipaddr)
+               return 4
        except:
-               return 0
+               try:
+                       v6 = socket.inet_pton(socket.AF_INET6,ipaddr)
+                       return 6
+               except:
+                       return 0
 
 def query(name, rr_type, rr_class="IN", flags=["RD"], tries = 3, res=None):
        """Convenience function. Creates a resolver and then queries it. Refer to resolver.query() 
index eb19ea18af1d82b3ef67ead06b7dac72b0093121..796e965957c6428262c3bcce05ae073f35fb2148 100644 (file)
@@ -45,20 +45,6 @@ zone_is_nsec3_optout(ldns_rbtree_t *zone_nodes)
        return 0;
 }
 
-static bool
-ldns_rr_list_contains_name(const ldns_rr_list *rr_list,
-                                         const ldns_rdf *name)
-{
-       size_t i;
-       for (i = 0; i < ldns_rr_list_rr_count(rr_list); i++) {
-               if (ldns_dname_compare(name,
-                   ldns_rr_owner(ldns_rr_list_rr(rr_list, i))) == 0) {
-                       return true;
-               }
-       }
-       return false;
-}
-
 static void
 print_type(ldns_rr_type type)
 {