Fix backward compatibility with non-epoch builddates
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
6aac221879
commit
60dc4b43fd
1 changed files with 8 additions and 3 deletions
|
@ -840,9 +840,14 @@ static int parse_descfile(const char *descfile, pmpkg_t *info)
|
||||||
} else if(!strcmp(key, "license")) {
|
} else if(!strcmp(key, "license")) {
|
||||||
info->licenses = alpm_list_add(info->licenses, strdup(ptr));
|
info->licenses = alpm_list_add(info->licenses, strdup(ptr));
|
||||||
} else if(!strcmp(key, "builddate")) {
|
} else if(!strcmp(key, "builddate")) {
|
||||||
info->builddate = atol(ptr);
|
char first = tolower(ptr[0]);
|
||||||
} else if(!strcmp(key, "installdate")) {
|
if(first > 'a' && first < 'z') {
|
||||||
info->installdate = atol(ptr);
|
struct tm tmp_tm = {0}; //initialize to null incase of failure
|
||||||
|
strptime(ptr, "%a %b %e %H:%M:%S %Y", &tmp_tm);
|
||||||
|
info->builddate = mktime(&tmp_tm);
|
||||||
|
} else {
|
||||||
|
info->builddate = atol(ptr);
|
||||||
|
}
|
||||||
} else if(!strcmp(key, "packager")) {
|
} else if(!strcmp(key, "packager")) {
|
||||||
strncpy(info->packager, ptr, sizeof(info->packager));
|
strncpy(info->packager, ptr, sizeof(info->packager));
|
||||||
} else if(!strcmp(key, "arch")) {
|
} else if(!strcmp(key, "arch")) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue