diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-01-23 10:42:28 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-01-23 10:42:28 +0000 |
commit | cb154006b79ba10970befb0bf7824586455bcf90 (patch) | |
tree | 4054d16d2a810090f027cf0a13ffd9d68a72bf08 | |
parent | 320ea473fc246f6d4efd500da993bfeeb36f82cc (diff) | |
download | perl-URPM-cb154006b79ba10970befb0bf7824586455bcf90.tar perl-URPM-cb154006b79ba10970befb0bf7824586455bcf90.tar.gz perl-URPM-cb154006b79ba10970befb0bf7824586455bcf90.tar.bz2 perl-URPM-cb154006b79ba10970befb0bf7824586455bcf90.tar.xz perl-URPM-cb154006b79ba10970befb0bf7824586455bcf90.zip |
fix parsing of disttag from synthesis
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | URPM.xs | 25 |
2 files changed, 10 insertions, 20 deletions
@@ -1,3 +1,8 @@ +Version 4.13 - 23 Jan 2011, by Per Øyvind Karlsen + +- fix parsing of disttag from synthesis +- add regression checks for the fields extracted from synthesis + Version 4.12 - 23 Jan 2011, by Per Øyvind Karlsen - order of %PROVIDEVERSION isn't always the same for all rpm versions synthesis @@ -317,34 +317,19 @@ get_fullname_parts_info(URPM__Package pkg, char **name, int *epoch, char **versi backup_char(_arch++); if (arch != NULL) *arch = pubkey ? "" : _arch; if (distepoch != NULL || disttag != NULL || release != NULL || version != NULL || name != NULL) { + /* TODO: implement stricter patterns and different separator for disttag/distepoch */ if ((_distepoch = strchr(strrchr(pkg->provides, '-'), ':')) != NULL) { if ((tmp = strrchr(++_distepoch, ']'))) { backup_char(tmp); - if ((tmp = strrchr(pkg->info, '-')) && ((tmp2 = strstr(tmp, _distepoch)))) - backup_char(tmp); - else { - /* If synthesis is generated with older versions, disttag & distepoch will - * not be part of NVRA at beginning of line, but as it'll still be part of - * filename which is located at end of line, we can live with it as long - * as we're aware of it and take the necessary precautions to cope. - */ - if ((tmp = strrchr(_eos, '-'))) { - if ((tmp2 = strstr(tmp++, _distepoch))) { - backup_char(tmp2); - _disttag = tmp; - } - } + if (((tmp = strrchr(_eos, '-')) || (tmp = strrchr(pkg->info, '-'))) && ((tmp2 = strstr(tmp, _distepoch)))) { + backup_char(tmp++); + _disttag = tmp; + backup_char(tmp2); } } } if (distepoch != NULL) *distepoch = _distepoch ? _distepoch : ""; if (disttag != NULL || release != NULL || version != NULL || name != NULL) { - if (_disttag == NULL) { - /* XXX: re-verify this logic, see comment above.. */ - if ((_disttag = tmp2) != NULL && (strstr(pkg->provides, _disttag)) == NULL) { - backup_char(_disttag++); - } else _disttag = NULL; - } if (disttag != NULL) *disttag = _disttag ? _disttag : ""; if ((release != NULL || version != NULL || name != NULL) && (_release = strrchr(pkg->info, '-')) != NULL) { backup_char(_release++); |