Push RPMDBI_LABEL arch parsing down to rpmdb layer to fix stuff
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 6 Sep 2012 07:25:38 +0000 (10:25 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 6 Sep 2012 07:40:36 +0000 (10:40 +0300)
commitfddfee17c3c4e19269665800d557d3452cbde162
treed814f51c78be179e15b6668a7248795d5b33fd97
parent2ef9380afe12fb4fb2094bda3930e365fee3bf58
Push RPMDBI_LABEL arch parsing down to rpmdb layer to fix stuff

- Partial NEVRA labels cannot be reliably parsed, the various combinations
  need to be figured out by trial-and-error. The rpmts layer doesn't stand
  a chance of getting it right so move it to rpmdb layer. This doesn't
  make the process any less stupid, but at least we get correct results...
- Fixes iterator count when arch is used in a label and more than one
  arch variants of a package are installed. Previously iterator count
  could be more than one despite actual iteration only hitting one
  match, as the arch RE match was added after already initializing
  the iterator.
- Also fixes various pathological cases:
  - If a legal arch was part of name, version or release (stupid but legal)
    we misinterpreted it for arch and failed to find the package.
  - If a package with unknown architecture was installed (with --ignorearch)
    we could not remove it by its arch as we relied on rpmIsKnownArch()
lib/rpmdb.c
lib/rpmts.c