[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apt-zip



Ringrazio tutti per le celeri risposte.

Non so perchè ma ho dato per scontato che tutti conoscessero apt-zip...
^_^ e i suoi script ^_^

Scusate...

Lo script sarebbe questo:

#!/bin/sh
# This file was auto-generated by apt-zip-list 0.13.2
# Method: wget - Options: 
 
err(){
	echo >&2 "Fetching $1 failed ($2)"
}
check(){
        [ ! -r "$1" ] && return 1
	[ "`which md5sum`" ] && 
		if [ "`md5sum $1 | cut -d' ' -f1`" = $2 ]
		then return 0
		else err $1 "wrong MD5"; return 1
		fi
	[ "`which gzip`" ] &&
		if ar p $1 data.tar.gz | gzip -t
		then return 0
		else err $1 "wrong contents"; return 1
		fi
	return $3
}
do_wget() {
	wget -t3 -nv -O $2 $1
	check $2 $4 $?
	return $?
}
getfile(){
	do_wget $1 $2 $3 $4 &&
	mv $2 ../
}
mkdir -p partial && cd partial || error "Cannot change to directory
./partial"
       while read URL FILE SIZE MD5
       do getfile $URL $FILE $SIZE $MD5 || true
       done <<EOP
http://ftp.it.debian.org/debian/pool/main/c/cdrtools/cdda2wav_2.0+a19-1_i386.deb cdda2wav_4%3a2.0+a19-1_i386.deb 167236 45751b3089cda20bc39d9bae12c00847
http://ftp.it.debian.org/debian/pool/main/c/cdrtools/cdrecord_2.0+a19-1_i386.deb cdrecord_4%3a2.0+a19-1_i386.deb 708632 f8a34506bd47f4f853799d86ab5dd192

[...]

http://ftp.it.debian.org/debian/pool/main/g/gdbm173/libgdbmg1_1.7.3-28_i386.deb libgdbmg1_1.7.3-28_i386.deb 19226 203df6bb93d4d422e17a1192cf8c6413
http://ftp.it.debian.org/debian/pool/main/x/xfree86/libxaw6-dev_4.2.1-12.1_i386.deb libxaw6-dev_4.2.1-12.1_i386.deb 346450 5bc2c4dfebbd7ddc78d97c51ea32088f
EOP

Cmq i comandi datimi da Daniele vanno benissimo per ricavarmi gli
indirizzi (thanks!).

Mi incuriosisce moltissimo però anche la soluzione di anabik.
Non ho capito una cosa però (più che altro mi sembra strana), basta solo
che io prenda il file 'apt-wget' lo rinomini ad 'apt-wget.bat', lo salvi
con wordpad (che roba sono i CR/LF?) e lo lanci???!

Se è così è stupefacente!

Grazie anche a Francesco.

Ciao!



Reply to: