mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-21 23:38:49 -05:00
Removed hardcoded reference to fields of packages
This commit is contained in:
parent
d109550656
commit
7a01ed50b9
@ -291,18 +291,18 @@ void *alpm_pkg_getinfo(PM_PKG *pkg, unsigned char parm)
|
||||
case PM_PKG_FILES:
|
||||
case PM_PKG_BACKUP:
|
||||
if(!(pkg->infolevel & INFRQ_FILES)) {
|
||||
char target[321]; /* 256+1+64 */
|
||||
char target[PKG_NAME_LEN+1+PKG_VERSION_LEN];
|
||||
|
||||
snprintf(target, 321, "%s-%s", pkg->name, pkg->version);
|
||||
snprintf(target, PKG_NAME_LEN+1+PKG_VERSION_LEN, "%s-%s", pkg->name, pkg->version);
|
||||
db_read(pkg->data, target, INFRQ_FILES, pkg);
|
||||
}
|
||||
break;
|
||||
|
||||
case PM_PKG_SCRIPLET:
|
||||
if(!(pkg->infolevel & INFRQ_SCRIPLET)) {
|
||||
char target[321];
|
||||
char target[PKG_NAME_LEN+1+PKG_VERSION_LEN];
|
||||
|
||||
snprintf(target, 321, "%s-%s", pkg->name, pkg->version);
|
||||
snprintf(target, PKG_NAME_LEN+1+PKG_VERSION_LEN, "%s-%s", pkg->name, pkg->version);
|
||||
db_read(pkg->data, target, INFRQ_SCRIPLET, pkg);
|
||||
}
|
||||
break;
|
||||
|
@ -23,20 +23,32 @@
|
||||
|
||||
#include "list.h"
|
||||
|
||||
#define PKG_FROM_CACHE 1
|
||||
#define PKG_FROM_FILE 2
|
||||
enum {
|
||||
PKG_FROM_CACHE = 1,
|
||||
PKG_FROM_FILE
|
||||
};
|
||||
|
||||
#define PKG_NAME_LEN 256
|
||||
#define PKG_VERSION_LEN 64
|
||||
#define PKG_DESC_LEN 512
|
||||
#define PKG_URL_LEN 256
|
||||
#define PKG_LICENSE_LEN 256
|
||||
#define PKG_DATE_LEN 32
|
||||
#define PKG_PACKAGER_LEN 64
|
||||
#define PKG_MD5SUM_LEN 33
|
||||
#define PKG_ARCH_LEN 32
|
||||
|
||||
typedef struct __pmpkg_t {
|
||||
char name[256];
|
||||
char version[64];
|
||||
char desc[512];
|
||||
char url[256];
|
||||
char license[128];
|
||||
char builddate[32];
|
||||
char installdate[32];
|
||||
char packager[64];
|
||||
char md5sum[33];
|
||||
char arch[32];
|
||||
char name[PKG_NAME_LEN];
|
||||
char version[PKG_VERSION_LEN];
|
||||
char desc[PKG_DESC_LEN];
|
||||
char url[PKG_URL_LEN];
|
||||
char license[PKG_LICENSE_LEN];
|
||||
char builddate[PKG_DATE_LEN];
|
||||
char installdate[PKG_DATE_LEN];
|
||||
char packager[PKG_PACKAGER_LEN];
|
||||
char md5sum[PKG_MD5SUM_LEN];
|
||||
char arch[PKG_ARCH_LEN];
|
||||
unsigned long size;
|
||||
unsigned char scriptlet;
|
||||
unsigned char force;
|
||||
|
Loading…
Reference in New Issue
Block a user