mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-11 01:30:00 -04:00
Merge branch 'master' into fix_check_mailq
This commit is contained in:
commit
6d08e1c8c9
27 changed files with 82 additions and 16431 deletions
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
|
|
@ -20,7 +20,7 @@ jobs:
|
|||
- name: Codespell
|
||||
uses: codespell-project/actions-codespell@v2
|
||||
with:
|
||||
skip: "./.git,./.gitignore,./ABOUT-NLS,*.po,./gl,./po,./tools/squid.conf,./build-aux/ltmain.sh,THANKS.in"
|
||||
skip: "./.git,./.gitignore,./ABOUT-NLS,./gl,./tools/squid.conf,./build-aux/ltmain.sh,THANKS.in"
|
||||
ignore_words_list: allright,gord,didi,hda,nd,alis,clen,scrit,ser,fot,te,parm,isnt,consol,oneliners,esponse,slac
|
||||
check_filenames: true
|
||||
check_hidden: true
|
||||
|
|
@ -74,10 +74,6 @@ jobs:
|
|||
/bin/sh -c '${{ matrix.prepare }} && \
|
||||
tools/setup && \
|
||||
./configure --enable-libtap --with-ipv6=no && \
|
||||
set -x && \
|
||||
tmp_dir=$(mktemp -d -t test-XXXX) && cp -a po/ $tmp_dir/ && \
|
||||
cd po && make update-po && cd .. && \
|
||||
diff -Nur $tmp_dir/po/*.po po/*.po | tee -a /tmp/po.diff && diff -Nur $tmp_dir/po/*.pot po/*.pot | tee -a /tmp/po.diff && if [ $(wc -l /tmp/po.diff | cut -f 1 -d" ") -gt 0 ]; then echo "Error: Translations needs to be updated with make update-po!" && exit 1; fi && \
|
||||
make && \
|
||||
make test && \
|
||||
make dist && \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = gl tap lib plugins plugins-scripts plugins-root po @PERLMODS_DIR@
|
||||
SUBDIRS = gl tap lib plugins plugins-scripts plugins-root @PERLMODS_DIR@
|
||||
|
||||
EXTRA_DIST = config.rpath \
|
||||
ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS CODING ChangeLog FAQ NEWS \
|
||||
|
|
|
|||
|
|
@ -1924,7 +1924,6 @@ AC_OUTPUT(
|
|||
perlmods/Makefile
|
||||
test.pl
|
||||
pkg/solaris/pkginfo
|
||||
po/Makefile.in
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
monitoring_plugin *this_monitoring_plugin=NULL;
|
||||
|
||||
unsigned int timeout_state = STATE_CRITICAL;
|
||||
int timeout_state = STATE_CRITICAL;
|
||||
unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
|
||||
|
||||
bool _np_state_read_file(FILE *);
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ bool check_range(double, range *);
|
|||
int get_status(double, thresholds *);
|
||||
|
||||
/* Handle timeouts */
|
||||
extern unsigned int timeout_state;
|
||||
extern int timeout_state;
|
||||
extern unsigned int timeout_interval;
|
||||
|
||||
/* All possible characters in a threshold range */
|
||||
|
|
|
|||
|
|
@ -390,13 +390,12 @@ cmd_file_read ( char *filename, output *out, int flags)
|
|||
void
|
||||
timeout_alarm_handler (int signo)
|
||||
{
|
||||
size_t i;
|
||||
if (signo == SIGALRM) {
|
||||
printf (_("%s - Plugin timed out after %d seconds\n"),
|
||||
state_text(timeout_state), timeout_interval);
|
||||
|
||||
long maxfd = mp_open_max();
|
||||
if(_cmd_pids) for(i = 0; i < maxfd; i++) {
|
||||
if(_cmd_pids) for(long int i = 0; i < maxfd; i++) {
|
||||
if(_cmd_pids[i] != 0) kill(_cmd_pids[i], SIGKILL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ static int stderr_warning = 0; /* if a cmd issued output on stderr */
|
|||
static int exec_warning = 0; /* if a cmd exited non-zero */
|
||||
|
||||
int main (int argc, char **argv) {
|
||||
int result=STATE_UNKNOWN, packages_available=0, sec_count=0, i=0;
|
||||
int result=STATE_UNKNOWN, packages_available=0, sec_count=0;
|
||||
char **packages_list=NULL, **secpackages_list=NULL;
|
||||
|
||||
/* Parse extra opts if any */
|
||||
|
|
@ -142,10 +142,11 @@ int main (int argc, char **argv) {
|
|||
qsort(secpackages_list, sec_count, sizeof(char*), cmpstringp);
|
||||
qsort(packages_list, packages_available-sec_count, sizeof(char*), cmpstringp);
|
||||
|
||||
for(i = 0; i < sec_count; i++)
|
||||
for(int i = 0; i < sec_count; i++)
|
||||
printf("%s (security)\n", secpackages_list[i]);
|
||||
|
||||
if (only_critical == false) {
|
||||
for(i = 0; i < packages_available - sec_count; i++)
|
||||
for(int i = 0; i < packages_available - sec_count; i++)
|
||||
printf("%s\n", packages_list[i]);
|
||||
}
|
||||
}
|
||||
|
|
@ -251,7 +252,7 @@ int process_arguments (int argc, char **argv) {
|
|||
|
||||
/* run an apt-get upgrade */
|
||||
int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkglist){
|
||||
int i=0, result=STATE_UNKNOWN, regres=0, pc=0, spc=0;
|
||||
int result=STATE_UNKNOWN, regres=0, pc=0, spc=0;
|
||||
struct output chld_out, chld_err;
|
||||
regex_t ireg, ereg, sreg;
|
||||
char *cmdline=NULL, rerrbuf[64];
|
||||
|
|
@ -320,7 +321,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkg
|
|||
* we may need to switch to the --print-uris output format,
|
||||
* in which case the logic here will slightly change.
|
||||
*/
|
||||
for(i = 0; i < chld_out.lines; i++) {
|
||||
for(size_t i = 0; i < chld_out.lines; i++) {
|
||||
if(verbose){
|
||||
printf("%s\n", chld_out.line[i]);
|
||||
}
|
||||
|
|
@ -353,7 +354,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkg
|
|||
stderr_warning=1;
|
||||
result = max_state(result, STATE_WARNING);
|
||||
if(verbose){
|
||||
for(i = 0; i < chld_err.lines; i++) {
|
||||
for(size_t i = 0; i < chld_err.lines; i++) {
|
||||
fprintf(stderr, "%s\n", chld_err.line[i]);
|
||||
}
|
||||
}
|
||||
|
|
@ -367,7 +368,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkg
|
|||
|
||||
/* run an apt-get update (needs root) */
|
||||
int run_update(void){
|
||||
int i=0, result=STATE_UNKNOWN;
|
||||
int result=STATE_UNKNOWN;
|
||||
struct output chld_out, chld_err;
|
||||
char *cmdline;
|
||||
|
||||
|
|
@ -385,7 +386,7 @@ int run_update(void){
|
|||
}
|
||||
|
||||
if(verbose){
|
||||
for(i = 0; i < chld_out.lines; i++) {
|
||||
for(size_t i = 0; i < chld_out.lines; i++) {
|
||||
printf("%s\n", chld_out.line[i]);
|
||||
}
|
||||
}
|
||||
|
|
@ -395,7 +396,7 @@ int run_update(void){
|
|||
stderr_warning=1;
|
||||
result = max_state(result, STATE_WARNING);
|
||||
if(verbose){
|
||||
for(i = 0; i < chld_err.lines; i++) {
|
||||
for(size_t i = 0; i < chld_err.lines; i++) {
|
||||
fprintf(stderr, "%s\n", chld_err.line[i]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ main (int argc, char **argv)
|
|||
char *status_text;
|
||||
int cresult;
|
||||
int result = STATE_UNKNOWN;
|
||||
int i;
|
||||
time_t local_time;
|
||||
FILE *fp = NULL;
|
||||
output chld_out, chld_err;
|
||||
|
|
@ -96,7 +95,7 @@ main (int argc, char **argv)
|
|||
/* run the command */
|
||||
if (verbose) {
|
||||
printf ("Command: %s\n", commargv[0]);
|
||||
for (i=1; i<commargc; i++)
|
||||
for (int i = 1; i < commargc; i++)
|
||||
printf ("Argument %i: %s\n", i, commargv[i]);
|
||||
}
|
||||
|
||||
|
|
@ -110,9 +109,9 @@ main (int argc, char **argv)
|
|||
}
|
||||
|
||||
if (verbose) {
|
||||
for(i = 0; i < chld_out.lines; i++)
|
||||
for(size_t i = 0; i < chld_out.lines; i++)
|
||||
printf("stdout: %s\n", chld_out.line[i]);
|
||||
for(i = 0; i < chld_err.lines; i++)
|
||||
for(size_t i = 0; i < chld_err.lines; i++)
|
||||
printf("stderr: %s\n", chld_err.line[i]);
|
||||
}
|
||||
|
||||
|
|
@ -122,7 +121,7 @@ main (int argc, char **argv)
|
|||
skip_stderr = chld_err.lines;
|
||||
|
||||
/* UNKNOWN or worse if (non-skipped) output found on stderr */
|
||||
if(chld_err.lines > skip_stderr) {
|
||||
if(chld_err.lines > (size_t)skip_stderr) {
|
||||
printf (_("Remote command execution failed: %s\n"),
|
||||
chld_err.line[skip_stderr]);
|
||||
if ( warn_on_stderr )
|
||||
|
|
@ -134,8 +133,8 @@ main (int argc, char **argv)
|
|||
/* this is simple if we're not supposed to be passive.
|
||||
* Wrap up quickly and keep the tricks below */
|
||||
if(!passive) {
|
||||
if (chld_out.lines > skip_stdout)
|
||||
for (i = skip_stdout; i < chld_out.lines; i++)
|
||||
if (chld_out.lines > (size_t)skip_stdout)
|
||||
for (size_t i = skip_stdout; i < chld_out.lines; i++)
|
||||
puts (chld_out.line[i]);
|
||||
else
|
||||
printf (_("%s - check_by_ssh: Remote command '%s' returned status %d\n"),
|
||||
|
|
@ -156,7 +155,7 @@ main (int argc, char **argv)
|
|||
|
||||
local_time = time (NULL);
|
||||
commands = 0;
|
||||
for(i = skip_stdout; i < chld_out.lines; i++) {
|
||||
for(size_t i = skip_stdout; i < chld_out.lines; i++) {
|
||||
status_text = chld_out.line[i++];
|
||||
if (i == chld_out.lines || strstr (chld_out.line[i], "STATUS CODE: ") == NULL)
|
||||
die (STATE_UNKNOWN, _("%s: Error parsing output\n"), progname);
|
||||
|
|
|
|||
|
|
@ -1186,16 +1186,16 @@ int
|
|||
uri_strcmp (const UriTextRangeA range, const char* s)
|
||||
{
|
||||
if (!range.first) return -1;
|
||||
if (range.afterLast - range.first < strlen (s)) return -1;
|
||||
return strncmp (s, range.first, min( range.afterLast - range.first, strlen (s)));
|
||||
if ( (size_t)(range.afterLast - range.first) < strlen (s) ) return -1;
|
||||
return strncmp (s, range.first, min( (size_t)(range.afterLast - range.first), strlen (s)));
|
||||
}
|
||||
|
||||
char*
|
||||
uri_string (const UriTextRangeA range, char* buf, size_t buflen)
|
||||
{
|
||||
if (!range.first) return "(null)";
|
||||
strncpy (buf, range.first, max (buflen-1, range.afterLast - range.first));
|
||||
buf[max (buflen-1, range.afterLast - range.first)] = '\0';
|
||||
strncpy (buf, range.first, max (buflen-1, (size_t)(range.afterLast - range.first)));
|
||||
buf[max (buflen-1, (size_t)(range.afterLast - range.first))] = '\0';
|
||||
buf[range.afterLast - range.first] = '\0';
|
||||
return buf;
|
||||
}
|
||||
|
|
@ -2368,8 +2368,7 @@ remove_newlines (char *s)
|
|||
char *
|
||||
get_header_value (const struct phr_header* headers, const size_t nof_headers, const char* header)
|
||||
{
|
||||
int i;
|
||||
for( i = 0; i < nof_headers; i++ ) {
|
||||
for(size_t i = 0; i < nof_headers; i++ ) {
|
||||
if(headers[i].name != NULL && strncasecmp( header, headers[i].name, max( headers[i].name_len, 4 ) ) == 0 ) {
|
||||
return strndup( headers[i].value, headers[i].value_len );
|
||||
}
|
||||
|
|
@ -2471,7 +2470,7 @@ check_document_dates (const curlhelp_write_curlbuf *header_buf, char (*msg)[DEFA
|
|||
int
|
||||
get_content_length (const curlhelp_write_curlbuf* header_buf, const curlhelp_write_curlbuf* body_buf)
|
||||
{
|
||||
int content_length = 0;
|
||||
size_t content_length = 0;
|
||||
struct phr_header headers[255];
|
||||
size_t nof_headers = 255;
|
||||
size_t msglen;
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ main (int argc, char **argv)
|
|||
}
|
||||
|
||||
/* scan stdout */
|
||||
for(i = 0; i < chld_out.lines; i++) {
|
||||
for(size_t i = 0; i < chld_out.lines; i++) {
|
||||
if (addresses == NULL)
|
||||
addresses = malloc(sizeof(*addresses)*10);
|
||||
else if (!(n_addresses % 10))
|
||||
|
|
@ -197,7 +197,7 @@ main (int argc, char **argv)
|
|||
}
|
||||
|
||||
/* scan stderr */
|
||||
for(i = 0; i < chld_err.lines; i++) {
|
||||
for(size_t i = 0; i < chld_err.lines; i++) {
|
||||
if (verbose)
|
||||
puts(chld_err.line[i]);
|
||||
|
||||
|
|
@ -241,7 +241,7 @@ main (int argc, char **argv)
|
|||
unsigned long expect_match = (1 << expected_address_cnt) - 1;
|
||||
unsigned long addr_match = (1 << n_addresses) - 1;
|
||||
|
||||
for (i=0; i<expected_address_cnt; i++) {
|
||||
for (int i=0; i<expected_address_cnt; i++) {
|
||||
int j;
|
||||
/* check if we get a match on 'raw' ip or cidr */
|
||||
for (j=0; j<n_addresses; j++) {
|
||||
|
|
|
|||
|
|
@ -471,7 +471,7 @@ bool process_arguments (int argc, char **argv)
|
|||
free(http_method);
|
||||
http_method = strdup (optarg);
|
||||
char *tmp;
|
||||
if ((tmp = strstr(http_method, ":")) > 0) {
|
||||
if ((tmp = strstr(http_method, ":")) != NULL) {
|
||||
tmp[0] = '\0';
|
||||
http_method = http_method;
|
||||
http_method_proxy = ++tmp;
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ main (int argc, char **argv)
|
|||
int expected_cols = PS_COLS - 1;
|
||||
int warn = 0; /* number of processes in warn state */
|
||||
int crit = 0; /* number of processes in crit state */
|
||||
int i = 0, j = 0;
|
||||
int i = 0;
|
||||
int result = STATE_UNKNOWN;
|
||||
int ret = 0;
|
||||
output chld_out, chld_err;
|
||||
|
|
@ -207,7 +207,7 @@ main (int argc, char **argv)
|
|||
}
|
||||
|
||||
/* flush first line: j starts at 1 */
|
||||
for (j = 1; j < chld_out.lines; j++) {
|
||||
for (size_t j = 1; j < chld_out.lines; j++) {
|
||||
input_line = chld_out.line[j];
|
||||
|
||||
if (verbose >= 3)
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ size_t nlabels = 0;
|
|||
size_t labels_size = OID_COUNT_STEP;
|
||||
size_t nunits = 0;
|
||||
size_t unitv_size = OID_COUNT_STEP;
|
||||
int numoids = 0;
|
||||
size_t numoids = 0;
|
||||
int numauthpriv = 0;
|
||||
int numcontext = 0;
|
||||
int verbose = 0;
|
||||
|
|
@ -187,7 +187,8 @@ static char *fix_snmp_range(char *th)
|
|||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
int i, len, line, total_oids;
|
||||
int len, total_oids;
|
||||
size_t line;
|
||||
unsigned int bk_count = 0, dq_count = 0;
|
||||
int iresult = STATE_UNKNOWN;
|
||||
int result = STATE_UNKNOWN;
|
||||
|
|
@ -253,14 +254,16 @@ main (int argc, char **argv)
|
|||
if(calculate_rate) {
|
||||
if (!strcmp(label, "SNMP"))
|
||||
label = strdup("SNMP RATE");
|
||||
i=0;
|
||||
|
||||
size_t i = 0;
|
||||
|
||||
previous_state = np_state_read();
|
||||
if(previous_state!=NULL) {
|
||||
/* Split colon separated values */
|
||||
previous_string = strdup((char *) previous_state->data);
|
||||
while((ap = strsep(&previous_string, ":")) != NULL) {
|
||||
if(verbose>2)
|
||||
printf("State for %d=%s\n", i, ap);
|
||||
printf("State for %zd=%s\n", i, ap);
|
||||
while (i >= previous_size) {
|
||||
previous_size += OID_COUNT_STEP;
|
||||
previous_value = realloc(previous_value, previous_size * sizeof(*previous_value));
|
||||
|
|
@ -273,7 +276,7 @@ main (int argc, char **argv)
|
|||
/* Populate the thresholds */
|
||||
th_warn=warning_thresholds;
|
||||
th_crit=critical_thresholds;
|
||||
for (i=0; i<numoids; i++) {
|
||||
for (size_t i = 0; i < numoids; i++) {
|
||||
char *w = th_warn ? strndup(th_warn, strcspn(th_warn, ",")) : NULL;
|
||||
char *c = th_crit ? strndup(th_crit, strcspn(th_crit, ",")) : NULL;
|
||||
/* translate "2:1" to "@1:2" for backwards compatibility */
|
||||
|
|
@ -333,11 +336,11 @@ main (int argc, char **argv)
|
|||
}
|
||||
|
||||
|
||||
for (i = 0; i < numcontext; i++) {
|
||||
for (int i = 0; i < numcontext; i++) {
|
||||
command_line[index++] = contextargs[i];
|
||||
}
|
||||
|
||||
for (i = 0; i < numauthpriv; i++) {
|
||||
for (int i = 0; i < numauthpriv; i++) {
|
||||
command_line[index++] = authpriv[i];
|
||||
}
|
||||
|
||||
|
|
@ -348,7 +351,7 @@ main (int argc, char **argv)
|
|||
server_address,
|
||||
port);
|
||||
|
||||
for (i = 0; i < numoids; i++) {
|
||||
for (size_t i = 0; i < numoids; i++) {
|
||||
command_line[index++] = oids[i];
|
||||
xasprintf(&cl_hidden_auth, "%s %s", cl_hidden_auth, oids[i]);
|
||||
}
|
||||
|
|
@ -382,7 +385,7 @@ main (int argc, char **argv)
|
|||
if (external_error) {
|
||||
if (chld_err.lines > 0) {
|
||||
printf (_("External command error: %s\n"), chld_err.line[0]);
|
||||
for (i = 1; i < chld_err.lines; i++) {
|
||||
for (size_t i = 1; i < chld_err.lines; i++) {
|
||||
printf ("%s\n", chld_err.line[i]);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -392,12 +395,14 @@ main (int argc, char **argv)
|
|||
}
|
||||
|
||||
if (verbose) {
|
||||
for (i = 0; i < chld_out.lines; i++) {
|
||||
for (size_t i = 0; i < chld_out.lines; i++) {
|
||||
printf ("%s\n", chld_out.line[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (line=0, i=0; line < chld_out.lines && i < numoids ; line++, i++) {
|
||||
line = 0;
|
||||
total_oids = 0;
|
||||
for (size_t i = 0; line < chld_out.lines && i < numoids ; line++, i++, total_oids++) {
|
||||
if(calculate_rate)
|
||||
conv = "%.10g";
|
||||
else
|
||||
|
|
@ -410,7 +415,7 @@ main (int argc, char **argv)
|
|||
break;
|
||||
|
||||
if (verbose > 2) {
|
||||
printf("Processing oid %i (line %i)\n oidname: %s\n response: %s\n", i+1, line+1, oidname, response);
|
||||
printf("Processing oid %zi (line %zi)\n oidname: %s\n response: %s\n", i+1, line+1, oidname, response);
|
||||
}
|
||||
|
||||
/* Clean up type array - Sol10 does not necessarily zero it out */
|
||||
|
|
@ -634,7 +639,6 @@ main (int argc, char **argv)
|
|||
strncat(perfstr, " ", sizeof(perfstr)-strlen(perfstr)-1);
|
||||
}
|
||||
}
|
||||
total_oids=i;
|
||||
|
||||
/* Save state data, as all data collected now */
|
||||
if(calculate_rate) {
|
||||
|
|
@ -644,7 +648,7 @@ main (int argc, char **argv)
|
|||
die(STATE_UNKNOWN, _("Cannot malloc"));
|
||||
|
||||
current_length=0;
|
||||
for(i=0; i<total_oids; i++) {
|
||||
for(int i = 0; i < total_oids; i++) {
|
||||
xasprintf(&temp_string,"%.0f",response_value[i]);
|
||||
if(temp_string==NULL)
|
||||
die(STATE_UNKNOWN,_("Cannot asprintf()"));
|
||||
|
|
@ -687,7 +691,8 @@ process_arguments (int argc, char **argv)
|
|||
{
|
||||
char *ptr;
|
||||
int c = 1;
|
||||
int j = 0, jj = 0, ii = 0;
|
||||
int ii = 0;
|
||||
size_t j = 0, jj = 0;
|
||||
|
||||
int option = 0;
|
||||
static struct option longopts[] = {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ static char *server_send = NULL;
|
|||
static char *server_quit = NULL;
|
||||
static char **server_expect;
|
||||
static size_t server_expect_count = 0;
|
||||
static size_t maxbytes = 0;
|
||||
static ssize_t maxbytes = 0;
|
||||
static char **warn_codes = NULL;
|
||||
static size_t warn_codes_count = 0;
|
||||
static char **crit_codes = NULL;
|
||||
|
|
@ -102,11 +102,9 @@ int
|
|||
main (int argc, char **argv)
|
||||
{
|
||||
int result = STATE_UNKNOWN;
|
||||
int i;
|
||||
char *status = NULL;
|
||||
struct timeval tv;
|
||||
struct timeval timeout;
|
||||
size_t len;
|
||||
int match = -1;
|
||||
fd_set rfds;
|
||||
|
||||
|
|
@ -121,10 +119,10 @@ main (int argc, char **argv)
|
|||
if(progname != NULL) progname++;
|
||||
else progname = argv[0];
|
||||
|
||||
len = strlen(progname);
|
||||
if(len > 6 && !memcmp(progname, "check_", 6)) {
|
||||
size_t prog_name_len = strlen(progname);
|
||||
if(prog_name_len > 6 && !memcmp(progname, "check_", 6)) {
|
||||
SERVICE = strdup(progname + 6);
|
||||
for(i = 0; i < len - 6; i++)
|
||||
for(size_t i = 0; i < prog_name_len - 6; i++)
|
||||
SERVICE[i] = toupper(SERVICE[i]);
|
||||
}
|
||||
|
||||
|
|
@ -275,19 +273,21 @@ main (int argc, char **argv)
|
|||
printf("Quit string: %s\n", server_quit);
|
||||
}
|
||||
printf("server_expect_count: %d\n", (int)server_expect_count);
|
||||
for(i = 0; i < server_expect_count; i++)
|
||||
printf("\t%d: %s\n", i, server_expect[i]);
|
||||
for(size_t i = 0; i < server_expect_count; i++)
|
||||
printf("\t%zd: %s\n", i, server_expect[i]);
|
||||
}
|
||||
|
||||
/* if(len) later on, we know we have a non-NULL response */
|
||||
len = 0;
|
||||
ssize_t len = 0;
|
||||
|
||||
if (server_expect_count) {
|
||||
ssize_t received = 0;
|
||||
|
||||
/* watch for the expect string */
|
||||
while ((i = my_recv(buffer, sizeof(buffer))) > 0) {
|
||||
status = realloc(status, len + i + 1);
|
||||
memcpy(&status[len], buffer, i);
|
||||
len += i;
|
||||
while ((received = my_recv(buffer, sizeof(buffer))) > 0) {
|
||||
status = realloc(status, len + received + 1);
|
||||
memcpy(&status[len], buffer, received);
|
||||
len += received;
|
||||
status[len] = '\0';
|
||||
|
||||
/* stop reading if user-forced */
|
||||
|
|
@ -307,6 +307,7 @@ main (int argc, char **argv)
|
|||
if(select(sd + 1, &rfds, NULL, NULL, &timeout) <= 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (match == NP_MATCH_RETRY)
|
||||
match = NP_MATCH_FAILURE;
|
||||
|
||||
|
|
|
|||
|
|
@ -402,7 +402,8 @@ get_ups_variable (const char *varname, char *buf)
|
|||
|
||||
/* create the command string to send to the UPS daemon */
|
||||
/* Add LOGOUT to avoid read failure logs */
|
||||
if (snprintf (send_buffer, sizeof(send_buffer), "GET VAR %s %s\nLOGOUT\n", ups_name, varname) >= sizeof(send_buffer)) {
|
||||
int res = snprintf (send_buffer, sizeof(send_buffer), "GET VAR %s %s\nLOGOUT\n", ups_name, varname);
|
||||
if ( (res > 0) && ((size_t)res >= sizeof(send_buffer))) {
|
||||
printf("%s\n", _("UPS name to long for buffer"));
|
||||
return ERROR;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ main (int argc, char **argv)
|
|||
char *sub;
|
||||
char **command_line;
|
||||
output chld_out, chld_err;
|
||||
int i;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
|
|
@ -86,7 +85,7 @@ main (int argc, char **argv)
|
|||
result = cmd_run_array (command_line, &chld_out, &chld_err, 0);
|
||||
}
|
||||
if (chld_err.lines > 0) {
|
||||
for (i = 0; i < chld_err.lines; i++) {
|
||||
for (size_t i = 0; i < chld_err.lines; i++) {
|
||||
fprintf (stderr, "%s\n", chld_err.line[i]);
|
||||
}
|
||||
}
|
||||
|
|
@ -95,7 +94,7 @@ main (int argc, char **argv)
|
|||
if (chld_out.lines == 0)
|
||||
die (max_state_alt (result, STATE_UNKNOWN), _("No data returned from command\n"));
|
||||
|
||||
for (i = 0; i < chld_out.lines; i++) {
|
||||
for (size_t i = 0; i < chld_out.lines; i++) {
|
||||
if (subst_text && result >= 0 && result <= 4 && result != state[result]) {
|
||||
/* Loop over each match found */
|
||||
while ((sub = strstr (chld_out.line[i], state_text (result)))) {
|
||||
|
|
|
|||
|
|
@ -240,13 +240,12 @@ np_runcmd_close(int fd)
|
|||
void
|
||||
runcmd_timeout_alarm_handler (int signo)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (signo == SIGALRM)
|
||||
puts(_("CRITICAL - Plugin timed out while executing system call"));
|
||||
|
||||
long maxfd = mp_open_max();
|
||||
if(np_pids) for(i = 0; i < maxfd; i++) {
|
||||
if(np_pids) for(long int i = 0; i < maxfd; i++) {
|
||||
if(np_pids[i] != 0) kill(np_pids[i], SIGKILL);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -230,13 +230,21 @@ bool is_intnonneg (char *number) {
|
|||
*/
|
||||
bool is_int64(char *number, int64_t *target) {
|
||||
errno = 0;
|
||||
uint64_t tmp = strtoll(number, NULL, 10);
|
||||
char *endptr = { 0 };
|
||||
|
||||
int64_t tmp = strtoll(number, &endptr, 10);
|
||||
if (errno != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (*endptr == '\0') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (tmp < INT64_MIN || tmp > INT64_MAX) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target != NULL) {
|
||||
*target = tmp;
|
||||
}
|
||||
|
|
|
|||
11
po/ChangeLog
11
po/ChangeLog
|
|
@ -1,11 +0,0 @@
|
|||
2003-07-02 gettextize <bug-gnu-gettext@gnu.org>
|
||||
|
||||
* Makefile.in.in: New file, from gettext-0.11.4.
|
||||
* boldquot.sed: New file, from gettext-0.11.4.
|
||||
* en@boldquot.header: New file, from gettext-0.11.4.
|
||||
* en@quot.header: New file, from gettext-0.11.4.
|
||||
* insert-header.sin: New file, from gettext-0.11.4.
|
||||
* quot.sed: New file, from gettext-0.11.4.
|
||||
* remove-potcdate.sin: New file, from gettext-0.11.4.
|
||||
* Rules-quot: New file, from gettext-0.11.4.
|
||||
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
fr de
|
||||
|
||||
|
|
@ -1,395 +0,0 @@
|
|||
# -*- buffer-read-only: t -*- vi: set ro:
|
||||
# DO NOT EDIT! GENERATED AUTOMATICALLY!
|
||||
# Makefile for PO directory in any package using GNU gettext.
|
||||
# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
#
|
||||
# This file can be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU General Public
|
||||
# License but which still want to provide support for the GNU gettext
|
||||
# functionality.
|
||||
# Please note that the actual code of GNU gettext is covered by the GNU
|
||||
# General Public License and is *not* in the public domain.
|
||||
#
|
||||
# Origin: gettext-0.15
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
||||
SHELL = /bin/sh
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
datarootdir = @datarootdir@
|
||||
datadir = @datadir@
|
||||
localedir = @localedir@
|
||||
gettextsrcdir = $(datadir)/gettext/po
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
mkinstalldirs = $(SHELL) @install_sh@ -d
|
||||
mkdir_p = @MKDIR_P@
|
||||
|
||||
GMSGFMT_ = @GMSGFMT@
|
||||
GMSGFMT_no = @GMSGFMT@
|
||||
GMSGFMT_yes = @GMSGFMT_015@
|
||||
GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
|
||||
MSGFMT_ = @MSGFMT@
|
||||
MSGFMT_no = @MSGFMT@
|
||||
MSGFMT_yes = @MSGFMT_015@
|
||||
MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
|
||||
XGETTEXT_ = @XGETTEXT@
|
||||
XGETTEXT_no = @XGETTEXT@
|
||||
XGETTEXT_yes = @XGETTEXT_015@
|
||||
XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
|
||||
MSGMERGE = msgmerge
|
||||
MSGMERGE_UPDATE = @MSGMERGE@ --update
|
||||
MSGINIT = msginit
|
||||
MSGCONV = msgconv
|
||||
MSGFILTER = msgfilter
|
||||
|
||||
POFILES = @POFILES@
|
||||
GMOFILES = @GMOFILES@
|
||||
UPDATEPOFILES = @UPDATEPOFILES@
|
||||
DUMMYPOFILES = @DUMMYPOFILES@
|
||||
DISTFILES.common = Makefile.in.in remove-potcdate.sin \
|
||||
$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
|
||||
DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
|
||||
$(POFILES) $(GMOFILES) \
|
||||
$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
|
||||
|
||||
POTFILES = \
|
||||
|
||||
CATALOGS = @CATALOGS@
|
||||
|
||||
# Makevars gets inserted here. (Don't remove this line!)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
|
||||
|
||||
.po.mo:
|
||||
@echo "$(MSGFMT) -c -o $@ $<"; \
|
||||
$(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
|
||||
|
||||
.po.gmo:
|
||||
@lang=`echo $* | sed -e 's,.*/,,'`; \
|
||||
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
|
||||
echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
|
||||
cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
|
||||
|
||||
.sin.sed:
|
||||
sed -e '/^#/d' $< > t-$@
|
||||
mv t-$@ $@
|
||||
|
||||
|
||||
all: all-@USE_NLS@
|
||||
|
||||
all-yes: stamp-po
|
||||
all-no:
|
||||
|
||||
# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
|
||||
# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
|
||||
# we don't want to bother translators with empty POT files). We assume that
|
||||
# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
|
||||
# In this case, stamp-po is a nop (i.e. a phony target).
|
||||
|
||||
# stamp-po is a timestamp denoting the last time at which the CATALOGS have
|
||||
# been loosely updated. Its purpose is that when a developer or translator
|
||||
# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
|
||||
# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
|
||||
# invocations of "make" will do nothing. This timestamp would not be necessary
|
||||
# if updating the $(CATALOGS) would always touch them; however, the rule for
|
||||
# $(POFILES) has been designed to not touch files that don't need to be
|
||||
# changed.
|
||||
stamp-po: $(srcdir)/$(DOMAIN).pot
|
||||
test ! -f $(srcdir)/$(DOMAIN).pot || \
|
||||
test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
|
||||
@test ! -f $(srcdir)/$(DOMAIN).pot || { \
|
||||
echo "touch stamp-po" && \
|
||||
echo timestamp > stamp-poT && \
|
||||
mv stamp-poT stamp-po; \
|
||||
}
|
||||
|
||||
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
|
||||
# otherwise packages like GCC can not be built if only parts of the source
|
||||
# have been downloaded.
|
||||
|
||||
# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
|
||||
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
|
||||
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
|
||||
if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
|
||||
msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
|
||||
else \
|
||||
msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
|
||||
fi; \
|
||||
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
|
||||
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
|
||||
--files-from=$(srcdir)/POTFILES.in \
|
||||
--copyright-holder='$(COPYRIGHT_HOLDER)' \
|
||||
--msgid-bugs-address="$$msgid_bugs_address"
|
||||
test ! -f $(DOMAIN).po || { \
|
||||
if test -f $(srcdir)/$(DOMAIN).pot; then \
|
||||
sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
|
||||
sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
|
||||
if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
|
||||
rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
|
||||
else \
|
||||
rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
|
||||
mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
|
||||
fi; \
|
||||
else \
|
||||
mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
|
||||
fi; \
|
||||
}
|
||||
|
||||
# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
|
||||
# every "make" invocation, only create it when it is missing.
|
||||
# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
|
||||
$(srcdir)/$(DOMAIN).pot:
|
||||
$(MAKE) $(DOMAIN).pot-update
|
||||
|
||||
# This target rebuilds a PO file if $(DOMAIN).pot has changed.
|
||||
# Note that a PO file is not touched if it doesn't need to be changed.
|
||||
$(POFILES): $(srcdir)/$(DOMAIN).pot
|
||||
@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
|
||||
if test -f "$(srcdir)/$${lang}.po"; then \
|
||||
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
|
||||
echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
|
||||
cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
|
||||
else \
|
||||
$(MAKE) $${lang}.po-create; \
|
||||
fi
|
||||
|
||||
|
||||
install: install-exec install-data
|
||||
install-exec:
|
||||
install-data: install-data-@USE_NLS@
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
|
||||
for file in $(DISTFILES.common) Makevars.template; do \
|
||||
$(INSTALL_DATA) $(srcdir)/$$file \
|
||||
$(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
for file in Makevars; do \
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
$(mkdir_p) $(DESTDIR)$(datadir)
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
|
||||
dir=$(localedir)/$$lang/LC_MESSAGES; \
|
||||
$(mkdir_p) $(DESTDIR)$$dir; \
|
||||
if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
|
||||
$(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
|
||||
echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
|
||||
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
|
||||
if test -n "$$lc"; then \
|
||||
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
|
||||
link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
|
||||
mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
|
||||
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
(cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
|
||||
for file in *; do \
|
||||
if test -f $$file; then \
|
||||
ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
|
||||
fi; \
|
||||
done); \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
|
||||
else \
|
||||
if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
|
||||
:; \
|
||||
else \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
fi; \
|
||||
fi; \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
|
||||
ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
|
||||
ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
|
||||
cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
|
||||
echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
|
||||
fi; \
|
||||
done; \
|
||||
done
|
||||
|
||||
install-strip: install
|
||||
|
||||
installdirs: installdirs-exec installdirs-data
|
||||
installdirs-exec:
|
||||
installdirs-data: installdirs-data-@USE_NLS@
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
installdirs-data-no:
|
||||
installdirs-data-yes:
|
||||
$(mkdir_p) $(DESTDIR)$(datadir)
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
|
||||
dir=$(localedir)/$$lang/LC_MESSAGES; \
|
||||
$(mkdir_p) $(DESTDIR)$$dir; \
|
||||
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
|
||||
if test -n "$$lc"; then \
|
||||
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
|
||||
link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
|
||||
mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
|
||||
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
(cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
|
||||
for file in *; do \
|
||||
if test -f $$file; then \
|
||||
ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
|
||||
fi; \
|
||||
done); \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
|
||||
else \
|
||||
if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
|
||||
:; \
|
||||
else \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
fi; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
done
|
||||
|
||||
# Define this as empty until I found a useful application.
|
||||
installcheck:
|
||||
|
||||
uninstall: uninstall-exec uninstall-data
|
||||
uninstall-exec:
|
||||
uninstall-data: uninstall-data-@USE_NLS@
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
for file in $(DISTFILES.common) Makevars.template; do \
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
uninstall-data-no:
|
||||
uninstall-data-yes:
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
|
||||
for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
|
||||
done; \
|
||||
done
|
||||
|
||||
check: all
|
||||
|
||||
info dvi ps pdf html tags TAGS ctags CTAGS ID:
|
||||
|
||||
mostlyclean:
|
||||
rm -f remove-potcdate.sed
|
||||
rm -f stamp-poT
|
||||
rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
|
||||
rm -fr *.o
|
||||
|
||||
clean: mostlyclean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile Makefile.in POTFILES *.mo
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
rm -f stamp-po $(GMOFILES)
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir:
|
||||
$(MAKE) update-po
|
||||
@$(MAKE) dist2
|
||||
# This is a separate target because 'update-po' must be executed before.
|
||||
dist2: stamp-po $(DISTFILES)
|
||||
dists="$(DISTFILES)"; \
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
dists="$$dists Makevars.template"; \
|
||||
fi; \
|
||||
if test -f $(srcdir)/$(DOMAIN).pot; then \
|
||||
dists="$$dists $(DOMAIN).pot stamp-po"; \
|
||||
fi; \
|
||||
if test -f $(srcdir)/ChangeLog; then \
|
||||
dists="$$dists ChangeLog"; \
|
||||
fi; \
|
||||
for i in 0 1 2 3 4 5 6 7 8 9; do \
|
||||
if test -f $(srcdir)/ChangeLog.$$i; then \
|
||||
dists="$$dists ChangeLog.$$i"; \
|
||||
fi; \
|
||||
done; \
|
||||
if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
|
||||
for file in $$dists; do \
|
||||
if test -f $$file; then \
|
||||
cp -p $$file $(distdir) || exit 1; \
|
||||
else \
|
||||
cp -p $(srcdir)/$$file $(distdir) || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
update-po: Makefile
|
||||
$(MAKE) $(DOMAIN).pot-update
|
||||
test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
|
||||
$(MAKE) update-gmo
|
||||
|
||||
# General rule for creating PO files.
|
||||
|
||||
.nop.po-create:
|
||||
@lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
|
||||
echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
|
||||
exit 1
|
||||
|
||||
# General rule for updating PO files.
|
||||
|
||||
.nop.po-update:
|
||||
@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
|
||||
tmpdir=`pwd`; \
|
||||
echo "$$lang:"; \
|
||||
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
|
||||
echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
|
||||
cd $(srcdir); \
|
||||
if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
|
||||
if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
|
||||
rm -f $$tmpdir/$$lang.new.po; \
|
||||
else \
|
||||
if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
|
||||
:; \
|
||||
else \
|
||||
echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
else \
|
||||
echo "msgmerge for $$lang.po failed!" 1>&2; \
|
||||
rm -f $$tmpdir/$$lang.new.po; \
|
||||
fi
|
||||
|
||||
$(DUMMYPOFILES):
|
||||
|
||||
update-gmo: Makefile $(GMOFILES)
|
||||
@:
|
||||
|
||||
Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
|
||||
cd $(top_builddir) \
|
||||
&& $(SHELL) ./config.status $(subdir)/$@.in po-directories
|
||||
|
||||
force:
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
29
po/Makevars
29
po/Makevars
|
|
@ -1,29 +0,0 @@
|
|||
# Makefile variables for PO directory in any package using GNU gettext.
|
||||
|
||||
# Usually the message domain is the same as the package name.
|
||||
DOMAIN = $(PACKAGE)
|
||||
|
||||
# These two variables depend on the location of this directory.
|
||||
subdir = po
|
||||
top_builddir = ..
|
||||
|
||||
# These options get passed to xgettext.
|
||||
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --flag=error:3:c-format --flag=error_at_line:5:c-format --flag=asprintf:2:c-format --flag=vasprintf:2:c-format --no-location
|
||||
|
||||
# This is the copyright holder that gets inserted into the header of the
|
||||
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
|
||||
# package. (Note that the msgstr strings, extracted from the package's
|
||||
# sources, belong to the copyright holder of the package.) Translators are
|
||||
# expected to transfer the copyright for their translations to this person
|
||||
# or entity, or to disclaim their copyright. The empty string stands for
|
||||
# the public domain; in this case the translators are expected to disclaim
|
||||
# their copyright.
|
||||
COPYRIGHT_HOLDER = Monitoring Plugins Development Team
|
||||
|
||||
# This is the list of locale categories, beyond LC_MESSAGES, for which the
|
||||
# message catalogs shall be used. It is usually empty.
|
||||
EXTRA_LOCALE_CATEGORIES =
|
||||
|
||||
# Email address were to send bug report for the .po translation files
|
||||
PACKAGE_BUGREPORT = devel@monitoring-plugins.org
|
||||
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
plugins/check_by_ssh.c
|
||||
plugins/check_cluster.c
|
||||
plugins/check_dig.c
|
||||
plugins/check_disk.c
|
||||
plugins/check_dns.c
|
||||
plugins/check_dummy.c
|
||||
plugins/check_fping.c
|
||||
plugins/check_game.c
|
||||
plugins/check_hpjd.c
|
||||
plugins/check_http.c
|
||||
plugins/check_ldap.c
|
||||
plugins/check_load.c
|
||||
plugins/check_mrtg.c
|
||||
plugins/check_mrtgtraf.c
|
||||
plugins/check_mysql.c
|
||||
plugins/check_nagios.c
|
||||
plugins/check_nt.c
|
||||
plugins/check_ntp.c
|
||||
plugins/check_ntp_peer.c
|
||||
plugins/check_ntp_time.c
|
||||
plugins/check_nwstat.c
|
||||
plugins/check_overcr.c
|
||||
plugins/check_pgsql.c
|
||||
plugins/check_ping.c
|
||||
plugins/check_procs.c
|
||||
plugins/check_radius.c
|
||||
plugins/check_real.c
|
||||
plugins/check_smtp.c
|
||||
plugins/check_snmp.c
|
||||
plugins/check_ssh.c
|
||||
plugins/check_swap.c
|
||||
plugins/check_tcp.c
|
||||
plugins/check_time.c
|
||||
plugins/check_ups.c
|
||||
plugins/check_users.c
|
||||
plugins/check_ide_smart.c
|
||||
plugins/negate.c
|
||||
plugins/netutils.c
|
||||
plugins/popen.c
|
||||
plugins/urlize.c
|
||||
plugins/utils.c
|
||||
plugins/utils.h
|
||||
plugins-root/check_dhcp.c
|
||||
plugins-root/check_icmp.c
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,19 +0,0 @@
|
|||
# Sed script that remove the POT-Creation-Date line in the header entry
|
||||
# from a POT file.
|
||||
#
|
||||
# The distinction between the first and the following occurrences of the
|
||||
# pattern is achieved by looking at the hold space.
|
||||
/^"POT-Creation-Date: .*"$/{
|
||||
x
|
||||
# Test if the hold space is empty.
|
||||
s/P/P/
|
||||
ta
|
||||
# Yes it was empty. First occurrence. Remove the line.
|
||||
g
|
||||
d
|
||||
bb
|
||||
:a
|
||||
# The hold space was nonempty. Following occurrences. Do nothing.
|
||||
x
|
||||
:b
|
||||
}
|
||||
Loading…
Reference in a new issue