Skip to content

Commit

Permalink
Revert "Be explicit about versions"
Browse files Browse the repository at this point in the history
This reverts commit 61a1fd5.
  • Loading branch information
Peter van Dijk committed May 7, 2013
1 parent 38e0a9a commit 30ea693
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 88 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ ltversion.m4
lt~obsolete.m4
pdns-*.tar.gz
.*DS_Store
VERSION
2 changes: 1 addition & 1 deletion build-scripts/jenkins-driver
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ then
DESC="${DESC} (${PDNS_TAG})"
fi
java -jar /shared/jenkins-cli.jar set-build-display-name ${JOB_NAME} ${BUILD_NUMBER} "${DESC}"
fi
fi
9 changes: 1 addition & 8 deletions build-scripts/set-version-auth
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ DEB_VERSION=$2
RPM_VERSION=$3
[ -z "$VERSION" -o -z "$DEB_VERSION" -o -z "$RPM_VERSION" ] && exit 1

DIST_HOST="$(id -u -n)@$(hostname -f)"

ssed -r "s/Version: (.*)/Version: $RPM_VERSION/" -i pdns.spec
ssed -r "s/AC_INIT\\(\\[pdns\\],\\[(.*)\\]\\)/AC_INIT\([pdns],[$VERSION\])/" -i configure.ac
ssed -r "1 s/^pdns \\(([^)]*)-([0-9.])\\)/pdns \\($DEB_VERSION-\\2\\)/" -i debian-pdns/changelog

cat >VERSION <<EOF
# This file is automatically generated by set-version-auth, DO NOT EDIT.
VERSION="$VERSION"
DIST_HOST="$DIST_HOST"
EOF
3 changes: 0 additions & 3 deletions build-scripts/set-version-recursor
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ DEB_VERSION=$2
RPM_VERSION=$3
[ -z "$VERSION" -o -z "$DEB_VERSION" -o -z "$RPM_VERSION" ] && exit 1

DIST_HOST="$(id -u -n)@$(hostname -f)"

ssed -r "s/^VERSION=(.*)/VERSION=$VERSION/" -i pdns/dist-recursor
ssed -r "s/^DIST_HOST=(.*)/DIST_HOST=$DIST_HOST/" -i pdns/dist-recursor
ssed -r "s/Version: (.*)/Version: $RPM_VERSION/" -i pdns/pdns-recursor.spec
9 changes: 1 addition & 8 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dnl intro
AC_INIT([pdns], m4_esyscmd_s([test -f ./VERSION && (. ./VERSION; echo $VERSION) || (git describe --always 2>/dev/null || echo "exported")]))
AC_INIT([pdns],[3.2])
AC_CONFIG_SRCDIR([pdns/receiver.cc])
AM_INIT_AUTOMAKE([tar-ustar])
AC_CANONICAL_HOST
Expand All @@ -20,13 +20,6 @@ AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_LANG_CPLUSPLUS

