Re: Flavor Package List Files and Package Versions

[ Thread Index | Date Index | More lists.tuxfamily.org/slitaz Archives ]


Greetings,
 
Harald's code snippet inspired me to make the attached tazlito modification that alters the handling of a flavor's "Distribution Packages" list.
 * Current version-specific functionality is preserved - if a specific package version is explicitly specified in the distro-packages.list file, tazlito will still attempt to use that version.
 * If a package is specified in the distro-packages.list file without a specific version, this tazlito patch will attempt to determine the current package version.  This search takes a few things into consideration, such as
    - The version string might contain hyphens
    - A package might have add-on packages (e.g. *-dev)
    - A package only has one current version listed by "tazpkg list-mirror"
 * If no version match is found for a package entry, the package name will pass through unmodified and be caught by the same mechanism that currently catches such errors.
 
Please find these modifications in the attached diff file.
 

Thank you,
Matthew

--------------------------------------------------
From: "Harald Klimach" <klimach@xxxxxxx>
Sent: Wednesday, March 11, 2009 5:27 AM
To: <slitaz@xxxxxxxxxxxxxxxxxxx>
Subject: Re: Flavor Package List Files and Package Versions

Hi,
> Keeping up with such version changes can be a maintenance difficulty, so I was wondering if there is a way to declare in the flavor list that the latest package version be retrieved.  I suppose one workaround might be to create meta packages, but I think that would be using them in a manner that was not intended....
what I did, is getting the packages list stripping the versions off, using sed. And then
getting the most recent versions of them, like this:
# Strip versions from package names:
sed -i "s/-[^-]*$//g" distro-packages.list

# Get current version of packages
tazpkg recharge
tazpkg list-mirror >.mirror-packages.list
for pac in $(cat distro-packages.list); do
   pacver=$(grep "^$pac-[^-]*$" .mirror-packages.list | tail -1)
   echo $pacver
   sed -i "s/^${pac}$/${pacver}/g" distro-packages.list
done
rm .mirror-packages.list

It's a little bit ugly, but working ;)

Best regards,
Harald

Attachment: tazlito-pkgVer.diff
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/