|
|
#endif | #endif |
| |
#ifdef HAVE_LIBRPM | #ifdef HAVE_LIBRPM |
|
#include <stdio.h> |
|
#include <stdint.h> |
#include <rpm/rpmlib.h> | #include <rpm/rpmlib.h> |
#include <rpm/header.h> |
#include <rpm/rpm4compat.h> |
#include <fcntl.h> | #include <fcntl.h> |
| |
#ifdef HAVE_RPMGETPATH | #ifdef HAVE_RPMGETPATH |
|
Lines 465-470
var_hrswinst(struct variable * vp,
|
Link Here
|
|---|
|
if ( headerGetEntry(swi->swi_h, RPMTAG_INSTALLTIME, NULL, (void **) &rpm_data, NULL) ) { | if ( headerGetEntry(swi->swi_h, RPMTAG_INSTALLTIME, NULL, (void **) &rpm_data, NULL) ) { |
time_t installTime = *rpm_data; | time_t installTime = *rpm_data; |
ret = date_n_time(&installTime, var_len); | ret = date_n_time(&installTime, var_len); |
|
free((void *)rpm_data); |
} else { | } else { |
ret = date_n_time(0, var_len); | ret = date_n_time(0, var_len); |
} | } |
|
Lines 661-666
Save_HR_SW_info(int ix)
|
Link Here
|
|---|
|
NULL); | NULL); |
snprintf(swi->swi_name, sizeof(swi->swi_name), "%s-%s-%s", n, v, r); | snprintf(swi->swi_name, sizeof(swi->swi_name), "%s-%s-%s", n, v, r); |
swi->swi_name[ sizeof(swi->swi_name)-1 ] = 0; | swi->swi_name[ sizeof(swi->swi_name)-1 ] = 0; |
|
free((void *)n); |
|
free((void *)v); |
|
free((void *)r); |
} | } |
#else | #else |
snprintf(swi->swi_name, sizeof(swi->swi_name), swi->swi_dep->d_name); | snprintf(swi->swi_name, sizeof(swi->swi_name), swi->swi_dep->d_name); |
|
Lines 25823-25829
cat >>conftest.$ac_ext <<_ACEOF
|
Link Here
|
|---|
|
#include NETSNMP_SYSTEM_INCLUDE_FILE | #include NETSNMP_SYSTEM_INCLUDE_FILE |
#include "$srcdir/$mibdir/$i.h" | #include "$srcdir/$mibdir/$i.h" |
_ACEOF | _ACEOF |
mv conftest.$ac_ext module_tmp_header.h |
mv conftest.$ac_ext module_tmp_rpmtag.h |
| |
#--------------------- | #--------------------- |
# macro: config_belongs_in(ARG) | # macro: config_belongs_in(ARG) |
|
|
module_type=mib_module | module_type=mib_module |
if test -f $srcdir/$mibdir/$i.h; then | if test -f $srcdir/$mibdir/$i.h; then |
| |
module_type=`$MODULECPP module_tmp_header.h | grep config_belongs_in | sed 's@.*config_belongs_in(\([^)]*\)).*@\1@'` |
module_type=`$MODULECPP module_tmp_rpmtag.h | grep config_belongs_in | sed 's@.*config_belongs_in(\([^)]*\)).*@\1@'` |
| |
fi | fi |
if test "x$module_type" = "x" ; then | if test "x$module_type" = "x" ; then |
|
|
# | # |
# check if $i has any conflicts | # check if $i has any conflicts |
# | # |
new_list_excl=`$MODULECPP module_tmp_header.h | grep config_exclude | sed 's/.*config_exclude(\(.*\)).*/\1/'` |
new_list_excl=`$MODULECPP module_tmp_rpmtag.h | grep config_exclude | sed 's/.*config_exclude(\(.*\)).*/\1/'` |
if test "x$new_list_excl" != "x"; then | if test "x$new_list_excl" != "x"; then |
| |
if test $module_debug = 1; then | if test $module_debug = 1; then |
|
|
# check if $i has any architecture specific requirements | # check if $i has any architecture specific requirements |
# | # |
| |
new_list_arch=`$MODULECPP module_tmp_header.h | grep config_arch_require | sed 's/.*config_arch_require( *\([^ ]*\) *, *\([^ ]*\) *).*/\1-xarchx-\2/'` |
new_list_arch=`$MODULECPP module_tmp_rpmtag.h | grep config_arch_require | sed 's/.*config_arch_require( *\([^ ]*\) *, *\([^ ]*\) *).*/\1-xarchx-\2/'` |
| |
if test "x$new_list_arch" != "x"; then | if test "x$new_list_arch" != "x"; then |
for j in $new_list_arch | for j in $new_list_arch |
|
|
# | # |
# check if $i has any other required modules | # check if $i has any other required modules |
# | # |
new_list="$new_list `$MODULECPP module_tmp_header.h | grep config_require | sed 's/.*config_require(\(.*\)).*/\1/'`" |
new_list="$new_list `$MODULECPP module_tmp_rpmtag.h | grep config_require | sed 's/.*config_require(\(.*\)).*/\1/'`" |
| |
if test $module_debug = 1; then | if test $module_debug = 1; then |
echo " $i will test: $new_list" | echo " $i will test: $new_list" |
|
|
# | # |
# check if $i has any mibs to add | # check if $i has any mibs to add |
# | # |
new_mibs=`$MODULECPP module_tmp_header.h | grep config_add_mib | sed 's/.*config_add_mib(\(.*\)).*/\1/'` |
new_mibs=`$MODULECPP module_tmp_rpmtag.h | grep config_add_mib | sed 's/.*config_add_mib(\(.*\)).*/\1/'` |
if test "x$new_mibs" != "x"; then | if test "x$new_mibs" != "x"; then |
for j in $new_mibs | for j in $new_mibs |
do | do |
|
|
#------------------- | #------------------- |
# check for unsupported config_load_mib | # check for unsupported config_load_mib |
# | # |
if $MODULECPP module_tmp_header.h | grep config_load_mib > /dev/null 2>&1; then |
if $MODULECPP module_tmp_rpmtag.h | grep config_load_mib > /dev/null 2>&1; then |
{ echo "$as_me:$LINENO: WARNING: mib module error" >&5 | { echo "$as_me:$LINENO: WARNING: mib module error" >&5 |
echo "$as_me: WARNING: mib module error" >&2;} | echo "$as_me: WARNING: mib module error" >&2;} |
{ echo "$as_me:$LINENO: WARNING: mib module \"$i\" uses the \"config_load_mib\" directive, which is no longer supported. It probably won't work." >&5 | { echo "$as_me:$LINENO: WARNING: mib module \"$i\" uses the \"config_load_mib\" directive, which is no longer supported. It probably won't work." >&5 |
|
Lines 26125-26131
echo "$as_me: WARNING: mib module \"$i\"
|
Link Here
|
|---|
|
# (generally not used any longer; old auto-load a .conf token) | # (generally not used any longer; old auto-load a .conf token) |
# | # |
| |
$MODULECPP module_tmp_header.h | grep config_parse_dot_conf | sed 's@.*config_parse_dot_conf(\([^)]*\), *\([^),]*\), *\([^),]*\), *\([^),]*\)).*@register_config_handler("snmpd",\1, \2, \3, \4);@' >> $mibdir/mib_module_dot_conf.h |
$MODULECPP module_tmp_rpmtag.h | grep config_parse_dot_conf | sed 's@.*config_parse_dot_conf(\([^)]*\), *\([^),]*\), *\([^),]*\), *\([^),]*\)).*@register_config_handler("snmpd",\1, \2, \3, \4);@' >> $mibdir/mib_module_dot_conf.h |
| |
| |
#--------------------- | #--------------------- |
|
Lines 26134-26140
echo "$as_me: WARNING: mib module \"$i\"
|
Link Here
|
|---|
|
# | # |
# check if $i has any errors, or warnings | # check if $i has any errors, or warnings |
# | # |
error=`$MODULECPP module_tmp_header.h | grep config_error | sed 's/.*config_error(\(.*\)).*/\1/'` |
error=`$MODULECPP module_tmp_rpmtag.h | grep config_error | sed 's/.*config_error(\(.*\)).*/\1/'` |
if test "x$error" != "x"; then | if test "x$error" != "x"; then |
echo | echo |
echo | echo |
|
Lines 26147-26153
echo "$as_me: error: $i: *** $error ***"
|
Link Here
|
|---|
|
# macro: config_warning(warning text) | # macro: config_warning(warning text) |
# - used to signal a configuration "warning" to be printed to the user | # - used to signal a configuration "warning" to be printed to the user |
# | # |
warning=`$MODULECPP module_tmp_header.h | grep config_warning | sed 's/.*config_warning(\(.*\)).*/\1/'` |
warning=`$MODULECPP module_tmp_rpmtag.h | grep config_warning | sed 's/.*config_warning(\(.*\)).*/\1/'` |
if test "x$warning" != "x"; then | if test "x$warning" != "x"; then |
all_warnings="$all_warnings $warning | all_warnings="$all_warnings $warning |
" | " |
|
|
done | done |
| |
# cleanup | # cleanup |
rm -f module_tmp_header.h |
rm -f module_tmp_rpmtag.h |
| |
#------------------- | #------------------- |
# build module lists for Makefiles | # build module lists for Makefiles |
|
Lines 28388-28395
rm -f conftest.err conftest.$ac_objext \
|
Link Here
|
|---|
|
fi; | fi; |
| |
| |
|
for ac_header in rpm/rpmlib.h rpm/rpmtag.h |
for ac_header in rpm/rpmlib.h rpm/header.h |
|
do | do |
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` | as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` |
if eval "test \"\${$as_ac_Header+set}\" = set"; then | if eval "test \"\${$as_ac_Header+set}\" = set"; then |
|
|
| |
| |
if test "${ac_cv_header_rpm_header_h+set}" = set; then | if test "${ac_cv_header_rpm_header_h+set}" = set; then |
echo "$as_me:$LINENO: checking for rpm/header.h" >&5 |
echo "$as_me:$LINENO: checking for rpm/rpmtag.h" >&5 |
echo $ECHO_N "checking for rpm/header.h... $ECHO_C" >&6 |
echo $ECHO_N "checking for rpm/rpmtag.h... $ECHO_C" >&6 |
if test "${ac_cv_header_rpm_header_h+set}" = set; then | if test "${ac_cv_header_rpm_header_h+set}" = set; then |
echo $ECHO_N "(cached) $ECHO_C" >&6 | echo $ECHO_N "(cached) $ECHO_C" >&6 |
fi | fi |
|
Lines 28693-28700
echo "$as_me:$LINENO: result: $ac_cv_hea
|
Link Here
|
|---|
|
echo "${ECHO_T}$ac_cv_header_rpm_header_h" >&6 | echo "${ECHO_T}$ac_cv_header_rpm_header_h" >&6 |
else | else |
# Is the header compilable? | # Is the header compilable? |
echo "$as_me:$LINENO: checking rpm/header.h usability" >&5 |
echo "$as_me:$LINENO: checking rpm/rpmtag.h usability" >&5 |
echo $ECHO_N "checking rpm/header.h usability... $ECHO_C" >&6 |
echo $ECHO_N "checking rpm/rpmtag.h usability... $ECHO_C" >&6 |
cat >conftest.$ac_ext <<_ACEOF | cat >conftest.$ac_ext <<_ACEOF |
/* confdefs.h. */ | /* confdefs.h. */ |
_ACEOF | _ACEOF |
|
Lines 28702-28708
cat confdefs.h >>conftest.$ac_ext
|
Link Here
|
|---|
|
cat >>conftest.$ac_ext <<_ACEOF | cat >>conftest.$ac_ext <<_ACEOF |
/* end confdefs.h. */ | /* end confdefs.h. */ |
$ac_includes_default | $ac_includes_default |
#include <rpm/header.h> |
#include <rpm/rpmtag.h> |
_ACEOF | _ACEOF |
rm -f conftest.$ac_objext | rm -f conftest.$ac_objext |
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 | if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 |
|
Lines 28738-28752
echo "$as_me:$LINENO: result: $ac_header
|
Link Here
|
|---|
|
echo "${ECHO_T}$ac_header_compiler" >&6 | echo "${ECHO_T}$ac_header_compiler" >&6 |
| |
# Is the header present? | # Is the header present? |
echo "$as_me:$LINENO: checking rpm/header.h presence" >&5 |
echo "$as_me:$LINENO: checking rpm/rpmtag.h presence" >&5 |
echo $ECHO_N "checking rpm/header.h presence... $ECHO_C" >&6 |
echo $ECHO_N "checking rpm/rpmtag.h presence... $ECHO_C" >&6 |
cat >conftest.$ac_ext <<_ACEOF | cat >conftest.$ac_ext <<_ACEOF |
/* confdefs.h. */ | /* confdefs.h. */ |
_ACEOF | _ACEOF |
cat confdefs.h >>conftest.$ac_ext | cat confdefs.h >>conftest.$ac_ext |
cat >>conftest.$ac_ext <<_ACEOF | cat >>conftest.$ac_ext <<_ACEOF |
/* end confdefs.h. */ | /* end confdefs.h. */ |
#include <rpm/header.h> |
#include <rpm/rpmtag.h> |
_ACEOF | _ACEOF |
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 | if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 |
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 | (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 |
|
Lines 28780-28804
echo "${ECHO_T}$ac_header_preproc" >&6
|
Link Here
|
|---|
|
# So? What about this header? | # So? What about this header? |
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in | case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in |
yes:no: ) | yes:no: ) |
{ echo "$as_me:$LINENO: WARNING: rpm/header.h: accepted by the compiler, rejected by the preprocessor!" >&5 |
{ echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: accepted by the compiler, rejected by the preprocessor!" >&5 |
echo "$as_me: WARNING: rpm/header.h: accepted by the compiler, rejected by the preprocessor!" >&2;} |
echo "$as_me: WARNING: rpm/rpmtag.h: accepted by the compiler, rejected by the preprocessor!" >&2;} |
{ echo "$as_me:$LINENO: WARNING: rpm/header.h: proceeding with the compiler's result" >&5 |
{ echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: proceeding with the compiler's result" >&5 |
echo "$as_me: WARNING: rpm/header.h: proceeding with the compiler's result" >&2;} |
echo "$as_me: WARNING: rpm/rpmtag.h: proceeding with the compiler's result" >&2;} |
ac_header_preproc=yes | ac_header_preproc=yes |
;; | ;; |
no:yes:* ) | no:yes:* ) |
{ echo "$as_me:$LINENO: WARNING: rpm/header.h: present but cannot be compiled" >&5 |
{ echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: present but cannot be compiled" >&5 |
echo "$as_me: WARNING: rpm/header.h: present but cannot be compiled" >&2;} |
echo "$as_me: WARNING: rpm/rpmtag.h: present but cannot be compiled" >&2;} |
{ echo "$as_me:$LINENO: WARNING: rpm/header.h: check for missing prerequisite headers?" >&5 |
{ echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: check for missing prerequisite headers?" >&5 |
echo "$as_me: WARNING: rpm/header.h: check for missing prerequisite headers?" >&2;} |
echo "$as_me: WARNING: rpm/rpmtag.h: check for missing prerequisite headers?" >&2;} |
{ echo "$as_me:$LINENO: WARNING: rpm/header.h: see the Autoconf documentation" >&5 |
{ echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: see the Autoconf documentation" >&5 |
echo "$as_me: WARNING: rpm/header.h: see the Autoconf documentation" >&2;} |
echo "$as_me: WARNING: rpm/rpmtag.h: see the Autoconf documentation" >&2;} |
{ echo "$as_me:$LINENO: WARNING: rpm/header.h: section \"Present But Cannot Be Compiled\"" >&5 |
{ echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: section \"Present But Cannot Be Compiled\"" >&5 |
echo "$as_me: WARNING: rpm/header.h: section \"Present But Cannot Be Compiled\"" >&2;} |
echo "$as_me: WARNING: rpm/rpmtag.h: section \"Present But Cannot Be Compiled\"" >&2;} |
{ echo "$as_me:$LINENO: WARNING: rpm/header.h: proceeding with the preprocessor's result" >&5 |
{ echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: proceeding with the preprocessor's result" >&5 |
echo "$as_me: WARNING: rpm/header.h: proceeding with the preprocessor's result" >&2;} |
echo "$as_me: WARNING: rpm/rpmtag.h: proceeding with the preprocessor's result" >&2;} |
{ echo "$as_me:$LINENO: WARNING: rpm/header.h: in the future, the compiler will take precedence" >&5 |
{ echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: in the future, the compiler will take precedence" >&5 |
echo "$as_me: WARNING: rpm/header.h: in the future, the compiler will take precedence" >&2;} |
echo "$as_me: WARNING: rpm/rpmtag.h: in the future, the compiler will take precedence" >&2;} |
( | ( |
cat <<\_ASBOX | cat <<\_ASBOX |
## ---------------------------------------------------- ## | ## ---------------------------------------------------- ## |
|
|
sed "s/^/$as_me: WARNING: /" >&2 | sed "s/^/$as_me: WARNING: /" >&2 |
;; | ;; |
esac | esac |
echo "$as_me:$LINENO: checking for rpm/header.h" >&5 |
echo "$as_me:$LINENO: checking for rpm/rpmtag.h" >&5 |
echo $ECHO_N "checking for rpm/header.h... $ECHO_C" >&6 |
echo $ECHO_N "checking for rpm/rpmtag.h... $ECHO_C" >&6 |
if test "${ac_cv_header_rpm_header_h+set}" = set; then | if test "${ac_cv_header_rpm_header_h+set}" = set; then |
echo $ECHO_N "(cached) $ECHO_C" >&6 | echo $ECHO_N "(cached) $ECHO_C" >&6 |
else | else |