[Savage40] dri snapshots download script.

Honza Král honza.kral at gmail.com
Mon Jun 6 12:38:52 PDT 2005


I believe this is simpler ;)

if you run it withou parameters, it downloads the latest common and
latest savage driver, if you specify first param, it will download the
specified driver into ./
if you set both, it will download the specified driver into specified
directory...

enjoy

#!/bin/sh

# first parameter is driver, default is savage
DRIVER="${1:-savage}"
# second parameter is destination directory (note that first param
must be specified to use this)
DEST="${2:-.}"

## base directory of the driver list
BASEURL="http://dri.freedesktop.org/snapshots/"

## retrieve the list
wget -qO -  $BASEURL |\
## strip HTML, leave only URLS
        sed -ne 's;.*href="\([^"/]*\)".*;\1;p' |\
## make the latest drivers go first
        sort -r |\
## leave only the first line for every driver
        sort -t '-' -u -k 1,1  |\
## filter out the drivers yo want
        grep -e "^$DRIVER-" -e "^common-" |\
## download them
        xargs -i wget -P $DEST $BASEURL{} || exit 1 

exit 0


On 6/3/05, Christian A. Reiter <chris.reiter at gmx.at> wrote:
> Hi people,
> 
> I just wanted to commit that I wrote a small bash script that automatically
> downloads the newest dripkg snapshot from dri.freedesktop.org/snapshots.
> 
> If anyone's interested, get it here:
> 
> http://stadt.heim.at/wien/142749/data/fetch_dripkg
> 
> 
> Feel free to use it, or impove it ;-) but please if you change anything to the
> better - let me have a copy, I like learning bash programming.
> 
> Chris
> _______________________________________________
> Savage40 mailing list
> Savage40 at probo.com
> http://www.probo.com/mailman/listinfo/savage40
> 


-- 
Honza Král
E-Mail: Honza.Kral at gmail.com
ICQ#:   107471613
Jabber: king at jabber.cz
Phone:  +420 606 678585


More information about the Savage40 mailing list