diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2010-12-03 19:25:55 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2010-12-03 19:25:55 +0000 |
commit | 3250ba1805605ea2fdd15ff577f7995f46ccec6d (patch) | |
tree | bd7d52194acd72f3d1a6ee3ca8291ec2de4bf8d0 | |
parent | b7caea4e86d8135b2289a46a83c862b7ad0964e6 (diff) | |
download | perl-URPM-3250ba1805605ea2fdd15ff577f7995f46ccec6d.tar perl-URPM-3250ba1805605ea2fdd15ff577f7995f46ccec6d.tar.gz perl-URPM-3250ba1805605ea2fdd15ff577f7995f46ccec6d.tar.bz2 perl-URPM-3250ba1805605ea2fdd15ff577f7995f46ccec6d.tar.xz perl-URPM-3250ba1805605ea2fdd15ff577f7995f46ccec6d.zip |
fix parsing of NEVRA for 'gpg-pubkey'
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | URPM.xs | 14 |
2 files changed, 14 insertions, 4 deletions
@@ -1,3 +1,7 @@ +Version 4.3 - + +- fix NEVRA parsing of 'gpg-pubkey' + Version 4.2 - 3 Dec 2010, by Per Øyvind Karlsen - fix URPM::Package::files() @@ -249,12 +249,17 @@ get_evr(URPM__Package pkg) { return evr; } -/* This function might modify strings that needs to be reverted after use +/* This function might modify strings that needs to be restored after use * with restore_chars() */ static int get_fullname_parts(URPM__Package pkg, char **name, int *epoch, char **version, char **release, char **disttag, char **distepoch, char **arch, char **eos) { char *_version = NULL, *_release = NULL, *_disttag = NULL, *_distepoch = NULL, *_arch = NULL, *_eos = NULL, *tmp = NULL; + /* XXX: Could've probably be written in a more generic way, only thing we + * really want to do is to check for arch field, which will be missing in + * the case of gpg-pubkey at least.. + */ + int pubkey; if(pkg->info) { if ((_eos = strchr(pkg->info, '@')) != NULL) { @@ -262,9 +267,10 @@ get_fullname_parts(URPM__Package pkg, char **name, int *epoch, char **version, c if(name != NULL || version != NULL || release != NULL || disttag != NULL || distepoch != NULL || arch != NULL) { backup_char(_eos); if (eos != NULL) *eos = _eos+1; - if ((_arch = strrchr(pkg->info, '.')) != NULL) { - backup_char(_arch); - if (arch != NULL) *arch = _arch + 1; + if ((pubkey = !strncmp(pkg->info, "gpg-pubkey", 10)) || (_arch = strrchr(pkg->info, '.')) != NULL) { + if(!pubkey) + backup_char(_arch); + if (arch != NULL) *arch = pubkey ? "" : _arch + 1; if (distepoch != NULL || disttag != NULL || release != NULL || version != NULL || name != NULL) { if((_distepoch = strchr(strrchr(pkg->provides, '-'), ':')) != NULL) { tmp = strrchr(_distepoch+1, ']'); |