[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Powerguru-commit] [SCM] powerguru branch, master, updated. 4b8448e97628
From: |
Rob Savoye |
Subject: |
[Powerguru-commit] [SCM] powerguru branch, master, updated. 4b8448e97628e47df0a3731d8178022765562847 |
Date: |
Wed, 12 Dec 2018 18:30:16 -0500 (EST) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "powerguru".
The branch, master has been updated
via 4b8448e97628e47df0a3731d8178022765562847 (commit)
via 72ec8402a66f915ebabc8f68900348a1f5d26699 (commit)
via 4bf7ba57bba6743059783e99f32ec9bd8eb8456c (commit)
via ba227a114c428526a3c2d94b005236d0d2d04646 (commit)
via 3b0f4625800c9238dadc64d9710b625c14a86feb (commit)
via f99643cbe3b9036e31a8a9fe30bd8e9d61637879 (commit)
from e612620de9b238dcf401ef8088f479cf7b134620 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=4b8448e97628e47df0a3731d8178022765562847
commit 4b8448e97628e47df0a3731d8178022765562847
Author: Rob Savoye <address@hidden>
Date: Wed Dec 12 16:30:06 2018 -0700
Cross compiling wants to link in libresolve too
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 77be297..4795e1f 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
+# Copyright (C) 2005, 2006-2018
# Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
AUTOMAKE_OPTIONS = # dejagnu
pgd_CPPFLAGS = -Wall -I$(top_srcdir)/lib -I$(top_srcdir)/devices
-pgd_LDADD = ../devices/libpdev.la ../lib/libpguru.la -lpthread
+pgd_LDADD = ../devices/libpdev.la ../lib/libpguru.la -lpthread -lresolv
if BUILD_LIBXML
pgd_CPPFLAGS += $(LIBXML_CPPFLAGS)
http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=72ec8402a66f915ebabc8f68900348a1f5d26699
commit 72ec8402a66f915ebabc8f68900348a1f5d26699
Author: Rob Savoye <address@hidden>
Date: Wed Dec 12 16:29:13 2018 -0700
Improve sysroot handling so it's possible to try different toolchains and
sysroots
diff --git a/configure.ac b/configure.ac
index 500d482..2c20b91 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@ dnl Process this file with autoconf to produce a configure
script.
AC_PREREQ(2.59c)
AC_INIT([Powerguru], [0.5dev])
-AC_CANONICAL_SYSTEM
+dnl AC_CANONICAL_SYSTEM
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
@@ -78,7 +78,7 @@ devices=""
BUILD_OWNET="yes"
BUILD_OUTBgACK="no"
BUILD_XANTREX="no"
-AC_ARG_WITH(devices, [ --with-device the device(s) to build (ownet,
outback, xantrex)],
+AC_ARG_WITH(devices, [ --with-devices the device(s) to build (ownet,
outback, xantrex)],
[devices="`echo ${withval} | tr ',' ' '`"
for i in ${devices}; do
echo "FIXME: $i"
@@ -143,33 +143,43 @@ dnl CXXFLAGS="${CXXFLAGS} -march=armv6 -mfpu=vfp
-mfloat-abi=hard"
armv6z) ;;
*) ;;
esac
-AC_MSG_NOTICE([Default compiler architecture is: ${arch}])
-
-sysroot="${sysroot:-`${CXX} -print-sysroot`}"
-dnl We don't need a sysroot for native builds
-if test x"${sysroot}" = x"/"; then
- sysroot=""
+gcc_sysroot=""
+if test `uname -m` != ${arch}; then
+ cross_compiling=yes
+ gcc_sysroot="`${CXX} -print-sysroot | sed -e 's:bin/../::'`"
fi
+AC_MSG_NOTICE([Default compiler architecture is: ${arch}])
+sysroot=""
AC_ARG_WITH(sysroot,
- AC_HELP_STRING([--with-sysroot], [system root directory for cross
compiling]),
+ AC_HELP_STRING([--with-sysroot], [system rootfs directory for cross
compiling]),
sysroot=${withval};
- cross_compiling=yes)
+ )
-with_top_level=""
+dnl Sanity check the sysroot for cross compiling to avoid other errors
if test x"${cross_compiling}" = xyes; then
AC_MSG_CHECKING([For a usable sysroot])
dnl Check if /usr isn't part of the specified path
- if test ! -d ${sysroot}/usr && ! -d ${sysroot}/usr/include; then
- AC_MSG_ERROR([Specified sysroot \"${sysroot}\" doesn't exist!])
- else
+ for i in ${gcc_sysroot} ${sysroot}; do
+ if test ! -d ${i}/usr && ! -d ${i}/usr/include; then
+ AC_MSG_ERROR([Specified sysroot \"${i}\" doesn't exist!])
+ AC_MSG_RESULT(["not found"])
+ else
+ AC_MSG_RESULT(["found"])
+ fi
+ done
+
+ dnl If the user specifies a sysroot that isn't the default, add it to
+ dnl the compilation
+ if test x"${gcc_sysroot}" != x"${sysroot}" -a x"${sysroot}" != x"/"; then
CXXFLAGS+=" --sysroot=${sysroot}"
CFLAGS+=" --sysroot=${sysroot}"
- LDFLAGS+=" --sysroot=${sysroot}"
+ LDFLAGS+=" -Wl,-rpath=${sysroot}/usr/lib/${host_alias}"
+ LDFLAGS+=" -Wl,-rpath=${sysroot}/lib/${host_alias}"
fi
- AC_MSG_RESULT([${sysroot}])
AC_SUBST(sysroot)
fi
+AM_CONDITIONAL(BUILD_CROSS, [ test x"${cross_compiling}" == xyes ])
dnl When cross compiling, limit the search directories cause otherwise
dnl we may get the host headers or libraries by accident. These values
@@ -204,45 +214,41 @@ else
RASPI_FLAGS="-march=armv6z -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard"
AC_SUBST(RASPI_FLAGS)
fi
-AM_CONDITIONAL(CROSS_COMPILING, [ test x$cross_compiling = xyes ])
+#AM_CONDITIONAL(CROSS_COMPILING, [ test x$cross_compiling = xyes ])
-dnl Add development files in /usr/local
-if test ${sysroot}/usr/local/include; then
- CPPFLAGS="-I${sysroot}/usr/local/include"
-fi
save_LDFLAGS="${LDFLAGS}"
save_CXXFLAGS="${CXXFLAGS}"
save_CPPFLAGS="${CPPFLAGS}"
save_CFLAGS="${CFLAGS}"
+dnl Force warningto cause an error for compile tests
CFLAGS="${save_CFLAGS} -Wall -Werror"
# dnl libxml2's headers are sometimes in a libxml2 directory, but not always
-if test -d ${sysroot}/usr/local/include/libxml2; then
- CPPFLAGS="-I${sysroot}/usr/local/include/libxml2"
-else
- if test -d "${sysroot}/usr/include/libxml2"; then
- CPPFLAGS="-I${sysroot}/usr/include/libxml2"
+headers="${sysroot:-${gcc_sysroot}}/usr ${sysroot:-${gcc_sysroot}}/usr/local"
+for i in ${headers}; do
+ if test -d "${i}/include/libxml2"; then
+ CPPFLAGS="-I${i}/include/libxml2"
fi
-fi
+done
AC_MSG_CHECKING([For libxml2 development files])
AC_TRY_COMPILE([#include <libxml/xmlstring.h>], [
xmlChar foo = 'x';
foo += 'y';
],
- has_libxml=true,
- has_libxml=false
+ has_libxml=yes,
+ has_libxml=no
)
AC_MSG_RESULT([${has_libxml}])
-if test x"${has_libxml}" = x"true"; then
+if test x"${has_libxml}" = x"yes"; then
AC_DEFINE([HAVE_LIBXML], [1], [Has libxml2 development files])
LIBXML_LIBS="-lxml2"
LIBXML_CPPFLAGS="${CPPFLAGS}"
AC_SUBST(LIBXML_CPPFLAGS)
AC_SUBST(LIBXML_LIBS)
fi
-AM_CONDITIONAL(BUILD_LIBXML, [ test x${has_libxml} = xtrue ])
+AM_CONDITIONAL(BUILD_LIBXML, [ test x${has_libxml} = xyes ])
dnl GNU_PKG_FIND(libxml2, [libxml/xmlstring.h], [libxml2], xmlNewReference)
dnl libpq. FIXME: add libpqcxx
@@ -258,11 +264,11 @@ AC_MSG_CHECKING([For postgresql development files])
AC_TRY_COMPILE([#include <libpq-fe.h>], [
PQpass(0);
],
- has_libpq=true,
- has_libpq=false
+ has_libpq=yes,
+ has_libpq=no
)
AC_MSG_RESULT([${has_libpq}])
-if test x"${has_libpq}" = x"true"; then
+if test x"${has_libpq}" = x"yes"; then
AC_DEFINE([HAVE_LIBPQ], [1], [Has postgresql development files])
PQ_LIBS="-lpq"
PQ_CPPFLAGS="${CPPFLAGS}"
@@ -270,7 +276,7 @@ if test x"${has_libpq}" = x"true"; then
AC_SUBST(PQ_CPPFLAGS)
AC_SUBST(PQ_LIBS)
fi
-AM_CONDITIONAL(BUILD_POSTGRESQL, [ test x${has_libpq} = xtrue ])
+AM_CONDITIONAL(BUILD_POSTGRESQL, [ test x${has_libpq} = xyes ])
dnl Net-SNMP
dnl net-snmp's headers require these two config options or you get
@@ -278,6 +284,9 @@ dnl an error. FIXME: this need to be real tests!
AC_DEFINE([HAVE_STRCASESTR], [1], [ Has strcasestr defined ])
AC_DEFINE([HAVE_IN_ADDR_T], [1], [ Has typedef in_addr_t])
+dnl Custom build sysroots often have manually compiled projects in
+dnl /usr/local to keep them separate from system installed ones.
+CPPFLAGS=" -I${sysroot:-${gcc_sysroot}}/usr/local/include"
CFLAGS="${save_CFLAGS} -Wall"
LDFLAGS="${save_LDFLAGS} -lnetsnmp -lnetsnmpagent"
AC_MSG_CHECKING([For Net SNMP development files])
@@ -285,18 +294,18 @@ AC_TRY_COMPILE([#include <net-snmp/net-snmp-config.h>
#include <net-snmp/types.h>], [
netsnmp_pid_t foo;
],
- has_snmp=true,
- has_snmp=false
+ has_snmp=yes,
+ has_snmp=yes
)
AC_MSG_RESULT([${has_snmp}])
-if test x"${has_snmp}" = x"true"; then
+if test x"${has_snmp}" = x"yes"; then
AC_DEFINE([HAVE_SNMP], [1], [Has Net SNMP development files])
SNMP_LIBS="-lnetsnmp -lnetsnmpagent"
SNMP_CPPFLAGS="${CPPFLAGS}"
AC_SUBST(SNMP_LIBS)
AC_SUBST(SNMP_CPPFLAGS)
fi
-AM_CONDITIONAL(BUILD_SNMP, [ test x${has_snmp} = xtrue ])
+AM_CONDITIONAL(BUILD_SNMP, [ test x${has_snmp} = xyes ])
dnl dnl OWFS
LDFLAGS="${save_LDFLAGS} -l"
http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=4bf7ba57bba6743059783e99f32ec9bd8eb8456c
commit 4bf7ba57bba6743059783e99f32ec9bd8eb8456c
Author: Rob Savoye <address@hidden>
Date: Wed Dec 12 16:05:37 2018 -0700
Add listDevices() method
diff --git a/devices/ownet.h b/devices/ownet.h
index f28079d..4829984 100644
--- a/devices/ownet.h
+++ b/devices/ownet.h
@@ -118,7 +118,7 @@ public:
// get all the temperature fields for a device.
temperature_t *getTemperature(const std::string &device) {
- DEBUGLOG_REPORT_FUNCTION;
+ // DEBUGLOG_REPORT_FUNCTION;
std::string family = getValue(device, "family");
std::string id = getValue(device, "id");
@@ -126,13 +126,14 @@ public:
temperature_t *temp = 0;
if (family == "10") {
- dbglogfile << device << " is a thermometer" << std::endl;
+ // dbglogfile << device << " is a thermometer" << std::endl;
temp = new temperature_t[1];
temp->temp = std::stof(getValue(device, "temperature"));
temp->lowtemp =std::stof(getValue(device, "templow"));
temp->hightemp = std::stof(getValue(device, "temphigh"));
// Add data to the database
std::string stamp;
+#ifdef HAVE_LIBPQ
stamp = pdb.gettime(stamp);
std::string query = family + ',';
query += "\'" + id;
@@ -142,6 +143,7 @@ public:
query += ", " + std::to_string(temp->lowtemp);
query += ", " + std::to_string(temp->hightemp);
pdb.queryInsert(query);
+#endif
std::lock_guard<std::mutex> guard(_mutex);
_temperatures[device] = temp;
@@ -151,7 +153,6 @@ public:
return temp;
}
-#if 1
void dump(void) {
DEBUGLOG_REPORT_FUNCTION;
@@ -169,9 +170,19 @@ public:
std::cout << "\tHigh Temperature: " << tit->second->hightemp <<
std::endl;
}
}
-#else
- void dump(void);
-#endif
+
+ std::vector<std::string> &
+ listDevices(std::vector<std::string> &list) {
+ DEBUGLOG_REPORT_FUNCTION;
+
+ std::map<std::string, ownet_t *>::iterator sit;
+ for (sit = _sensors.begin(); sit != _sensors.end(); sit++) {
+ std::string dev = sit->first.substr(sit->first.size()-1);
+ list.push_back(sit->first);
+ }
+ return list;
+ }
+
Ownet(void) {
DEBUGLOG_REPORT_FUNCTION;
@@ -243,6 +254,7 @@ public:
_temperatures[*it] = temp;
std::string stamp;
+#ifdef HAVE_LIBPQ
stamp = pdb.gettime(stamp);
std::string query = data->family + ',';
query += "\'" + data->id;
@@ -252,6 +264,7 @@ public:
query += ", " + std::to_string(temp->lowtemp);
query += ", " + std::to_string(temp->hightemp);
pdb.queryInsert(query);
+#endif
} else {
dbglogfile << "Temperature sensor not found!" << std::endl;
}
http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=ba227a114c428526a3c2d94b005236d0d2d04646
commit ba227a114c428526a3c2d94b005236d0d2d04646
Author: Rob Savoye <address@hidden>
Date: Wed Dec 12 15:43:21 2018 -0700
Add simple XML commands
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 0f7e0ce..91279e4 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -25,7 +25,7 @@ AM_CXXFLAGS = -g -D__USLC__
noinst_LTLIBRARIES = libpguru.la
-# The list of tty's to use by default
+# The list of tty's to ugse by default
address@hidden@
# These headers get installed
@@ -51,7 +51,7 @@ libpguru_la_SOURCES += msgs.cc msgs.h
endif
if BUILD_LIBXML
-libpguru_la_SOURCES += xml.cc xml.h
+libpguru_la_SOURCES += xml.cc xml.h commands.h commands.cc
libpguru_la_CPPFLAGS += $(LIBXML_CPPFLAGS)
libpguru_la_LIBDADD += $(LIBXML_LIBS)
endif
http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=3b0f4625800c9238dadc64d9710b625c14a86feb
commit 3b0f4625800c9238dadc64d9710b625c14a86feb
Author: Rob Savoye <address@hidden>
Date: Wed Dec 12 15:41:03 2018 -0700
Add simple XML commandslib/commands.h
diff --git a/lib/commands.cc b/lib/commands.cc
index 40c98b5..f237ca7 100644
--- a/lib/commands.cc
+++ b/lib/commands.cc
@@ -53,7 +53,7 @@ std::string &
Commands::createCommand(cmd_t cmd, const std::string &args,
std::string &str)
{
- DEBUGLOG_REPORT_FUNCTION;
+ //DEBUGLOG_REPORT_FUNCTION;
str.clear();
str = "<command>";
@@ -71,6 +71,8 @@ Commands::createCommand(cmd_t cmd, const std::string &args,
str += "<nop>" + args + "</nop>";
break;
case HELO:
+ // This takes two optional arguments, the first one
+ // is the hostname, the second the user name.
dbglogfile << "create HELO command" << std::endl;
std::string data = "<hostname>";
size_t pos = args.find(' ');
@@ -104,6 +106,13 @@ Commands::execCommand(XML &xml, std::string &str)
dbglogfile << "Executing remote command " << cmd << std::endl;
+ // The first child node is the top level command
+ if (xml[0]->nameGet() == "list") {
+ if (xml[0]->valueGet() == "devices") {
+ // FIXME:
+ }
+ }
+
return str;
}
http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=f99643cbe3b9036e31a8a9fe30bd8e9d61637879
commit f99643cbe3b9036e31a8a9fe30bd8e9d61637879
Author: Rob Savoye <address@hidden>
Date: Wed Dec 12 15:35:23 2018 -0700
Fix typo
diff --git a/lib/tcputil.h b/lib/tcputil.h
index 2197a92..6bc0be6 100644
--- a/lib/tcputil.h
+++ b/lib/tcputil.h
@@ -53,7 +53,7 @@ public:
// Accessors
short getPort(void) { return -1; }; // FIXME
int getProtocol(void) { return _addrinfo->ai_protocol; };
- std::string &getHostnamet(void) { return _hostname; };
+ std::string &getHostname(void) { return _hostname; };
std::string &getIP(void) { return _ipaddr; };
protected:
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 87 ++++++++++++++++++++++++++++++------------------------
daemon/Makefile.am | 4 +--
devices/ownet.h | 25 ++++++++++++----
lib/Makefile.am | 4 +--
lib/commands.cc | 11 ++++++-
lib/tcputil.h | 2 +-
6 files changed, 82 insertions(+), 51 deletions(-)
hooks/post-receive
--
powerguru
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Powerguru-commit] [SCM] powerguru branch, master, updated. 4b8448e97628e47df0a3731d8178022765562847,
Rob Savoye <=