Hi,
I am using Fedora Core 2, and my system generally relies on the RPM packages. Now, I want to install a fresh system on my friend's PC. My system has all packages of the latest versions.
As FC2 came quite early, I want to make a script to find out the packages which have been newly installed or updated. This scripts also locates the RPMs of the new packages already on the disk.
The next step is to download all the packages that are not on the disk. For this, I think, I will just query RPMFIND.NET , FEDORA SERVERS, FRESHRPMS, LIVNA and DAG.
I also tried to extract the servers in yum.conf .. like this....
Code:
cat /etc/yum.conf | grep http:// | grep ^[^\#] | grep baseurl | cut -d = -f 2 | sed 's/\$basearch/i386/' | sed 's/$releasever/2/' > server.0.0.1.txt
cat /etc/yum.conf | grep http:// | grep ^[^\#] | grep -v baseurl | tr -d " " | tr -d "\t" | sed 's/\$basearch/i386/' | sed 's/\$releasever/2/' >> server.0.0.1.txt
(successfully ignores commented servers)
For each RPM, I will need to retrieve a page, and find out its link, and then download that RPM.
I saved the pages from Rpmfind.net and Fedora Server manually and run another script. This one successfully extracted the "link" to the rpm file.
Code:
cat source.html | sed 's/></>\n</g' | grep zip-2.3-26.2 |grep href |cut -d \" -f 2 | grep rpm$
(here I am extracting rpm for the zip package, that can be replaced by a variable)
(source.html is
http://download.fedora.redhat.com/pu...updates/2/i386)
Please tell me how to fetch a URL using w3m, or prozilla, or anything that runs in shell, and should work even when I am behind a proxy server. w3m and links work, but they make threads, and I am unable to redirect stdout to a text file. And also, how to download the rpm also.
Anyone interested to add more features is welcome too. Does anyone know how to read the .hdr files (yum headers).
My scripts can be found
here.
Thanks..
Unpredictable