revdep-rebuild woes?

Anything that pertains to Portage

Moderator: Moderators

revdep-rebuild woes?

Postby xlnagla » Fri Apr 18, 2008 23:39

Ever had an issue with software and fired up revdep-rebuild, only to find that a long, long list of packages you've broken are simply no longer in portage? Ever wish there was a fast, easy way to run revdep-rebuild and just emerge the packages it pulls up in their most recent form, not the ones you already had! Well now there is! I've written a _very_ primitive shell process that will just re-run revdep's emerge command except without --oneshot, without =version, and without the version numbers. See the attatched! Let me know if it works for you and if you like it, if so I may make this a sticky/work more on the script. Be sure to chmod a+x the file in order to run it, and to run shell scripts it's ./scriptname, not just the scriptname unless it's in one of the bins. Also, you may want to rename it from .txt to .sh just for continuity's sake - can't upload it otherwise.

----NOTE----

the script in this forum post won't work with the newer versions of portage. Fixed it, and posted it here.

~xlnagla
xlnagla
Sagely Hen
 
Posts: 1078
Joined: Mon May 28, 2007 2:44

Re: revdep-rebuild woes

Postby chickpea » Fri Apr 18, 2008 23:47

Good work, why not make that suggestion upstream to build it in as an option in the revdep-rebuild command itself, something like the

revdep-rebuild --with-updates

or some such.

Great work though
chickpea
Sagely Hen
 
Posts: 1084
Joined: Fri Jan 05, 2007 15:08
Location: Washington, DC

Re: revdep-rebuild woes

Postby wolfden » Fri Apr 18, 2008 23:53

Just ran it here to fix some broken libraries - looks good to me

EDIT:
hmmmmmm seem like it don't like failed packages tho, first package compiled fine, seconded one failed and it like started over, but now only going to emerge one instead of the other 4
wolfden
Sharecropper
 
Posts: 9050
Joined: Sat Jan 14, 2006 0:55
Location: Midwest USA

Re: revdep-rebuild woes

Postby xlnagla » Sat Apr 19, 2008 0:52

Think I fixed that, and a few more major updates mark this version! Again, let me know if this works for you or not.

~xlnagla
xlnagla
Sagely Hen
 
Posts: 1078
Joined: Mon May 28, 2007 2:44

Re: revdep-rebuild woes?

Postby WarraWarra » Sat Apr 19, 2008 15:54

Don't you need to first emerge --sync and then run this as then it should list only latest available or something + fix / update / upgrade as intended.

I have seen with a old emerge --sync or lack of this that mine did something similar a few months ago.
Managed to get it fixed by emerge --sync and then it seemed to work way back with revdep-rebuild errors.

Likely I am wrong about this / not sure.
WarraWarra
Sagely Hen
 
Posts: 1989
Joined: Wed Jan 03, 2007 21:01
Location: 31.324270, -113.585511

Re: revdep-rebuild woes?

Postby xlnagla » Sat Apr 19, 2008 16:10

Well, naturally - the script will use the portage database, so it's rather important to sync your portage or overlays if you want packages that are truly up-to-date. I could put that in the beginning of the script, but I'm afraid that will cause people to have to re-sync multiple times a day, and that's not terribly good for gentoo etiquette. But you do bring up a good point, always sync if you expect to upgrade!

~xlnagla
xlnagla
Sagely Hen
 
Posts: 1078
Joined: Mon May 28, 2007 2:44

Re: revdep-rebuild woes?

Postby wolfden » Wed Apr 23, 2008 0:30

seems to be working good here now :D
wolfden
Sharecropper
 
Posts: 9050
Joined: Sat Jan 14, 2006 0:55
Location: Midwest USA

Re: revdep-rebuild woes?

Postby Fitzcarraldo » Wed Apr 23, 2008 1:39

xlnagla wrote:Well, naturally - the script will use the portage database, so it's rather important to sync your portage or overlays if you want packages that are truly up-to-date. I could put that in the beginning of the script, but I'm afraid that will cause people to have to re-sync multiple times a day, and that's not terribly good for gentoo etiquette. But you do bring up a good point, always sync if you expect to upgrade!

~xlnagla

You could prompt the user in your script. My coding days are long gone, but something along the lines of the following:

Code: Select all
while :; do
  query_user "Do you want me to sync with Portage and overlays?"
  case $? in
    0 ) emerge --sync && layman -S && break ;;
    1 ) break ;;
  esac
done;;

and so on, with procedure query_user as follows, taken verbatim from DontPanic's yaocleaner script (see another thread).

Code: Select all
query_user() {
  set_xterm_title "${fullprog}: ${1}"
  prompt="${BR}${1}${NO} "
  shift
  rprompt="[${GR}Yes${NO}/${RD}No${NO}] "
  responses=( Yes No )
  echo -en "\n$prompt"
  # Ctrl-C
  trap "echo 'Interrupted.' >&2; exit 0" 2
  while true; do
    if read -e -p "$rprompt"; then
      for ((i=0; i<${#responses[@]}; ++i)); do
        response="${responses[$i]}"
        [[ "$REPLY" == "${response:0:${#REPLY}}" ]] \
        && return $i
      done
      for ((i=0; i<${#responses[@]}; ++i)); do
        response="${responses[$i]}"
        [[ "$(upper "$REPLY")" == "$(upper "${response:0:${#REPLY}}")" ]] \
        && return $i
      done
      set_xterm_title "${fullprog}: Sorry, response '$REPLY' not understood."
      echo "Sorry, response '$REPLY' not understood." >&2
      echo -en "\n$prompt"
    else
      # Ctrl-D
      echo "Interrupted." >&2
      exit 0
    fi
  done
  trap - 2
}
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7977
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: revdep-rebuild woes?

Postby xlnagla » Wed Apr 23, 2008 4:25

good idea - I'll work on implementing it - probably not as advanced as yaocleaner's implementation though, I don't need it for the revdep script - if you kill the revdep process everything else can't run anyway, and most of that user input function has to do with catching interrupts. May want to catch an interrupt in safe mode though ... that could take a while in a badly broken system.

~xlnagla

as a note, I actually do use yaocleaner. Much better than the built-in tools.
xlnagla
Sagely Hen
 
Posts: 1078
Joined: Mon May 28, 2007 2:44


Return to Portage|Emerge Package Managers

Who is online

Users browsing this forum: No registered users and 2 guests