LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 11-01-2004, 01:46 PM   #1
gandhis
LQ Newbie
 
Registered: Nov 2004
Posts: 3

Rep: Reputation: 0
rpm dependencies


hi all,

I m trying a command
rpm -q <packagename> -R

but i suppose it gives just first level dependency. i want to know if there is a command which can give all level dependecies for a given package name?


Thanks
seema
 
Old 11-01-2004, 02:50 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982Reputation: 1982
not really, as it can't know, and essentially you will end up with a HUGE amount of dependencies, as many end user RPM's can cover more than 10 levell of dependencies.

i mean essentially you couold write a basic recursive script to feed the command output back into the input...
Code:
for pkg in `rpm -qR $package`
do
  echo $pkg
  this_script $pkg
done
but... yuck!
 
Old 11-02-2004, 12:00 AM   #3
gandhis
LQ Newbie
 
Registered: Nov 2004
Posts: 3

Original Poster
Rep: Reputation: 0
hi Chris,

Thank you very much for your reply.

I m having hard time in running recursive shell script:
this is wht i was trying to do but failure can anybody help me?



#echo "called by $1"
for pkg in `rpm -qR $1`
do
if [[ "$1" == "package" ]];
# if the parameter is 'package' we were called by an errorneous package
then
# exit with status 0
exit 0;
else
echo $pkg
# TODO: get the status of the call 'bash test $pkg'
if ...
# TODO: if the status was 0
then
# TODO: return by status 1 - we need to finish the parent's call
exit 1;
# TODO: if the status was 1
else
# TODO: continue the loop with the next package name
;
fi;
fi
done
#echo "end $1"
exit 1

# NOTE: status 0 means error, status 1 means success
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
RPM Dependencies EmpMing Linux - Software 2 10-21-2004 07:25 PM
rpm dependencies? nate1002 Linux - Newbie 1 02-18-2004 02:49 PM
RPM 'failed dependencies': Why can I not install any rpm packages? leontini Linux - Newbie 7 09-16-2003 01:44 AM
RPM Dependencies MarcRJacobs Linux - Newbie 2 05-16-2003 11:06 PM
rpm and dependencies zorro Linux - Newbie 1 05-09-2002 11:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 07:43 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration