LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2013, 12:40 PM   #16
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354

As I said, that method shows you every dependency in the whole repository, NOT just what you've installed. Was that the only dependency on samba-common that was shown?

(As you can see from my output, above, the Fedora 19 repositories don't contain any Samba 3 code.)

By the way, since I had that file, I thought that I would find an improved version of the program useful. So here's version 0.2:
Code:
#!/bin/gawk -f
# Parse the diagraph file created by the repo-graph command to create a list of all packages which depend
# on a specific package.
#
# Usage: Change the name in the BEGIN section, below, to contain the package for which you wish to
#        list the packages requiring it.
#
###################
# Since this may take some time, here's a "spinner" so you'll know it's running
BEGIN {
  spinner[0]="|"
  spinner[1]="/"
  spinner[2]="-"
  spinner[3]="\\"
  spinner_counter=3
}
function spin()
{
  printf("\b%s",spinner[(++spinner_counter)%4])
}
#################
# Initalization section. Look for a "-s" or "--search=" option
BEGIN {
  for (i=1;i< ARGC;++i) {
    if (ARGV[i] ~ /-s/) {
      requires=gensub(/.*=/,"",1,ARGV[i])
      delete ARGV[i]
      if ((!requires) && ARGV[i+1]) {
        requires=ARGV[++i]
        delete ARGV[i]
      }
    }
  }
  # Set the default serach term if necessary
  if (!requires) requires="samba-common"
  # And tell what we're going to do
  printf("\nList of all packages requiring \"%s\"\n\n", requires)
}
/ -> {/ {
  spin()
  name=gensub(/"/,"","g",$1) #"
  while (getline) {
    if ($0 ~ /^}/ ) break
    if ($0 ~ requires) {
      cmd="yum deplist " name
      while (cmd | getline line) {
        spin()
        n=split(line,part)
        if ((part[1] == "dependency:") && (part[2]==requires)) {
          version=((part[4])?part[3] " " part[4]:part[3])
          ++list[name][part[2]][version]
        }
      }
      close(cmd)
   }
  }
}
END {
  printf("\b")
  for (name in list) {
    print name
    for (need in list[name]) {
      for(version in list[name][need]) {
        print " " need version
      }
    }
  }
}
For the same repro-graph file, here's what I get for "samba:"
Code:
$ ./parse_graph-repo.gawk -s=samba konsole.out 

List of all packages requiring "samba"

sblim-cmpi-samba
 samba>= 3.0.10
samba-python
 samba= 2:4.0.5-1.fc19
freeipa-server-trust-ad
 samba>= 2:4.0.5-1
samba-test
 samba= 2:4.0.5-1.fc19
ris-linux
 samba
system-config-samba
 samba
kdenetwork-fileshare-samba
 samba
samba-swat
 samba= 2:4.0.5-1.fc19
mate-file-manager-share
 samba
 
Old 05-29-2013, 02:38 PM   #17
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Original Poster
Rep: Reputation: Disabled
OHhh I see, and yes that was the only dependency that showed up. I will try and run your 0.2 version. I just realized something, the first time I tried jnstalling samba4 for some reason I remember it saying 3.9.9 coming up and then with that script it only has 3.6.9. I think I'm missing something, I will check again. Thanks!

EDIT: I got this error
Code:
gawk: ./parse_graph-repo.gawk:51:           ++list[name][part[2]][version]
gawk: ./parse_graph-repo.gawk:51:                       ^ syntax error
gawk: ./parse_graph-repo.gawk:51:           ++list[name][part[2]][version]
gawk: ./parse_graph-repo.gawk:51:                               ^ syntax error
gawk: ./parse_graph-repo.gawk:62:     for (need in list[name]) {
gawk: ./parse_graph-repo.gawk:62:                      ^ syntax error
gawk: ./parse_graph-repo.gawk:63:       for(version in list[name][need]) {
gawk: ./parse_graph-repo.gawk:63:                          ^ syntax error

Last edited by Altiris; 05-29-2013 at 05:22 PM.
 
Old 05-30-2013, 09:27 AM   #18
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by Altiris View Post
OHhh I see, and yes that was the only dependency that showed up. I will try and run your 0.2 version. I just realized something, the first time I tried jnstalling samba4 for some reason I remember it saying 3.9.9 coming up and then with that script it only has 3.6.9. I think I'm missing something, I will check again. Thanks!

EDIT: I got this error
Code:
gawk: ./parse_graph-repo.gawk:51:           ++list[name][part[2]][version]
gawk: ./parse_graph-repo.gawk:51:                       ^ syntax error
gawk: ./parse_graph-repo.gawk:51:           ++list[name][part[2]][version]
gawk: ./parse_graph-repo.gawk:51:                               ^ syntax error
gawk: ./parse_graph-repo.gawk:62:     for (need in list[name]) {
gawk: ./parse_graph-repo.gawk:62:                      ^ syntax error
gawk: ./parse_graph-repo.gawk:63:       for(version in list[name][need]) {
gawk: ./parse_graph-repo.gawk:63:                          ^ syntax error
Those errors because I wrote the code for gawk version 4, which supports multidimensional arrays. It might be possible to re-write it for the older version 3. If I can, I'll post it here. (I may take me a while - I've got things I need to do this morning.)
 
Old 05-30-2013, 01:49 PM   #19
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Original Poster
Rep: Reputation: Disabled
It's fine, take as long as you want. It's not really a big deal, I will probably open a new thread on CentOS form also.
 
Old 05-31-2013, 01:25 PM   #20
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
I think I found a better way: Don't reinvent the wheel!

Try this command: $ rpm -q --qf "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" samba-common | grep '3\.0'

On my system, I get:
Code:
$ rpm -q --qf "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" samba-common | grep '3\.0'
rpmlib(CompressedFileNames) <= 3.0.4-1
$ rpm -q --qf "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" rpmlib
package rpmlib is not installed
And it's fast!
 
Old 05-31-2013, 04:39 PM   #21
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Original Poster
Rep: Reputation: Disabled
I already figured out what it was, I just had to remove samba-common-3.6.9 and I was able to install Samba4...HOWEVER I encountered the same problem (nbmd is dead but pid file exists) so I removed Samba4 and reinstalled Samba 3.6.9 or whatever version centos has by typing yum install samba and it installed. I messed around with the .conf file (making it local master, WINS server etc.) and now smb has the "is dead but pid file exists" error but nmb doesnt. I put the .conf file back to how it was by default and I am still getting "smb is dead but pid file exists". THIS IS SO WEIRD, its like the opposite just occured.

Last edited by Altiris; 05-31-2013 at 04:42 PM.
 
  


Reply



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
[SOLVED] Dell PERC 5/i showing virtual disk "Ready" instead of "Optimal" MensaWater Linux - Hardware 1 08-30-2012 09:02 AM
samba error on windows "Network path not found" parkarnoor Linux - Newbie 2 03-23-2011 01:42 PM
Sabayon and Windows "My Documents" not showing bikrmagi Sabayon 18 06-17-2010 09:47 AM
SAMBA - cannot connect to local network: "Timeout on Server 'x'" v@ny@ Linux - Networking 5 02-16-2008 05:44 PM
New section for "Getting linux to cooperate with windows" wwnexc LQ Suggestions & Feedback 4 10-13-2005 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:24 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