You are not logged in.

#1 2005-10-06 03:55:29

grail
Member
Registered: 2005-02-22
Posts: 70

Getting only latest packages from archlinux ftp site

I want to only download the latest package versions from the archlinux ftp site. So when doing a listing I get something like:

---
xfsprogs-2.6.25-1.pkg.tar.gz
xfsprogs-2.6.36-1.pkg.tar.gz
xfsprogs-2.6.36-2.pkg.tar.gz
xine-lib-1.0-1.pkg.tar.gz
xine-lib-1.0.1-1.pkg.tar.gz
xine-lib-1.1.0-1.pkg.tar.gz
xine-lib-1.1.0-3.pkg.tar.gz
xine-ui-0.99.3-2.pkg.tar.gz
xine-ui-0.99.4-1.pkg.tar.gz
---

I only want to dowload the single latest version of each above package. Any idea on how to do this?

Offline

#2 2005-10-06 08:33:57

Cam
Member
From: Brisbane, Aus
Registered: 2004-12-21
Posts: 658
Website

Re: Getting only latest packages from archlinux ftp site

Just type this, it'll find the latest, then download it and install it for you.

pacman -S xine-lib

If it doesn't work, post the contents of your /etc/pacman.conf file and we can help you from there smile

Offline

#3 2005-10-07 01:34:05

grail
Member
Registered: 2005-02-22
Posts: 70

Re: Getting only latest packages from archlinux ftp site

Actually the files I listed are not relevant. What I am trying to do is download the entire directory (all of arch linux). But in the dir "/ibiblio/distributions/archlinux/0.8/os/i686" there are multiple copies of each file and I only want to ftp download the latest version of each file.

Any suggestions on how to do this without having to manually select the latest version, etc...

Offline

#4 2005-10-07 12:43:27

Cam
Member
From: Brisbane, Aus
Registered: 2004-12-21
Posts: 658
Website

Re: Getting only latest packages from archlinux ftp site

pacman has a fetch only argument, something like this would work:

for pkg in `pacman -Sl`; do pacman -Sw `echo $pkg | awk '{print $2}'`; done

Now I havn't tested that and I just got home from the pub but something like that should work.

Offline

#5 2005-10-07 13:42:34

ivi3
Member
Registered: 2005-10-06
Posts: 62

Re: Getting only latest packages from archlinux ftp site

This short perl-script should do what you want and store the packages in /var/cache/pacman/ so don't forget to clean the cache beforehand.

#!/usr/bin/perl -w

use strict;

my @all = `pacman -Sl`;
#print @all;
my $packages = "";

foreach my $string (@all) {
        $string =~ /d*s(S*)s/;
        $packages = $packages."$1 ";
}

system "pacman -Sdw $packages";

greetings
Mathias

Offline

#6 2005-10-07 14:36:03

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,487

Re: Getting only latest packages from archlinux ftp site

... I have to learn perl ...


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#7 2005-10-07 14:41:49

ivi3
Member
Registered: 2005-10-06
Posts: 62

Re: Getting only latest packages from archlinux ftp site

big_smile

...yeah perl is lovely...

Offline

#8 2005-10-07 15:07:51

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Getting only latest packages from archlinux ftp site

Cam's one-liner should work the same way as the perl script (though I would have used cut instead of awk, he he)

Offline

#9 2005-10-08 18:15:28

cs25x
Member
Registered: 2004-05-04
Posts: 150

Re: Getting only latest packages from archlinux ftp site

there might be differences between the Arch ftp and the local database, synch first

pacman -Sy;for pkg in `pacman -Sl`; do pacman -Sw `echo $pkg | awk '{print $2}'`; done 

--(*(cs25x--));

Offline

Board footer

Powered by FluxBB