1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 06:01:28 +00:00

Automatically update the default update channel.

This commit is contained in:
david
2011-12-21 00:00:05 +00:00
parent 1a955d99e4
commit 2dae73f251
3 changed files with 10 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
# Extract the version string from nmap.h. # Extract the version string from nmap.h.
export NMAP_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_VERSION' nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q') export NMAP_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_VERSION' nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q')
export NMAP_UPDATE_CHANNEL := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_UPDATE_CHANNEL' nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q')
NMAP_NAME= Nmap NMAP_NAME= Nmap
NMAP_URL= http://nmap.org NMAP_URL= http://nmap.org
NMAP_PLATFORM=@host@ NMAP_PLATFORM=@host@
@@ -151,6 +152,7 @@ lua_build: $(LIBLUADIR)/Makefile
liblinear_build: $(LIBLINEARDIR)/Makefile liblinear_build: $(LIBLINEARDIR)/Makefile
@echo Compiling liblinear; cd $(LIBLINEARDIR) && $(MAKE) liblinear.a CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" @echo Compiling liblinear; cd $(LIBLINEARDIR) && $(MAKE) liblinear.a CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)"
build-nmap-update: nmap-update/default_channel.h
#$(LIBPCAPDIR)/Makefile: #$(LIBPCAPDIR)/Makefile:
# @echo Configuring libpcap; cd $(LIBPCAPDIR); ./configure # @echo Configuring libpcap; cd $(LIBPCAPDIR); ./configure
@@ -285,6 +287,10 @@ $(NPINGDIR)/nping.h: nmap.h
$(ZENMAPDIR)/zenmapCore/Version.py $(ZENMAPDIR)/share/zenmap/config/zenmap_version: nmap.h $(ZENMAPDIR)/zenmapCore/Version.py $(ZENMAPDIR)/share/zenmap/config/zenmap_version: nmap.h
cd $(ZENMAPDIR) && $(PYTHON) install_scripts/utils/version_update.py "$(NMAP_VERSION)" cd $(ZENMAPDIR) && $(PYTHON) install_scripts/utils/version_update.py "$(NMAP_VERSION)"
nmap-update/default_channel.h: nmap.h
sed -e 's/^#[ \t]*define[ \t]\+DEFAULT_CHANNEL[ \t]\+\(".*"\)/#define DEFAULT_CHANNEL "$(NMAP_UPDATE_CHANNEL)"/' $@ > $@.tmp
mv -f $@.tmp $@
# By default distutils rewrites installed scripts to hardcode the # By default distutils rewrites installed scripts to hardcode the
# location of the Python interpreter they were built with (something # location of the Python interpreter they were built with (something
# like #!/usr/bin/python2.4). This is the wrong thing to do when # like #!/usr/bin/python2.4). This is the wrong thing to do when

View File

@@ -0,0 +1 @@
#define DEFAULT_CHANNEL "5.61TEST2"

View File

@@ -37,7 +37,7 @@
#include <svn_types.h> #include <svn_types.h>
#endif #endif
#define NMAP_VERSION "5.61TEST2" #include "default_channel.h"
#ifdef WIN32 #ifdef WIN32
#define PATHSEP "\\" #define PATHSEP "\\"
@@ -48,7 +48,7 @@
static const char *SVN_REPO = "https://svn.nmap.org"; static const char *SVN_REPO = "https://svn.nmap.org";
static const char *SVN_DIR = "/updates"; static const char *SVN_DIR = "/updates";
static const char *DEFAULT_CHANNELS[] = { NMAP_VERSION }; static const char *DEFAULT_CHANNELS[] = { DEFAULT_CHANNEL };
/* Internal error handling. */ /* Internal error handling. */
@@ -658,7 +658,7 @@ static void usage(FILE *fp)
fprintf(fp, "\ fprintf(fp, "\
Usage: %s [-d INSTALL_DIR] [CHANNEL...]\n\ Usage: %s [-d INSTALL_DIR] [CHANNEL...]\n\
Updates system-independent Nmap files. By default the new files are installed to\n\ Updates system-independent Nmap files. By default the new files are installed to\n\
%s. Each CHANNEL is a version number like \"" NMAP_VERSION "\".\n\ %s. Each CHANNEL is a version number like \"" DEFAULT_CHANNEL "\".\n\
\n\ \n\
-d DIR install files to DIR (default %s).\n\ -d DIR install files to DIR (default %s).\n\
-h, --help show this help.\n\ -h, --help show this help.\n\