LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 05-19-2005, 07:50 PM   #1
_UnPrEdictAbLe_
Member
 
Registered: Aug 2004
Location: Hyderabad, India
Distribution: Fedora Core 4
Posts: 183

Rep: Reputation: 30
Writing a package manager tool... need help.


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
 
Old 05-19-2005, 09:38 PM   #2
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Slack 10.2, Slack 12, Suse 10.0, DSL 2.2, Xubuntu 7.04
Posts: 920

Rep: Reputation: 30
Are you trying to fetch a URL (.html page) or a package? If a package, perhaps look into the wget command.
 
Old 05-20-2005, 12:13 AM   #3
_UnPrEdictAbLe_
Member
 
Registered: Aug 2004
Location: Hyderabad, India
Distribution: Fedora Core 4
Posts: 183

Original Poster
Rep: Reputation: 30
Thumbs up

Yeah, I also figured out that WGET is the best choice for it.

Now my script is able to find the packages when FC2 was installed, and find out the packages that have been updated or newly installed. Contact "Fedora Core Server", "Livna", "Freshrpms", "Dag" and download the link to the packages that have been updated or newly installed but their rpms are not on the hard disk.

Now, I will figure out a mechanism to download those packages, and then, hehe, my piece of software is done!! Didn't take long though, just about 2-3 hours. You can download the tarball and see if it runs on your system.

Anyone interested to work?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
latex2e package unavailable in package manager or apt-get cesine Debian 2 07-11-2006 02:31 PM
package managment tool... IwantLINUX Linux - General 6 09-01-2005 08:31 PM
Keyboard shortcut manager/tool? 3.14159 Linux - Software 1 12-16-2004 03:55 AM
What SNMP manager tool would you recommend? brownstone Linux - Networking 3 07-15-2004 09:41 AM
Tool (setup script?) for re-writing /etc/fstab? MikTheUser Slackware 5 07-11-2004 09:12 AM


All times are GMT -5. The time now is 06:13 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration