On Wed, Jun 22, 2011 at 06:05:06PM +1000, Allan McRae wrote: > On 21/06/11 05:46, Dave Reisner wrote: > >This is basically what I referred to in my last patch about refactoring > >desc/depends writing. I snuck in an extra winner (the first) to get rid > >of the insane IFS tweaking and iteration of the .PKGINFO file with a for > >loop. > > > >Dan, I'm not sure if I can break this up any further, but I'm happy to > >refactor > >if it would make you more comfortable. I know it's an insanely important code > >path so I encourage you (and anyone else reading) to put on your nerd glasses > >and nitpick this. > > > >Dave Reisner (3): > > repo-add: bashify reading of .PKGINFO file > > repo-add: store multi-value fields as arrays > > repo-add: use format_entry for all desc/depends fields > > > > scripts/repo-add.sh.in | 105 > > +++++++++++++++++++++++------------------------ > > 1 files changed, 51 insertions(+), 54 deletions(-) > > > > No ack. > > Something here is entirely screwed under bash-3.2. We still have > people using pacman with that version of bash. I think it does not > output any of these fields... > > -%CONFLICTS% > -%DEPENDS% > -%GROUPS% > -%LICENSE% > -%OPTDEPENDS% > -%PROVIDES% > -%REPLACES% > > That looks like anything in an array...
Good catch. I had rebased this at some point and somewhere along the way, the arrays were no longer declared as arrays. fixed locally. > To test, I created a repo with all packages in Arch starting with > "a". Under bash-4.2, there was only a small difference in the > output: > > e.g. asymptote-2.11-1 > > %OPTDEPENDS% > -python2: for the xasy GUI > -python-imaging: for the xasy GUI > -tix: for the xasy GUI > +python2: for the xasy GUI > +python-imaging: for the xasy GUI > +tix: for the xasy GUI > > This makes the formatting the same as that used in the PKGBUILD. > Not sure I like that either... > > Allan > I don't like this easier. It looks like I underestimated what the sed expression did here -- we can normalize whitespace another way though. Thanks for the test case. d
