On Jan 19, 2011, at 7:45 AM, Per Øyvind Karlsen wrote: > For RPMTAG_NVRA to expand to using%{___NVRA}, I found myself > having to modify hGetNevra(). >
Why did you have to modify? While this setting is a huge mess, its _IS_ adequate to compose an "identification" string based on other tag data: %___NVRA %%{NAME}-%%{VERSION}-%%{RELEASE}%%|DISTTAG?{-%%{DISTTAG}%%|DISTEPOCH?{%%{DISTEPOCH}}|}|%%|ARCH?{.%%|SOURCERPM?{%%{ARCH}}:{src}|}:{}| I fail to understand why changes to hGetNevra() method are _ALSO_ needed. > To make dbiFindMatches() to match -%{disttag}%{distepoch}, I changed > _post_NVRA to: > > static const char _post_NVRA[] = > "(-[^-]+-[^-]+-[^-]+\\.[^.]+|-[^-]+-[^-]+\\.[^.]+|-[^-]+\\.[^.]+|\\.[^.]+|)$"; > > This expression gets too greedy for packages with '-' in the name and > without disttag/distepoch though.. > Yes _post_NVRA MUST be able to parse through variant (like N.A or N-V.A) forms using a pattern. If you can't write a pattern (usually as a tail anchor'es *RE, the usual parsing rule is that the last 2 '-' characters are GUARANTEED to surround V) for NVRA strings that include Disttag/Distepoch, well, you are likely screwed. > ie. 'rpm -q foo' might return: > foo-1-1-mdv2011.0.x86_64 > foo-bar-1-1mdv2011.0.x86_64 > Yep. Can't tell what's what because the syntax isn't predictable. I'd start planning a parseable convention NOW. I cannot save a DWIM scheme at this point in time. The right time for discussion was 2 years ago if other parsing conventions are/were needed. 73 de Jeff > ---------- Forwarded message ---------- > From: Jeff Johnson <n3...@mac.com> > Date: 2011/1/19 > Subject: Re: [Cooker] Warning: remaining bugs in RPM ? (no distro tag) > To: coo...@mandrivalinux.org > > > > On Jan 19, 2011, at 7:02 AM, Per Øyvind Karlsen wrote: > >>> >>> I fail to understand "manually", nor is there a downside (as >>> long as RPM never has to look up localized package depedencies). >> To get %{NVRA} to return the same, the macro needs to be expanded in >> rpmdb/hdrfmt.c:hGetNevra() >> though. I've not been able to get the matching in dbiFindMatches() to >> work with it though.. >> > > Dunno why you are in hGetNevra(), but I'm sure that there's a fix. > I'd need a clearer explanation (on <rpm-devel@>) of what you need to suggest > or implement something. > > 73 de Jeff > ______________________________________________________________________ > RPM Package Manager http://rpm5.org > Developer Communication List rpm-devel@rpm5.org
smime.p7s
Description: S/MIME cryptographic signature