]> git.pld-linux.org Git - packages/net-snmp.git/blobdiff - swinst_apt.patch
- perl req/prov fix
[packages/net-snmp.git] / swinst_apt.patch
index 44030b0c2a672f7cf4df55c7454385664b1282f1..7c8724581716cb48cf7761643f7bd439f4147179 100644 (file)
@@ -47,7 +47,7 @@ Signed-Off-By: Elan Ruusamäe <glen@pld-linux.org>
  netsnmp_swinst_arch_load( netsnmp_container *container, u_int flags)
  {
 -    FILE *p = popen("dpkg-query --show --showformat '${Package}#${Version}#${Section}#${Priority}#${Essential}#${Status}\n'", "r");
-+    FILE *p = popen("dpkg-query --show --showformat '${Package}#${Version}#${Section}#${Priority}#${Essential}#${Archidecture}#${Status}\n'", "r");
++    FILE *p = popen("dpkg-query --show --showformat '${Package}#${Version}#${Section}#${Priority}#${Essential}#${Architecture}#${Status}\n'", "r");
      char package[SNMP_MAXBUF];
      char version[SNMP_MAXBUF];
      char section[SNMP_MAXBUF];
@@ -56,14 +56,14 @@ Signed-Off-By: Elan Ruusamäe <glen@pld-linux.org>
 +    char arch[SNMP_MAXBUF];
      char status[SNMP_MAXBUF];
      char buf[BUFSIZ];
-+    struct stat       stat_buf;
++    struct stat stat_buf;
      netsnmp_swinst_entry *entry;
 +    u_char *date_buf;
 +    size_t date_len;
      int i = 0;
  
      if (p == NULL) {
-@@ -78,20 +86,37 @@
+@@ -78,20 +86,39 @@
              continue;   /* error already logged by function */
          CONTAINER_INSERT(container, entry);
  
@@ -92,9 +92,11 @@ Signed-Off-By: Elan Ruusamäe <glen@pld-linux.org>
 +        } else {
 +            /* somewhy some files include :arch in .list name */
 +            snprintf(file, sizeof(file), "%s/%s:%s.list", pkg_directory, package, arch);
-+            date_buf = date_n_time(&stat_buf.st_mtime, &date_len);
-+            entry->swDate_len = date_len;
-+            memcpy(entry->swDate, date_buf, entry->swDate_len);
++            if(stat(file, &stat_buf) != -1) {
++                date_buf = date_n_time(&stat_buf.st_mtime, &date_len);
++                entry->swDate_len = date_len;
++                memcpy(entry->swDate, date_buf, entry->swDate_len);
++            }
 +        }
 +        /* FIXME, or fallback to whatever nonsesnse was here before, or leave it uninitialied?
 +             else {
This page took 0.029974 seconds and 4 git commands to generate.