You are not logged in.
Pages: 1
Hi Guys,
This is just a small script to keep packages current.
"pacman -Sc" doesn't work coz it only takes care of <installed> packages.
Not sure if this is something anybody needs .. but either ways .. here it is :>)
Requirements are <<Ruby>> && U need to run this from the package directory.
See ya.
#!/usr/bin/ruby -w
##
# Program to keep Packages up to date
# Note: You have to Run this from the
# Directory where the packages are stored
##
# Control Array
arr = `ls`.split("\n")
sleep(2)
# Array where stuff is actually deleted
delarr = `ls`.split("\n")
sleep(2)
puts "Here goes nothing )>^ . . . . "
# Prepare "arr" for processing
arr.each do |e|
e.sub!(/-\d\..*$/, '')
end
sleep(1)
arr.each do |e|
e.sub!(/-\d.*$/, '')
end
##
# Logic for when to Delete a package
# If TWO Consecutive "arr" elements
# have the <same> name, Delete the
# first of the two elements
##
0.upto(arr.length - 1) do |i|
if arr[i] == arr[i+1]
system("rm -v #{delarr[i]}")
end
endOffline
man pacman.conf
CleanMethod = KeepInstalled | KeepCurrent
If set to KeepInstalled (the default), the -Sc operation will clean
packages that are no longer installed (not present in the local
database). If set to KeepCurrent, -Sc will clean outdated packages
(not present in any sync database). The second behavior is useful
when the package cache is shared among multiple machines, where the
local databases are usually different, but the sync databases in
use could be the same.
Are you replicating KeepCurrent?
Offline
hey Allan
Yes .. it would appear that this does <exactly> what "KeepCurrent" does ..
Thnx much for pointing that out :>)
Only reason I just may continue to use the above program is speed ..
Need to test "KeepCurrent" but, "KeepInstalled", seemed to take 5 - 10 secs longer that the above script.
Either way ...
Thnx again :>)
Hak
Offline
Pages: 1