Pachorizon - Sort your pacman mirrorlist by distance

I'm behind a stupid firewall, and can't use ping, so can't use tools like rankmirrors.  So I wrote a python script for sorting mirrors with nearest countries.
Usage:
Usage: pachorizon.py <country> <mirrorlist>
pachorizon.py list
pachorizon.py help
Example: pachorizon.py "Great Britain" /etc/pacman.d/mirrorlist
Example output:
$ ./pachorizon.py "Great Britain" /etc/pacman.d/mirrorlist
## Pacman mirrorlist generated for Great Britain
## Great Britain
# Server = http://mirror.lividpenguin.com/pub/archlinux/$repo/os/$arch
# Server = http://mirror.cinosure.com/archlinux/$repo/os/$arch
# Server = http://archlinux.mirrors.uk2.net/$repo/os/$arch
## Ireland
# Server = http://ftp.heanet.ie/mirrors/ftp.archlinux.org/$repo/os/$arch
## Netherlands
# Server = http://mirror.nl.leaseweb.net/archlinux/$repo/os/$arch
# Server = http://ftp.nluug.nl/pub/os/Linux/distr/archlinux/$repo/os/$arch
## Belgium
# Server = http://archlinux.mirror.kangaroot.net/$repo/os/$arch
## Luxembourg
# Server = http://archlinux.mirror.root.lu/$repo/os/$arch
Script:
#!/usr/bin/env python3
import sys
import math
import functools
import collections
coords= {'Australia': (-27.0, 133.0),
'Belarus': (53.0, 28.0),
'Belgium': (50.5, 4.0),
'Brazil': (-10.0, -55.0),
'Canada': (60.0, -95.0),
'Chile': (-30.0, -71.0),
'China': (35.0, 105.0),
'Colombia': (4.0, -72.0),
'Czech Republic': (49.45, 15.3),
'Denmark': (56.0, 10.0),
'Estonia': (59.0, 26.0),
'Finland': (64.0, 26.0),
'France': (46.0, 2.0),
'Germany': (51.0, 9.0),
'Great Britain': (54.0, -2.0),
'Greece': (39.0, 22.0),
'Hungary': (47.0, 20.0),
'India': (20.0, 77.0),
'Indonesia': (-5.0, 120.0),
'Ireland': (53.0, -8.0),
'Israel': (31.3, 34.45),
'Italy': (42.5, 12.5),
'Japan': (36.0, 138.0),
'Kazakhstan': (48.0, 68.0),
'Korea': (40.0, 127.0),
'Latvia': (57.0, 25.0),
'Luxembourg': (49.45, 6.1),
'Moldova': (47.0, 29.0),
'Netherlands': (52.3, 5.45),
'New Caledonia': (-21.3, 165.3),
'Norway': (62.0, 10.0),
'Poland': (52.0, 20.0),
'Portugal': (39.3, -8.0),
'Romania': (46.0, 25.0),
'Russia': (60.0, 100.0),
'Singapore': (1.22, 103.48),
'South Korea': (40.0, 127.0),
'Spain': (40.0, -4.0),
'Sweden': (62.0, 15.0),
'Switzerland': (47.0, 8.0),
'Taiwan': (23.3, 121.0),
'Turkey': (39.0, 35.0),
'USA': (38.0, -97.0),
'Ukraine': (49.0, 32.0),
'United States': (38.0, -97.0),
'Uzbekistan': (41.0, 64.0)}
def distance_between_coords(coord1, coord2):
"""Recipe From:
http://www.johndcook.com/python_longitude_latitude.html"""
lat1, long1 = coord1
lat2, long2 = coord2
# Convert latitude and longitude to
# spherical coordinates in radians.
degrees_to_radians = math.pi/180.0
# phi = 90 - latitude
phi1 = (90.0 - lat1)*degrees_to_radians
phi2 = (90.0 - lat2)*degrees_to_radians
# theta = longitude
theta1 = long1*degrees_to_radians
theta2 = long2*degrees_to_radians
# Compute spherical distance from spherical coordinates.
# For two locations in spherical coordinates
# (1, theta, phi) and (1, theta, phi)
# cosine( arc length ) =
# sin phi sin phi' cos(theta-theta') + cos phi cos phi'
# distance = rho * arc length
cos = (math.sin(phi1)*math.sin(phi2)*math.cos(theta1 - theta2) +
math.cos(phi1)*math.cos(phi2))
arc = math.acos( cos )
return arc * 6373 #for kilometers
def distance_between_countries(c1, c2):
return distance_between_coords(coords[c1], coords[c2])
my_location = sys.argv[1]
if my_location == "help":
print("Usage: pachorizon.py <country> <mirrorlist>")
print(" pachorizon.py list")
print(" pachorizon.py help")
print("Example: pachorizon.py \"Great Britain\" /etc/pacman.d/mirrorlist")
exit()
elif my_location == "list":
print("Possible countries:" )
print(", ".join(c for c in coords.keys()))
exit()
mirrorlist = open(sys.argv[2]).readlines()
urls = [("Any", [])]
for line in mirrorlist:
line = line.strip("# \n")
if line in coords.keys():
urls.append((line, []))
elif line.startswith("Server ="):
urls[-1][-1].append(line.split("Server =", 1)[1].strip())
locationless, *urls = urls
get_distance = functools.partial(distance_between_countries, my_location)
sorted_urls = collections.OrderedDict(sorted(
urls,
key = lambda i: get_distance(i[0]),
sorted_urls["Any"] = locationless[1]
sorted_urls.move_to_end("Any", last=False)
print("## Pacman mirrorlist generated for " + my_location + "\n")
for country, servers in sorted_urls.items():
if not servers:
continue
print("## " + country)
for server in servers:
print("# Server = " + server)
print()
I hope you like it .

The wiki has https://wiki.archlinux.org/index.php/Mi … _Generator Maybe you can enhance that script?
If you're not sure if the outcome is correct, post it on the wiki talk page first.

Similar Messages

  • Pacman mirrorlist

    Hi,
    I've a problem with pacman, it failed retrieving file from any mirror... first I had ftp://archlinux.puzzle.ch but once it doesn't work anymore, so I tried other mirrors in the mirrorlist sorted with rankmirrors. But with any mirror I've tested I received "error:failed retrieving file ''from core..... error:failed retrieving any db" when I try pacman -Syu or any pacman -S ...
    What should I try to do?
    Thanks for your help,
    Sylvain
    p.s here are copy of my pacman.conf and pacman.d/mirrorlist files:
    # /etc/pacman.conf
    # See the pacman.conf(5) manpage for option and repository directives
    # GENERAL OPTIONS
    [options]
    # The following paths are commented out with their default values listed.
    # If you wish to use different paths, uncomment and update the paths.
    #RootDir     = /
    #DBPath      = /var/lib/pacman/
    #CacheDir    = /var/cache/pacman/pkg/
    #LogFile     = /var/log/pacman.log
    HoldPkg     = pacman glibc
    # If upgrades are available for these packages they will be asked for first
    SyncFirst   = pacman
    #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
    #XferCommand = /usr/bin/curl %u > %o
    #CleanMethod = KeepInstalled
    # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
    #IgnorePkg   =
    #IgnoreGroup =
    #NoUpgrade   =
    #NoExtract   =
    # Misc options (all disabled by default)
    #UseSyslog
    #ShowSize
    #UseDelta
    #TotalDownload
    # REPOSITORIES
    #   - can be defined here or included from another file
    #   - pacman will search repositories in the order defined here
    #   - local/custom mirrors can be added here or in separate files
    #   - repositories listed first will take precedence when packages
    #     have identical names, regardless of version number
    #   - URLs will have $repo replaced by the name of the current repo
    # Repository entries are of the format:
    #       [repo-name]
    #       Server = ServerName
    #       Include = IncludePath
    # The header [repo-name] is crucial - it must be present and
    # uncommented to enable the repo.
    # The testing repositories are disabled by default. To enable, uncomment the
    # repo name header and Include lines. You can add preferred servers immediately
    # after the header, and they will be used before the default mirrors.
    #[testing]
    ## Add your preferred servers here, they will be used first
    #Include = /etc/pacman.d/mirrorlist
    [core]
    # Add your preferred servers here, they will be used first
    #Server=ftp://mir1.archlinuxfr.org/archlinux
    Include = /etc/pacman.d/mirrorlist
    [extra]
    # Add your preferred servers here, they will be used first
    #Server=ftp://ftp.hosterope.de/mirror/ftp.archlinux.org/core/os/i686
    Include = /etc/pacman.d/mirrorlist
    #[community-testing]
    ## Add your preferred servers here, they will be used first
    #Include = /etc/pacman.d/mirrorlist
    [community]
    # Add your preferred servers here, they will be used first
    #Server=ftp://ftp.hosterope.de/mirror/ftp.archlinux.org/core/os/i686
    Include = /etc/pacman.d/mirrorlist
    # An example of a custom package repository.  See the pacman manpage for
    # tips on creating your own repositories.
    #[custom]
    #Server = file:///home/custompkgs
    # Server list generated by rankmirrors on 2009-10-27
    # Arch Linux repository mirrorlist
    # Generated on 2009-06-16
    # Australia
    #Server = ftp://mirror.aarnet.edu.au/pub/archlinu … os/@carch@
    #Server = http://mirror.aarnet.edu.au/pub/archlin … os/@carch@
    #Server = ftp://ftp.iinet.net.au/pub/archlinux/$repo/os/@carch@
    #Server = http://ftp.iinet.net.au/pub/archlinux/$repo/os/@carch@
    #Server = ftp://mirror.internode.on.net/pub/archl … os/@carch@
    #Server = http://mirror.internode.on.net/pub/arch … os/@carch@
    #Server = ftp://mirror.pacific.net.au/linux/archl … os/@carch@
    #Server = http://mirror.pacific.net.au/linux/arch … os/@carch@
    # Austria
    #Server = ftp://gd.tuwien.ac.at/opsys/linux/archl … os/@carch@
    #Server = http://gd.tuwien.ac.at/opsys/linux/arch … os/@carch@
    # Belgium
    #Server = ftp://ftp.belnet.be/packages/archlinux/$repo/os/@carch@
    #Server = http://ftp.belnet.be/mirror/archlinux.o … os/@carch@
    # Brazil
    #Server = ftp://archlinux.c3sl.ufpr.br/archlinux/$repo/os/@carch@
    #Server = http://archlinux.c3sl.ufpr.br/$repo/os/@carch@
    #Server = ftp://ftp.las.ic.unicamp.br/pub/archlin … os/@carch@
    #Server = http://www.las.ic.unicamp.br/pub/archli … os/@carch@
    #Server = http://pet.inf.ufsc.br/mirrors/archlinu … os/@carch@
    # Bulgaria
    #Server = http://archlinux.igor.onlinedirect.bg/$repo/os/@carch@
    # Canada
    #Server = ftp://mirror.csclub.uwaterloo.ca/archli … os/@carch@
    #Server = http://mirror.csclub.uwaterloo.ca/archl … os/@carch@
    #Server = ftp://mirrors.portafixe.com/archlinux/$repo/os/@carch@
    #Server = http://mirrors.portafixe.com/archlinux/$repo/os/@carch@
    # Chile
    #Server = ftp://mirror.archlinux.cl/$repo/os/@carch@
    # Czech Republic
    #Server = ftp://ftp.sh.cvut.cz/MIRRORS/arch/$repo/os/@carch@
    #Server = http://ftp.sh.cvut.cz/MIRRORS/arch/$repo/os/@carch@
    # Denmark
    #Server = ftp://ftp.klid.dk/archlinux/$repo/os/@carch@
    # Estonia
    #Server = ftp://ftp.estpak.ee/pub/archlinux/$repo/os/@carch@
    #Server = http://ftp.estpak.ee/pub/archlinux/$repo/os/@carch@
    # Finland
    #Server = ftp://mirror.archlinux.fi/$repo/os/@carch@
    #Server = http://mirror.archlinux.fi/$repo/os/@carch@
    # France
    # Germany
    # Great Britain
    #Server = ftp://mirror.lividpenguin.com/pub/archl … os/@carch@
    #Server = http://mirror.lividpenguin.com/pub/arch … os/@carch@
    #Server = http://www.mirrorservice.org/sites/ftp. … os/@carch@
    #Server = ftp://mirrors.uk2.net/pub/archlinux/$repo/os/@carch@
    #Server = http://archlinux.mirrors.uk2.net/$repo/os/@carch@
    # Greece
    #Server = ftp://ftp.ntua.gr/pub/linux/archlinux/$repo/os/@carch@
    #Server = http://ftp.ntua.gr/pub/linux/archlinux/$repo/os/@carch@
    #Server = ftp://ftp.otenet.gr/pub/linux/archlinux … os/@carch@
    #Server = http://ftp.otenet.gr/linux/archlinux/$repo/os/@carch@
    # Hungary
    #Server = ftp://ftp.mfa.kfki.hu/pub/mirrors/ftp.a … os/@carch@
    # Indonesia
    #Server = ftp://archlinux.cbn.net.id/pub/archlinu … os/@carch@
    #Server = http://archlinux.cbn.net.id/$repo/os/@carch@
    #Server = ftp://mirror.unej.ac.id/archlinux/$repo/os/@carch@
    #Server = http://mirror.unej.ac.id/archlinux/$repo/os/@carch@
    # Ireland
    #Server = ftp://ftp.heanet.ie/mirrors/ftp.archlin … os/@carch@
    #Server = http://ftp.heanet.ie/mirrors/ftp.archli … os/@carch@
    # Israel
    #Server = http://mirror.isoc.org.il/pub/archlinux … os/@carch@
    # Italy
    #Server = ftp://mi.mirror.garr.it/mirrors/archlin … os/@carch@
    #Server = http://mi.mirror.garr.it/mirrors/archli … os/@carch@
    # Japan
    #Server = ftp://ftp.yz.yamagata-u.ac.jp/pub/linux … os/@carch@
    #Server = http://ftp.yz.yamagata-u.ac.jp/pub/linu … os/@carch@
    # Latvia
    #Server = http://archlinux.goodsoft.lv/$repo/os/@carch@
    # Lithuania
    #Server = ftp://atviras.lt/archmirror/$repo/os/@carch@
    #Server = http://atviras.lt/archmirror/$repo/os/@carch@
    # Netherlands
    #Server = ftp://mirror.leaseweb.com/archlinux/$repo/os/@carch@
    #Server = http://mirror.leaseweb.com/archlinux/$repo/os/@carch@
    #Server = ftp://ftp.nluug.nl/pub/metalab/distribu … os/@carch@
    #Server = http://ftp.nluug.nl/pub/metalab/distrib … os/@carch@
    #Server = ftp://ftp.surfnet.nl/pub/os/Linux/distr … os/@carch@
    #Server = http://ftp.surfnet.nl/pub/os/Linux/dist … os/@carch@
    # New Caledonia
    #Server = ftp://archlinux.nautile.nc/archlinux/$repo/os/@carch@
    #Server = http://archlinux.nautile.nc/archlinux/$repo/os/@carch@
    # Norway
    #Server = ftp://mirror.archlinux.no/$repo/os/@carch@
    #Server = http://mirror.archlinux.no/$repo/os/@carch@
    # Poland
    #Server = ftp://mirror.icis.pcz.pl/archlinux/$repo/os/@carch@
    #Server = ftp://ftp.piotrkosoft.net/pub/mirrors/f … os/@carch@
    #Server = http://piotrkosoft.net/pub/mirrors/ftp. … os/@carch@
    #Server = ftp://ftp.pwsz.elblag.pl/pub/linux/dist … os/@carch@
    #Server = http://ftp.pwsz.elblag.pl/pub/linux/dis … os/@carch@
    #Server = http://unix.net.pl/archlinux.org/$repo/os/@carch@
    # Portugal
    #Server = ftp://cesium.di.uminho.pt/pub/archlinux … os/@carch@
    #Server = http://cesium.di.uminho.pt/pub/archlinu … os/@carch@
    #Server = http://darkstar.ist.utl.pt/archlinux/$repo/os/@carch@
    #Server = ftp://ftp.nux.ipb.pt/pub/dists/archlinu … os/@carch@
    #Server = http://ftp.nux.ipb.pt/pub/dists/archlin … os/@carch@
    # Romania
    #Server = ftp://ftp.iasi.roedu.net/mirrors/archli … os/@carch@
    #Server = http://ftp.iasi.roedu.net/mirrors/archl … os/@carch@
    # Russia
    #Server = http://archlinux.freeside.ru/$repo/os/@carch@
    #Server = ftp://mirror.svk.su/archlinux/$repo/os/@carch@
    #Server = http://mirror.svk.su/archlinux/$repo/os/@carch@
    #Server = ftp://mirror.yandex.ru/archlinux/$repo/os/@carch@
    #Server = http://mirror.yandex.ru/archlinux/$repo/os/@carch@
    # Sweden
    #Server = ftp://ftp.ds.hj.se/pub/os/linux/archlin … os/@carch@
    #Server = http://ftp.ds.hj.se/pub/os/linux/archli … os/@carch@
    #Server = ftp://ftp.gigabit.nu/$repo/os/@carch@
    #Server = http://ftp.gigabit.nu/$repo/os/@carch@
    # Switzerland
    # Turkey
    #Server = ftp://ftp.linux.org.tr/archlinux/$repo/os/@carch@
    # Ukraine
    #Server = ftp://archlinux.hell.org.ua/archlinux/$repo/os/@carch@
    #Server = http://archlinux.hell.org.ua/archlinux/$repo/os/@carch@
    #Server = ftp://ftp.linux.kiev.ua/pub/Linux/ArchL … os/@carch@
    #Server = http://ftp.linux.kiev.ua/pub/Linux/Arch … os/@carch@
    # United States
    #Server = http://mirror.archlinux.com.ve/$repo/os/@carch@
    #Server = http://archlinux.unixheads.org/$repo/os/@carch@
    #Server = ftp://mirror.cs.vt.edu/pub/ArchLinux/$repo/os/@carch@
    #Server = http://mirror.cs.vt.edu/pub/ArchLinux/$repo/os/@carch@
    #Server = ftp://mirrors.easynews.com/linux/archli … os/@carch@
    #Server = http://mirrors.easynews.com/linux/archl … os/@carch@
    #Server = ftp://ftp.archlinux.org/$repo/os/@carch@
    #Server = http://mirrors.gigenet.com/archlinux/$repo/os/@carch@
    #Server = ftp://ftp.gtlib.gatech.edu/pub/linux/di … os/@carch@
    #Server = http://www.gtlib.gatech.edu/pub/linux/d … os/@carch@
    #Server = ftp://mirrors.hosef.org/archlinux/$repo/os/@carch@
    #Server = http://mirrors.hosef.org/archlinux/$repo/os/@carch@
    #Server = ftp://ibiblio.org/pub/linux/distributio … os/@carch@
    #Server = http://distro.ibiblio.org/pub/linux/dis … os/@carch@
    #Server = ftp://locke.suu.edu/linux/dist/archlinu … os/@carch@
    #Server = ftp://mirror.rit.edu/archlinux/$repo/os/@carch@
    #Server = http://mirror.rit.edu/archlinux/$repo/os/@carch@
    #Server = http://schlunix.org/archlinux/$repo/os/@carch@
    #Server = http://mirror.sourceshare.org/archlinux … os/@carch@
    #Server = http://archlinux.umflint.edu/$repo/os/@carch@
    #Server = http://mirror.umoss.org/archlinux/$repo/os/@carch@
    # Venezuela
    #Server = http://mirror2.archlinux.com.ve/$repo/os/@carch@
    # Vietnam
    #Server = ftp://202.78.230.5/archlinux/$repo/os/@carch@
    #Server = ftp://ftp.indochinalinux.com/archlinux/$repo/os/@carch@
    #Server = ftp://mirror-fpt-telecom.fpt.net/archli … os/@carch@
    #Server = http://mirror-fpt-telecom.fpt.net/archl … os/@carch@
    Server = ftp://ftp-stud.hs-esslingen.de/pub/Mirr … os/@carch@
    Server = ftp://ftp5.gwdg.de/pub/linux/archlinux/$repo/os/@carch@
    Server = http://mir1.archlinuxfr.org/archlinux/$repo/os/@carch@
    Server = ftp://ftp.tu-chemnitz.de/pub/linux/arch … os/@carch@
    Server = ftp://mir1.archlinuxfr.org/archlinux/$repo/os/@carch@
    Last edited by alphamunin (2009-10-27 16:33:24)

    Did you do
    pacman -Syy
    after you changed mirrors? As explained in the Beginner's Guide, this is necessary after changing mirrors in order for pacman to synch all databases.
    Additionally, your mirrorlist looks strange. My mirrors look as follows:
    Server = ftp://ftp.wh-stuttgart.net/archlinux/$repo/os/i686
    Server = ftp://mirror.leaseweb.com/archlinux/$repo/os/i686
    Server = ftp://ftp-stud.hs-esslingen.de/pub/Mirr … po/os/i686
    Server = ftp://ftp.surfnet.nl/pub/os/Linux/distr … po/os/i686
    Server = ftp://ftp.nluug.nl/pub/metalab/distribu … po/os/i686
    Server = ftp://ftp5.gwdg.de/pub/linux/archlinux/$repo/os/i686
    Server = ftp://ftp.belnet.be/packages/archlinux/$repo/os/i686
    Server = ftp://ibiblio.org/pub/linux/distributio … po/os/i686
    Server = ftp://ftp.archlinux.org/$repo/os/i686
    The difference is, that you don't have the architecture in your paths (i686).

  • (SOLVED) Pacman mirrorlist & DB Sync issue.

    Hi, I messed with HDD through BSD and my HDD was wiped clean!(grr) anyways I reinstalled Arch with 2009.08 iso image. I've setup connections and enabled repos and updated mirrorlist. I can ping google and browse it through links. System behaves normally. But when I try to install/search ANY package, it says not found in SyncDB.
    I've double checked the package names and also tried pacman -Syy, but still no joy
    It says core,extra & community are up to date, but stilll wont find kde, apache, alsa-utils etc.. I have not modified pacman.conf in any way. Help!
    Last edited by kapz (2009-12-16 20:58:55)

    Most likely, your mirror is out of synch. Look into your mirrorlist and determine the first enabled mirror from top of the file, then check against
    https://users.archlinux.de/~gerbra/mirrorcheck.html
    Pacman will pick the first mirror out of your list as long as it is reachable and if the mirror is out of synch, you won't get any updates.

  • Graph your pacman activity!

    Today I wanted to create a simple script that would graph my pacman activity, and I thought I might as well share it with community. Below you can find a python script that serves that purpose. You will need python2-matplotlib to use it. And here what my version of the graph looks like:
    Copyright (C) 2011 Yaşar Arabacı
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.
    import re
    import datetime
    import time
    import matplotlib.pyplot as plt
    import matplotlib.dates as mdates
    from collections import Counter
    months = mdates.MonthLocator() # every month
    days = mdates.DayLocator() # Every day
    monthsFmt = mdates.DateFormatter('%m-%Y')
    logfile = "/var/log/pacman.log"
    interesting_line = re.compile(
    r"\[(?P<datetime>\d{4}-\d{2}-\d{2} \d{2}:\d{2})\] "
    "(?P<action>installed|upgraded|removed)")
    installs = Counter()
    upgrades = Counter()
    removes = Counter()
    with open(logfile) as logfile:
    for line in logfile:
    match = interesting_line.search(line)
    if match:
    struct = time.strptime(match.group("datetime"),"%Y-%m-%d %H:%S")
    date = datetime.date(struct.tm_year, struct.tm_mon, struct.tm_mday)
    if match.group("action") == "installed":
    installs[date] += 1
    elif match.group("action") == "upgraded":
    upgrades[date] += 1
    elif match.group("action") == "removed":
    removes[date] += 1
    fig = plt.figure()
    ax = fig.add_subplot(111)
    insdatenumpairs = zip(installs.keys(), installs.values())
    insdatenumpairs = sorted(insdatenumpairs, key = lambda pair: pair[0])
    upgdatenumpairs = zip(upgrades.keys(), upgrades.values())
    upgdatenumpairs = sorted(upgdatenumpairs, key = lambda pair: pair[0])
    remdatenumpairs = zip(removes.keys(), removes.values())
    remdatenumpairs = sorted(remdatenumpairs, key = lambda pair: pair[0])
    ax.plot([pair[0] for pair in insdatenumpairs],[pair[1] for pair in insdatenumpairs],"b")
    ax.plot([pair[0] for pair in upgdatenumpairs],[pair[1] for pair in upgdatenumpairs],"g")
    ax.plot([pair[0] for pair in remdatenumpairs],[pair[1] for pair in remdatenumpairs],"y")
    ax.xaxis.set_major_locator(months)
    ax.xaxis.set_major_formatter(monthsFmt)
    ax.xaxis.set_minor_locator(days)
    ax.format_xdata = mdates.DateFormatter('%Y-%m-%d')
    ax.grid(True)
    fig.autofmt_xdate()
    plt.legend(("installs","upgrades","removes"))
    plt.xlabel("Date")
    plt.ylabel("# of packages")
    plt.show()
    Last edited by yasar11732 (2012-01-08 11:58:35)

    Here is a little bit different version, only showing total number of packages over time.
    Copyright (C) 2011 Yaşar Arabacı
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.
    import re
    import datetime
    import time
    import matplotlib.pyplot as plt
    import matplotlib.dates as mdates
    from collections import Counter
    months = mdates.MonthLocator() # every month
    days = mdates.DayLocator() # Every day
    monthsFmt = mdates.DateFormatter('%m-%Y')
    logfile = "/var/log/pacman.log"
    interesting_line = re.compile(
    r"\[(?P<datetime>\d{4}-\d{2}-\d{2} \d{2}:\d{2})\] "
    "(?P<action>installed|removed)")
    total = 0
    packs = Counter()
    with open(logfile) as logfile:
    for line in logfile:
    match = interesting_line.search(line)
    if match:
    struct = time.strptime(match.group("datetime"),"%Y-%m-%d %H:%S")
    date = datetime.date(struct.tm_year, struct.tm_mon, struct.tm_mday)
    if match.group("action") == "installed":
    total += 1
    elif match.group("action") == "removed":
    total -= 1
    packs[date] = total
    fig = plt.figure()
    ax = fig.add_subplot(111)
    datenumpairs = zip(packs.keys(), packs.values())
    datenumpairs = sorted(datenumpairs, key = lambda pair: pair[0])
    ax.plot([pair[0] for pair in datenumpairs],[pair[1] for pair in datenumpairs])
    ax.xaxis.set_major_locator(months)
    ax.xaxis.set_major_formatter(monthsFmt)
    ax.xaxis.set_minor_locator(days)
    ax.format_xdata = mdates.DateFormatter('%Y-%m-%d')
    ax.grid(True)
    fig.autofmt_xdate()
    plt.xlabel("Date")
    plt.ylabel("# of packages")
    plt.show()
    Last edited by yasar11732 (2012-01-08 11:59:09)

  • [UNSOLVABLE] pacman-mirrorlist issues

    I am installing Arch on a different box, using the same disk that I used to install this one. When I got to pacman and the mirrorlist, I found that there was no mirrorlist, and pacman.conf was incomplete :? I have copied all of the pertinent information from the /etc/pacman.conf from my present box to the new one, and I have created an /etc/pacman.d/mirrorlist by copying all of the information in my present mirrorlist (on this box).
    When I try to synchronize the databases,  I get
    pacman -Syy
    :: Sychronizing package dabases ...
    error: failed retrieving file "core.db.tar.gz' from archlinux.umflint.edu : Not Found
    error: failed to sychronize core: Not Found
    I get the same exact messages for extra and community. I have tried this with gatech, ibiblio, and several other repos, and it's all the same.I get the exact same messages with "pacman -Syu"
    error: failed to synchronize any databases
    I have tried this:
    rm /usr/lib/klibc/include/asm
    from this thread, because I saw a reference to that on Hardcore Linux website when I googled this error, http://bbs.archlinux.org/viewtopic.php?id=56431 and it made no difference at all.
    And this (from an Arch Bug Report)
    pacman --root /mnt --config /tmp/pacman.conf -Sy # update the target system
    pacman -Sy # update the live system
    http://bugs.archlinux.org/task/13060 but bash doesn't recognize the option '--root/mnt'
    I have searched the Arch wiki, and the Arch forums, and I have not found a similar problem of having to manually build a pacman.conf and a mirrorlist. I don't intend to just give up and re-install, there must be a better way . If some brainiac can figure out what else I haven't thought of, I'll try that next .
    I'm still looking and googling, by the way, I figure if I can invest the past two days in this, I can invest a few more.
    Last edited by jackrat (2009-02-15 09:12:11)

    toofishes wrote:wget ftp://ftp.archlinux.org/core/os/i686/pa … pkg.tar.gz
    Been there, done that, didn't help,  I copied and pasted that exact one ...... Thanks .... I'm reinstalling to see if my cd is bad, if it is, I'll have to burn a new one. Thanks for your reply

  • How do you sort your Photostream Events in iPhoto?

    I have my photostream photos automatically imported to  iPhoto on my iMac - so I have lots of "events" with names like March 2013 photostream or July 2014 photostream. In each of these events, there are often a whole group of photos that belong together - like a birthday party. There are also some "one off" photos that just one or two shots of something I wanted to photograph (like a couple of pictures of a rainbow, or a picture of a recipe that I like to have on hand so that I can shop for ingredients). I am not sure how these are supposed to be handled. I can leave them all in photostream and add key words to the photos so that I can search for them perhaps (but then I have to manage a lot of key words. I cannot just add a key word "Birthday Party" since I attend many birthday parties. I would have to use a key work like "Bob's 30th birthday party" unless I wasted my search to turn up every picture ever taken at any birthday party!) i can create an event and call it "Bob's 30th birthday party. That seems to work ok - although I'm not sure if I should be doing this. As for the other photos, like the two of the rainbow and the one of the recipe, I don't know what to do with them. I can leave them in photostream with keywords. I can create an entire event called "Recipes" although the range of dates on such a folder might be quite wide since I am always saving recipes, which  means that when my events are sorted by date, my new recipes will appear in an early event along with the very first recipe I ever took a photo of!
    I would love to know how others arrange their events . Do you ever create an event based upon a subject (My Cat Missy) even if the photos span a good deal of time? Or do you leave Missy's photos spread over many events depending upon what date you snapped the photo??? Have you ever completely emptied out a monthly photostream event (for example, let's say all your photostream photos for the month were taken at one wedding, so you moved them all into a single event called "Kate's Wedding."
    See what I mean? Back in the windows days, when admittedly, I took fewer photos, I would create a folder for each big photo taking event (christmas, weddings, birthdays, a lovely walk in the park) and I would create just one folder with the year "Photos from 2008" to put in all the ones and twos photos that don't really belong with anything else. I also had a single folder with pictures of my cats and one that had photos of recipes. I added to these photos anytime I had a picture of my cat or a recipe to upload.
    What does everyone recommend? Sorry for being so long winded. I cannot find any info on "how to sort or manage monthly photostream event photos" so perhaps I am the only one with this issue.

    1. There is no right answer. There is no "should". There is the way that makes sense to you.
    2. You can keyword photos with Birthday party, but also Title them with Bob's 30th, that gives you two ways to search for them
    This might give you some ideas:
    I use Events simply as big buckets of Photos: Spring 08, July - Nov 06 are typical Events in my Library. I use keywords and Smart Albums extensively. I title the pics broadly.
    I keyword on a
    Who
    What
    Where basis (The When is in the photos's Exif metadata). I also rate the pics on a 1 - 5 star basis.
    Using this system I can find pretty much find any pic in my 50k library in a couple of seconds.
    So, for example, I have a batch of pics titled 'Seattle 08' and a  typical keywording might include: John, Anne, Landscape, mountain, trees, snow. With a rating included it's so very easy to find the best pics we took at Mount Rainier.
    File -> New Smart Album
    set it to 'All"
    title contains Seattle
    keyword is mountain
    keyword is snow
    rating is 5 stars
    Or, want a chronological album of John from birth to today?
    New Smart Album
    Keyword is John
    Set the View options to Sort By Date Ascending
    Want only the best pics?
    add Rating is greater than 4 stars
    The best thing about this system is that it's dynamic. If I add 50 more pics of John  to the Library tomorrow, as I keyword and rate them they are added to the Smart Album.
    In the end, organisation is about finding the pics. The point is to make locating that pic or batch of pics findable fast. This system works for me.

  • [solved] pacman mirrorlist "directive 'x' not recognized"

    I'm bungling through an install and tried using reflector to get speedier mirrors. Somehow I hosed myself, as when I checked mirrorlist it was blank(!), so I recopied the back-up to /etc/pacman.d/mirrorlist. Now when I run pacman -Syy I get:
    error: config file /etc/pacman.d/mirrolist, line 1: directive 'x' in repository section 'core' not recognized.
    The a line saying the same holds true for extra and community. Then it tries to sync servers and says: failed to update core (no servers configured for repository), and again for extra and community.  I tried to get openssh so I could go in remotely and copy the screen, but "no servers configured for repository." 
    Can anyone get me out of this can of worms?
    Last edited by pottzie (2011-06-17 23:58:40)

    x#Mirror used during installation
    Server = http:/mirror.cs.vt.edu/pub/ArchLinux/$repo/os/i686
    (Which now that i look at I recognize as the server i chose for the installation!)
    Then, just the rest of the standard mirror list, and i uncommented the U.S. mirrors.

  • Why is it impossible to sort your images then post to web gallery - sorted?

    I have been messing with Aperature for days and am really dis-enchanted. I have gone through and organized over 700 images in separate categories only to find #1 - when I try to upload the images in a Web Gallery or Web Journal the images cannot be uploaded from a Stack. #2 - if I unstack them first they all go back to the order of when they are uploaded. Also when using the sorting button - it is supposed to put them in order first to last or last to first...depending on which way the button is selected - This does NOT work everytime. Sometimes when you click on the button it does nothing to the order of a group.
    THIS IS RIDICULOUS. There must be a way to organize your images in stacks and then upload in that same order - hello apple - are you listening?

    hi.
    "this is rediculous" — not quite. the problem may be your understanding of stacks. they're not groups. they're compilations of similar/near-identical photos, usually shot in rapid fire. the idea is that when you shoot several near-identical photos, you can easily 'group' them, sort them in terms of quality and then choose the best one (the 'Stack Pick') to represent the stack wherever it might be used.
    for example, when I'm photographing a bird, I don't normally get a second chance to photograph the same bird in the same situation or pose. the depth of field is extremely short and focus can be difficult. camera shake may also affect my images. therefore, I typically take 8 or more photos of the same bird in the same place in less than 10 to 15 seconds (if the bird is kind enough to stay that long; they normally stick in one place for only 1 or 2 seconds). I will typically only need one of these, so I stack the images and choose the best one; i.e., the stack's Pick. I will rarely if ever have to look at the other photos in the stack again.
    if you want to group images from an association point of view, don't use stacks. use albums. albums created within a project will allow you to do exactly what you hope to do. sorting and uploading multiple images from the same group will work. you can even sort manually.
    "Also when using the sorting button - it is supposed to put them in order first to last or last to first...depending on which way the button is selected - This does NOT work everytime"
    if you're using stacks, the Pick of the stack is used to represent the stack and is therefore used to sort the images in your collection; ie, the position of the whole stack in your collection of images is determined by the Pick of the stack.

  • Bt used to be a great company that sorted your pro...

     now they give you forums so you can sort the problems out amongst yourself
    look at all the problems on these pages ,ive posted got a couple of answers  no good to me ,ive give up on my problem ,ive sent them e mail ,they replied to my first one after 3 days ,not bothered to reply to my second one
    your a disgrace  

    i sent bt an e mail to which they replied 4 days later telling me exactly the same as the answer to the error messages  that i received  when i could not  get the silverlight app to work .i had problems loadind the silverlight ,i loaded it with chrome then unloaded it and tried it with firefox still no joy i tried what i was told to do by the moderator on the forum on another post,which b t  took down ,i used no swearing or abusive language ,
    i then e mailed them and they never even bothered replying to me ,then 2 weeks later out of the blue ,an asian b t  call center phoned me up and said it must be my computer to get in touch with the manuafacture 
    i had given up and was not giving b t sport or b t any more of my time as their making me ill
    then that phone call came and said it must be my computer ,off someone in india, this is the service you get off b t these days from a leading world company to a 2nd and 3rd rate company with 3rd rate service 
    they cant reply because of all the problems theve got with this new b t sport and when they do decide to bother to get in touch with you their no use  or no orniment ,
    weve been a loyal customer for about 40 years and this is how they trat you 

  • How do you sort your photos on your ipod?

    i am using a black 5g 60gig ipod with itunes. i have itunes set up to sync to my photos folder. when itunes syncs however, there is no order to photos that are loaded onto my ipod. for example, within my photos folder, i have several sub-folders based on events. i've also used attribute magic free edition to change all the creation dates on my photos to the days they were taken.
    now, when i load all these photos onto my ipod, the folder names are not sorted alphabetical by folder name, or chronological by picture creation date. my ipod photos folder looks something like this:
    gannos park trip (07.08.03)
    russ's house party (08.01.03)
    allie's party (06.04.05)
    dave matthews show (06.20.01)
    rick's last day (06.19.03)
    short's going away party (06.22.02)
    mary's cottage party (06.24.05)
    now, every picture inside those folder has a creation date which matches the date of the folder. as you can see the folders are not in alphabetical order, or chronological order. is there any way to sort this into some sort of order, or am i kind of forced into this?

    Although photos/videos in the Camera Roll are included with the iPod's backup, photos/videos in the Camera Roll can and should be imported by your computer as with any other digital camera.
    The backup for your iPad is updated by iTunes as the first step during the iTunes sync process. You should be prompted to update the backup as the first step after selecting Restore.
    Restoring your iPod with iTunes is the only way to remove the Passcode lock. The Passcode lock is not included with the backup so you can restore from the backup and hopefully recover the photos. If there is a problem with the backup in regards to this data, it may be lost which is why you should import these photos with your computer ASAP as with any other digital camera.

  • Message for Apple - sort your act out !

    just got the new 3g iphone. dissapointed
    sort out the bluetooth or this will be the first and last apple product i buy.
    wha kinda of company manufactures a brand new phone in 2008 with no fully functioning bluetooth ????
    me thinks i should have stuck with a nokia !

    mr annoyed... are their any specific "fully functional bluetooth" issues you're having or features missing?
    Apple has an iPhone feedback for your request. They don't read nor take complaints here.
    If you're thinking about stereo bluetooth and filesharing via bluetooth, it's been widely known for over a year now that the iPhone software cannot do that. A future software update may or may not change that.
    If your major concern is the bluetooth issue, you're probably off with another cell phone.

  • [solved] Pacman Mirrorlist Generator misbehaving?

    I picked Germany from http://www.archlinux.org/mirrorlist/ and got some leaseweb.net mirrors from US and the Netherlands too.
    ## Arch Linux repository mirrorlist
    ## Generated on 2011-11-01
    ## Germany
    #Server = http://archlinux.limun.org/$repo/os/$arch
    #Server = ftp://artfiles.org/archlinux.org/$repo/os/$arch
    #Server = http://artfiles.org/archlinux.org/$repo/os/$arch
    #Server = http://mirror.devnu11.net/archlinux/$repo/os/$arch
    #Server = ftp://ftp5.gwdg.de/pub/linux/archlinux/$repo/os/$arch
    #Server = http://ftp5.gwdg.de/pub/linux/archlinux/$repo/os/$arch
    #Server = ftp://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch
    #Server = http://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch
    #Server = ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/$repo/os/$arch
    #Server = http://ftp.hosteurope.de/mirror/ftp.archlinux.org/$repo/os/$arch
    #Server = ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/$repo/os/$arch
    #Server = http://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/$repo/os/$arch
    #Server = ftp://mirror.de.leaseweb.net/archlinux/$repo/os/$arch
    #Server = http://mirror.de.leaseweb.net/archlinux/$repo/os/$arch
    #Server = ftp://mirrors.n-ix.net/archlinux/$repo/os/$arch
    #Server = http://mirrors.n-ix.net/archlinux/$repo/os/$arch
    #Server = ftp://mirror.selfnet.de/archlinux/$repo/os/$arch
    #Server = http://mirror.selfnet.de/archlinux/$repo/os/$arch
    #Server = ftp://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/$repo/os/$arch
    #Server = http://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/$repo/os/$arch
    #Server = ftp://ftp.tu-chemnitz.de/pub/linux/archlinux/$repo/os/$arch
    #Server = http://ftp.tu-chemnitz.de/pub/linux/archlinux/$repo/os/$arch
    #Server = ftp://arch.mirrors.tuxdroid.org/$repo/os/$arch
    #Server = http://arch.mirrors.tuxdroid.org/$repo/os/$arch
    #Server = ftp://ftp.uni-kl.de/pub/linux/archlinux/$repo/os/$arch
    #Server = http://ftp.uni-kl.de/pub/linux/archlinux/$repo/os/$arch
    ## Netherlands
    #Server = ftp://mirror.nl.leaseweb.net/archlinux/$repo/os/$arch
    #Server = http://mirror.nl.leaseweb.net/archlinux/$repo/os/$arch
    ## United States
    #Server = ftp://mirror.us.leaseweb.net/archlinux/$repo/os/$arch
    #Server = http://mirror.us.leaseweb.net/archlinux/$repo/os/$arch
    Why?
    Picking other countries works as expected but I haven't tested them all.
    Last edited by karol (2011-11-03 21:47:21)

    bernarcher wrote:Checking the "Use mirror status" did produce Germany only mirrors, however.
    Nope
    ## Arch Linux repository mirrorlist
    ## Sorted by mirror score from mirror status page
    ## Generated on 2011-11-01
    ## Score: 1.1, Germany
    #Server = http://ftp5.gwdg.de/pub/linux/archlinux/$repo/os/$arch
    ## Score: 1.2, Germany
    #Server = http://archlinux.limun.org/$repo/os/$arch
    ## Score: 1.2, Germany
    #Server = http://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/$repo/os/$arch
    ## Score: 1.4, Germany
    #Server = http://mirror.devnu11.net/archlinux/$repo/os/$arch
    ## Score: 1.5, Germany
    #Server = http://arch.mirrors.tuxdroid.org/$repo/os/$arch
    ## Score: 1.7, Germany
    #Server = http://mirror.selfnet.de/archlinux/$repo/os/$arch
    ## Score: 2.1, Germany
    #Server = ftp://arch.mirrors.tuxdroid.org/$repo/os/$arch
    ## Score: 2.3, Germany
    #Server = http://mirrors.n-ix.net/archlinux/$repo/os/$arch
    ## Score: 2.4, Germany
    #Server = ftp://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/$repo/os/$arch
    ## Score: 2.4, Germany
    #Server = ftp://ftp5.gwdg.de/pub/linux/archlinux/$repo/os/$arch
    ## Score: 2.4, Germany
    #Server = http://ftp.hosteurope.de/mirror/ftp.archlinux.org/$repo/os/$arch
    ## Score: 2.6, Germany
    #Server = ftp://mirror.selfnet.de/archlinux/$repo/os/$arch
    ## Score: 2.7, Germany
    #Server = ftp://mirrors.n-ix.net/archlinux/$repo/os/$arch
    ## Score: 3.4, Germany
    #Server = ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/$repo/os/$arch
    ## Score: 3.9, United States
    #Server = http://mirror.us.leaseweb.net/archlinux/$repo/os/$arch
    ## Score: 4.0, Germany
    #Server = http://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/$repo/os/$arch
    ## Score: 4.1, United States
    #Server = ftp://mirror.us.leaseweb.net/archlinux/$repo/os/$arch
    ## Score: 4.4, Germany
    #Server = http://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch
    ## Score: 4.5, Germany
    #Server = http://mirror.de.leaseweb.net/archlinux/$repo/os/$arch
    ## Score: 4.5, Netherlands
    #Server = http://mirror.nl.leaseweb.net/archlinux/$repo/os/$arch
    ## Score: 5.3, Germany
    #Server = ftp://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch
    ## Score: 5.5, Germany
    #Server = ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/$repo/os/$arch
    ## Score: 5.8, Germany
    #Server = ftp://mirror.de.leaseweb.net/archlinux/$repo/os/$arch
    ## Score: 6.3, Netherlands
    #Server = ftp://mirror.nl.leaseweb.net/archlinux/$repo/os/$arch
    ## Score: 13.1, Germany
    #Server = http://ftp.tu-chemnitz.de/pub/linux/archlinux/$repo/os/$arch
    ## Score: 13.8, Germany
    #Server = http://artfiles.org/archlinux.org/$repo/os/$arch
    ## Score: 14.3, Germany
    #Server = ftp://ftp.tu-chemnitz.de/pub/linux/archlinux/$repo/os/$arch
    ## Score: 15.4, Germany
    #Server = ftp://artfiles.org/archlinux.org/$repo/os/$arch
    ## Score: 28.8, Germany
    #Server = http://ftp.uni-kl.de/pub/linux/archlinux/$repo/os/$arch
    ## Score: 30.1, Germany
    #Server = ftp://ftp.uni-kl.de/pub/linux/archlinux/$repo/os/$arch

  • I can't get Sort By Name to work on the Bookmarks Menu. How do you sort your folders alphabetically?

    I have my bookmarks sorted in folders. When I create a new folder it goes to the end of the list. I have tried going into Bookmarks/Show All Bookmarks, right click on Bookmarks Menu and Sort By Name but nothing happens. I have to manually move the newly created folder.
    Pat

    ''Pat L [[#answer-679152|said]]''
    <blockquote>
    ''FredMcD [[#answer-679014|said]]''
    <blockquote>
    Open the Bookmarks Manager. Open the folder branch tree. On this tree,
    select the folder you want with a right click.
    </blockquote>
    I have no problem sorting an individual folder by name, I can't get the list of folders to sort. As you can see by the attached images, several folders I've added are at the bottom of the folder list and even after I right click on Bookmark Menu/Sort By Name, they don't alphabetize.
    Pat
    </blockquote>
    Sorry, here is the other image.

  • Pacman-mirrorlist-20100131-1-i686.pkg.tar.gz corrupted

    what the title says so I can't upgrade. Is anyone else having this problem as none of my other packages are producing this message.

    toxygen wrote:
    is it me or has the mirrorlist gone to hell the last few days.  the only mirrors that seem both 1. up to date and 2. working without unexpected ftp errors and "cannot find package.tar.gz" (or cannot find server in a few cases) are the 3 french ones:
    Server = http://mir.archlinux.fr/$repo/os/x86_64
    Server = ftp://mir1.archlinux.fr/archlinux/$repo/os/x86_64
    Server = http://mir1.archlinux.fr/archlinux/$repo/os/x86_64
    even mir2 is not working for me atm (it was earlier).  my paranoid self tells me something is going wrong with the internets, because i was having other issues loading pages at work and here at home.  my less paranoid self says this is a freak occurence and most if not all mirrors will be caught up in a week or so.
    i just fear losing those 3 mirrors, since even ftp.archlinux.org seems to be lagging behind with those 3.
    see http://www.archlinux.org/news/482/

  • Clearcache - another script to selectively clear your pacman cache.

    https://aur.archlinux.org/packages.php?ID=50498
    I learned there are a number of scripts designed to do the same thing after I
    wrote the basic framework, but I went ahead and finished it anyway.
    clearcache has a number of features I haven't seen elsewhere,
    usage: clearcache [options] [targets]
    Options:
      -h, --help          display this help menu
      -d, --dry           dry run, simply list targets instead of removing
      -q, --quiet         only prints filenames for -d/--dry or -l/--list-targets
      -f, --force         force removal of package files
      -i, --ignore <pkg>  specify package(s) to ignore. this can be a comma
                          separated list, or '-' reads a list from stdin, one
                          per line. can be used more than once.
      -k, --keep <num>    specify number of old package files to keep. by default,
                          clearcache will keep the two most recent versions.
      -l, --list-targets  list targets to remove, using PAGER/less, before
                          removing. may not be used with -d/--dry
      -t, --threads <num> use <num> threads. the default value is 5. using a
                          large number will not gain you much, and is not
                          recommended, but there is no hard limit.
      -u, --uninstalled   remove all package files for packages that are not
                          currently installed, while still keeping the
                          specified number of old files for installed packages
      -v, --verbose       output more
      there MUST be a space between the option and its argument.
    Targets:
      targets are package names, as you would specify them to pacman.
      if targets are specified, only package files belonging to them will be
      removed. if no targets are specified, all packages except for thos
      specified to be ignored will be removed.
    It now uses the .PKGINFO file within the package itself, in order to know which
    package it belongs to (Thanks again brisbin).  This eliminates any issues with
    parsing the name from the version info, in the filename.
    Obviously using alpm or such would be faster, but this was a quick project.  I
    wrote a short snippet for myself, and decided to extend it.
    Anyway, hope someone else finds this useful, let me know if you find any bugs,
    or have any feature reqs.
    Potential issues:
      As seems to be the most common issue with scripts like this, it assumes the
      most recent package in the cache is the one installed, or the one you would
      want to keep.  I'm considering parsing pacman output to compare the versions,
      at least as an option.
    EDIT:
      Now with multithreading!  It has taken about 10% off the execution time on a single
      core netbook, and gets faster on better processors.  If nothing else, it was a good
      experiment, but I think it turned out rather well.
    Last edited by freak (2011-07-07 01:56:45)

    https://aur.archlinux.org/packages.php?ID=50498
    I learned there are a number of scripts designed to do the same thing after I
    wrote the basic framework, but I went ahead and finished it anyway.
    clearcache has a number of features I haven't seen elsewhere,
    usage: clearcache [options] [targets]
    Options:
      -h, --help          display this help menu
      -d, --dry           dry run, simply list targets instead of removing
      -q, --quiet         only prints filenames for -d/--dry or -l/--list-targets
      -f, --force         force removal of package files
      -i, --ignore <pkg>  specify package(s) to ignore. this can be a comma
                          separated list, or '-' reads a list from stdin, one
                          per line. can be used more than once.
      -k, --keep <num>    specify number of old package files to keep. by default,
                          clearcache will keep the two most recent versions.
      -l, --list-targets  list targets to remove, using PAGER/less, before
                          removing. may not be used with -d/--dry
      -t, --threads <num> use <num> threads. the default value is 5. using a
                          large number will not gain you much, and is not
                          recommended, but there is no hard limit.
      -u, --uninstalled   remove all package files for packages that are not
                          currently installed, while still keeping the
                          specified number of old files for installed packages
      -v, --verbose       output more
      there MUST be a space between the option and its argument.
    Targets:
      targets are package names, as you would specify them to pacman.
      if targets are specified, only package files belonging to them will be
      removed. if no targets are specified, all packages except for thos
      specified to be ignored will be removed.
    It now uses the .PKGINFO file within the package itself, in order to know which
    package it belongs to (Thanks again brisbin).  This eliminates any issues with
    parsing the name from the version info, in the filename.
    Obviously using alpm or such would be faster, but this was a quick project.  I
    wrote a short snippet for myself, and decided to extend it.
    Anyway, hope someone else finds this useful, let me know if you find any bugs,
    or have any feature reqs.
    Potential issues:
      As seems to be the most common issue with scripts like this, it assumes the
      most recent package in the cache is the one installed, or the one you would
      want to keep.  I'm considering parsing pacman output to compare the versions,
      at least as an option.
    EDIT:
      Now with multithreading!  It has taken about 10% off the execution time on a single
      core netbook, and gets faster on better processors.  If nothing else, it was a good
      experiment, but I think it turned out rather well.
    Last edited by freak (2011-07-07 01:56:45)

Maybe you are looking for