AC_DEFINE([DIST_HOST], m4_esyscmd_s([test -f ./VERSION && (. ./VERSION; echo \"$DIST_HOST\") || (echo \"$(id -u -n)@$(hostname -f)\")]), [Where sources were built.])

build_date=$(LC_TIME=C date '+%Y%m%d%H%M%S')
AC_DEFINE_UNQUOTED([BUILD_DATE], ["$build_date"], [When binaries were built.])
build_host=$(id -u -n)@$(hostname -f)
AC_DEFINE_UNQUOTED([BUILD_HOST], ["$build_host"], [Where binaries were built.])

BOOST_REQUIRE([1.34])
BOOST_FOREACH
#BOOST_FILESYSTEM([mt])
Expand Down
5 changes: 0 additions & 5 deletions pdns/Makefile-recursor
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ CC?=gcc

# Lua 5.1 settings

BUILD_DATE=$(shell LC_TIME=C date '+%Y%m%d%H%M%S')
BUILD_HOST=$(shell id -u -n)@$(shell hostname -f)
CFLAGS:=$(CFLAGS) -DBUILD_HOST=\"$(BUILD_HOST)\" -DBUILD_DATE=\"$(BUILD_DATE)\"
CXXFLAGS:=$(CXXFLAGS) -DBUILD_HOST=\"$(BUILD_HOST)\" -DBUILD_DATE=\"$(BUILD_DATE)\"

# static dependencies

PDNS_RECURSOR_OBJECTS=syncres.o misc.o unix_utility.o qtype.o logger.o \
Expand Down
1 change: 1 addition & 0 deletions pdns/config-recursor.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define SYSCONFDIR "/etc/powerdns/"
#define LOCALSTATEDIR "/var/run/"
#define VERSION "3.5.1"
#define RECURSOR
19 changes: 1 addition & 18 deletions pdns/dist-recursor
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,7 @@ set -e

ragel dnslabeltext.rl -o dnslabeltext.cc

## The following lines will be patched by set-version-recursor.
VERSION=""
DIST_HOST=""
## End patch area.

if [ -z "$VERSION" ]; then
VERSION=$(git rev-parse HEAD 2>/dev/null)
if [ -z "$VERSION" ]; then
VERSION="exported"
else
VERSION="git-"$VERSION
fi
DIST_HOST="$(id -u -n)@$(hostname -f)"
fi
VERSION=3.5.1

INCLUDES="iputils.hh arguments.hh base64.hh zoneparser-tng.hh \
rcpgenerator.hh lock.hh dnswriter.hh dnsrecords.hh dnsparser.hh utility.hh \
Expand Down Expand Up @@ -50,10 +37,6 @@ cp Makefile-recursor.win32 $DIRNAME/Makefile.win32
cp README-recursor $DIRNAME/README
cp ../COPYING $DIRNAME/
cp config-recursor.h $DIRNAME/config.h
cat >>$DIRNAME/config.h <<EOF
#define VERSION "$VERSION"
#define DIST_HOST "$DIST_HOST"
EOF
mkdir -p $DIRNAME/ext/rapidjson/include/rapidjson/internal
cp -a ext/rapidjson/include/rapidjson/*.h $DIRNAME/ext/rapidjson/include/rapidjson/
cp -a ext/rapidjson/include/rapidjson/internal/*.h $DIRNAME/ext/rapidjson/include/rapidjson/internal
Expand Down
25 changes: 0 additions & 25 deletions pdns/misc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <sys/types.h>
#include "utility.hh"
#include <boost/algorithm/string.hpp>
#include "logger.hh"

bool g_singleThreaded;

Expand Down Expand Up @@ -784,27 +783,3 @@ Regex::Regex(const string &expr)
if(regcomp(&d_preg, expr.c_str(), REG_ICASE|REG_NOSUB|REG_EXTENDED))
throw AhuException("Regular expression did not compile");
}

string compilerVersion()
{
#if defined(__clang__)
// clang defines __GNUC__ as well, so put it first.
return string("clang "__clang__version);
#elif defined(__GNUC__)
return string("gcc "__VERSION__);
#elif defined(_MSC_VER)
return string("MSVC "<<_MSC_VER);
#endif // add other compilers here
return string("Unknown compiler");
}

void showProductVersion(string product)
{
L<<Logger::Warning<<"PowerDNS "<<product<<" "<<VERSION<<" ("DIST_HOST") "
"(C) 2001-2013 PowerDNS.COM BV" << endl;
L<<Logger::Warning<<"Using "<<(sizeof(unsigned long)*8)<<"-bits mode. "
"Built on "BUILD_DATE" by "BUILD_HOST", "<<compilerVersion()<<"."<<endl;
L<<Logger::Warning<<"PowerDNS comes with ABSOLUTELY NO WARRANTY. "
"This is free software, and you are welcome to redistribute it "
"according to the terms of the GPL version 2." << endl;
}
2 changes: 0 additions & 2 deletions pdns/misc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ uint16_t getShort(const char *p);
uint32_t getLong(const unsigned char *p);
uint32_t getLong(const char *p);
int logFacilityToLOG(unsigned int facility);
string compilerVersion();
void showProductVersion(string product);

struct ServiceTuple
{
Expand Down
2 changes: 1 addition & 1 deletion pdns/packethandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ int PacketHandler::doVersionRequest(DNSPacket *p, DNSPacket *r, string &target)
const static string mode=::arg()["version-string"];

if(mode.empty() || mode=="full")
rr.content="Served by PowerDNS "VERSION" "DIST_HOST" built "BUILD_DATE" "BUILD_HOST;
rr.content="Served by POWERDNS "VERSION" $Id$";
else if(mode=="anonymous") {
r->setRcode(RCode::ServFail);
return 1;
Expand Down
26 changes: 17 additions & 9 deletions pdns/pdns_recursor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1652,11 +1652,6 @@ void parseACLs()
l_initialized = true;
}

static void showServiceVersion()
{
showProductVersion("Recursor");
}

int serviceMain(int argc, char*argv[])
{
L.setName("pdns_recursor");
Expand All @@ -1671,7 +1666,20 @@ int serviceMain(int argc, char*argv[])
L<<Logger::Error<<"Unknown logging facility "<<::arg().asNum("logging-facility") <<endl;
}

showServiceVersion();
L<<Logger::Warning<<"PowerDNS recursor "<<VERSION<<" (C) 2001-2013 PowerDNS.COM BV ("<<__DATE__", "__TIME__;
#ifdef __GNUC__
L<<", gcc "__VERSION__;
#endif // add other compilers here
#ifdef _MSC_VER
L<<", MSVC "<<_MSC_VER;
#endif
L<<") starting up"<<endl;

L<<Logger::Warning<<"PowerDNS comes with ABSOLUTELY NO WARRANTY. "
"This is free software, and you are welcome to redistribute it "
"according to the terms of the GPL version 2."<<endl;

L<<Logger::Warning<<"Operating in "<<(sizeof(unsigned long)*8) <<" bits mode"<<endl;

#if 0
unsigned int maxFDs, curFDs;
Expand Down Expand Up @@ -2052,7 +2060,7 @@ int main(int argc, char **argv)
::arg().set("packetcache-servfail-ttl", "maximum number of seconds to keep a cached servfail entry in packetcache")="60";
::arg().set("server-id", "Returned when queried for 'server.id' TXT or NSID, defaults to hostname")="";
::arg().set("remotes-ringbuffer-entries", "maximum number of packets to store statistics for")="0";
::arg().set("version-string", "string reported on version.pdns or version.bind")="PowerDNS Recursor "VERSION" "DIST_HOST" built "BUILD_DATE" "BUILD_HOST;
::arg().set("version-string", "string reported on version.pdns or version.bind")="PowerDNS Recursor "VERSION" $Id$";
::arg().set("allow-from", "If set, only allow these comma separated netmasks to recurse")=LOCAL_NETS;
::arg().set("allow-from-file", "If set, load allowed netmasks from this file")="";
::arg().set("entropy-source", "If set, read entropy from this file")="/dev/urandom";
Expand All @@ -2077,7 +2085,7 @@ int main(int argc, char **argv)


::arg().setCmd("help","Provide a helpful message");
::arg().setCmd("version","Print version string");
::arg().setCmd("version","Print version string ("VERSION")");
::arg().setCmd("config","Output blank configuration");
L.toConsole(Logger::Info);
::arg().laxParse(argc,argv); // do a lax parse
Expand All @@ -2104,7 +2112,7 @@ int main(int argc, char **argv)
exit(99);
}
if(::arg().mustDo("version")) {
showServiceVersion();
cerr<<"version: "VERSION<<endl;
exit(99);
}

Expand Down
22 changes: 16 additions & 6 deletions pdns/receiver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,7 @@ static void loadModules()
}
}

static void showServiceVersion()
{
showProductVersion("Authoritative Server");
}


#ifdef __linux__
#include <execinfo.h>
Expand Down Expand Up @@ -424,7 +421,11 @@ int main(int argc, char **argv)
::arg().laxParse(argc,argv); // do a lax parse

if(::arg().mustDo("version")) {
showServiceVersion();
cerr<<"Version: "VERSION", compiled on "<<__DATE__", "__TIME__;
#ifdef __GNUC__
cerr<<" with gcc version "<<__VERSION__;
#endif
cout<<endl;
exit(99);
}

Expand Down Expand Up @@ -583,8 +584,17 @@ int main(int argc, char **argv)

declareStats();
DLOG(L<<Logger::Warning<<"Verbose logging in effect"<<endl);

L<<Logger::Warning<<"PowerDNS "<<VERSION<<" (C) 2001-2013 PowerDNS.COM BV ("<<__DATE__", "__TIME__;
#ifdef __GNUC__
L<<", gcc "__VERSION__;
#endif // add other compilers here
L<<") starting up"<<endl;

L<<Logger::Warning<<"PowerDNS comes with ABSOLUTELY NO WARRANTY. "
"This is free software, and you are welcome to redistribute it "
"according to the terms of the GPL version 2."<<endl;

showServiceVersion();

try {

Expand Down
2 changes: 1 addition & 1 deletion pdns/ws.cc
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ string StatWebServer::indexfunction(const string& method, const string& post, co
printtable(ret,rvarmap["ring"],S.getRingTitle(rvarmap["ring"]),100);

ret<<"</div></div>"<<endl;
ret<<"<footer class=\"row\">PowerDNS Authoritative Server "VERSION" ("DIST_HOST" built "BUILD_DATE" by "BUILD_HOST"). &copy; 2013 <a href=\"http://www.powerdns.com/\">PowerDNS.COM BV</a>.</footer>"<<endl;
ret<<"<footer class=\"row\">PowerDNS Authoritative Server "VERSION". &copy; 2013 <a href=\"http://www.powerdns.com/\">PowerDNS.COM BV</a>.</footer>"<<endl;
ret<<"</body></html>"<<endl;

return ret.str();
Expand Down

0 comments on commit 30ea693

Please sign in to comment.