New features in APT-RPM
Posted Dec 2, 2003 1:28 UTC (Tue) by
niemeyer (guest, #17169)
In reply to:
New features in APT-RPM by proski
Parent article:
New features in APT-RPM
Looks interesting. Here is a Lua script that will do the same thing in APT-RPM:
for i, pkg in pairs(pkglist()) do
ver = pkgvercur(pkg)
verlist = pkgverlist(pkg)
if ver and not verisonline(ver)
and table.getn(verlist) == 1 then
print(pkgname(pkg) .. "-" .. verstr(ver))
end
end
To run it, execute the following command:
apt-cache script ./list-extras.lua
If you want more comfort you may easily turn this into an additonal apt-cache command, and run it like:
apt-cache list-extras
To do that, insert the following lines at the top of the Lua file:
if command_args[1] ~= "list-extras" then
return
end
command_consume = 1
And register it in your configuration with:
Scripts::AptCache::Command:: "/path/to/list-extras.lua";
Notice that, unfortunately, this will only work with the upcoming APT-RPM 0.5.15cnc4, since the verisonline() function was implemented a few seconds ago. :-) The functionality was already there, but wasn't being exported to Lua. If you want it working now, you can check the revision 243 in the repository.
(
Log in to post comments)