Subject: Makefiles or So Many Ways Of Getting Package Versions
To: None <tech-pkg@netbsd.org>
From: Randy Beaudreault <maccult@pacbell.net>
List: tech-pkg
Date: 09/30/2003 12:44:31
--============_-1147171420==_============
Content-Type: text/plain; charset="us-ascii" ; format="flowed"

Why are there the great variety of ways of setting up Makefiles in 
pkgsrc?  I'm attempting to make a FinkCommander-style app for pkgsrc 
on OS X and the first thing I want to do is get all the versions of 
the packages in pkgsrc.  I started this thinking this shouldn't be so 
hard, just write a shell or Perl script to parse the Makefiles in 
each package directory thinking that I should only have to parse the 
Makefiles in, at most, 3 or 4 ways.  Nope, I'm up to 4 ways in my 
Perl script, not counting what I'll be using to get the versions of 
Perl, and these are just the most common ways.  Why do we have so 
many different ways of setting the package revision?  Isn't there a 
standard way that package versions should be set up in the Makefiles? 
I'm attaching my Perl script that does this version parsing to show 
you the 4 ways I've identified so far that I have to parse the 
Makefiles to grap the package version.
-- 
Randy

OS X - UNIX for the rest of us
NetBSD - Catch the Power!
--============_-1147171420==_============
Content-Id: <a06002000bb9f89e0c7cd@[64.171.188.159].0.0>
Content-Type: multipart/appledouble; boundary="============_-1147171420==_D============"

--============_-1147171420==_D============
Content-Transfer-Encoding: base64
Content-Type: application/applefile; name="%getallversions"
Content-Disposition: attachment; filename="%getallversions"
 ; modification-date="Tue, 30 Sep 2003 12:09:34 -0700"

AAUWBwACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAPgAAAA4AAAAJAAAATAAAACAA
AAAIAAAAbAAAABBnZXRhbGx2ZXJzaW9ucwAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAABwhw5gcMLv5LbQwABww3NQ==
--============_-1147171420==_D============
Content-Type: application/octet-stream; name="getallversions"
Content-Disposition: attachment; filename="getallversions"
Content-Transfer-Encoding: base64

IyEvVm9sdW1lcy9OZXRCU0QvcGtnL2Jpbi9wZXJsIC13CgojIEdldCBpbnN0YWxsZWQg
cGFja2FnZSBpbmZvcm1hdGlvbgoKd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