Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Unsupported Software
  • Search

Clean out your world file

This forum covers all Gentoo-related software not officially supported by Gentoo. Ebuilds/software posted here might harm the health and stability of your system(s), and are not supported by Gentoo developers. Bugs/errors caused by ebuilds from overlays.gentoo.org are covered by this forum, too.
Post Reply
Advanced search
714 posts
  • Page 29 of 29
    • Jump to page:
  • Previous
  • 1
  • …
  • 25
  • 26
  • 27
  • 28
  • 29
Author
Message
slick
Bodhisattva
Bodhisattva
User avatar
Posts: 3495
Joined: Sun Apr 20, 2003 11:44 am

  • Quote

Post by slick » Thu Oct 01, 2009 3:20 pm

How is the current way to clean up the world file? Are there any new scripts or like that?
Top
FuzzyRay
Retired Dev
Retired Dev
Posts: 79
Joined: Thu Oct 02, 2003 3:00 pm
Contact:
Contact FuzzyRay
Website

  • Quote

Post by FuzzyRay » Thu Oct 01, 2009 8:22 pm

slick wrote:How is the current way to clean up the world file? Are there any new scripts or like that?
I never removed udept due to popular demand and it is still in the tree (you need to unmask it though). So you can still use dep -w -p. However, since it is unmaintained you will see errors printed to the screen, but on my systems the actual output still seems to be accurate.
Top
Ray ishido
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 141
Joined: Tue Jan 17, 2006 12:30 pm
Location: Piracicaba (Brazil)

  • Quote

Post by Ray ishido » Tue Dec 01, 2009 1:02 pm

Hi,
if dep no longer works, does emerge --depclean do the trick?
Top
asturm
Developer
Developer
Posts: 9496
Joined: Thu Apr 05, 2007 4:07 pm

  • Quote

Post by asturm » Tue Dec 01, 2009 1:05 pm

--depclean only cares about dependencies, based on world entries, not cleaning the world file.
Top
Makitk
n00b
n00b
Posts: 2
Joined: Thu Feb 18, 2010 11:47 am
Location: Netherlands
Contact:
Contact Makitk
Website

  • Quote

Post by Makitk » Thu Feb 18, 2010 11:54 am

FuzzyRay wrote:I never removed udept due to popular demand and it is still in the tree (you need to unmask it though). So you can still use dep -w -p. However, since it is unmaintained you will see errors printed to the screen, but on my systems the actual output still seems to be accurate.
Would it be ok for a total newbie to ebuilds to attempt to bump udept to a new version and subsequently maintain the ebuild? If so, any location I could retrieve the source from other than portage? The websites as listed in the first post of this thread don't work anymore.

If this isn't allowed, please do let me know, but it seems like a handy program to keep around, so an update to it would be necessary to keep it in the list for the future.
I know I can use it... :oops:
"When Mirage shows you files you can't find using Dolphin, it truly lives up to its name." - me
Top
loftwyr
l33t
l33t
User avatar
Posts: 970
Joined: Wed Dec 29, 2004 2:51 am
Location: 43°38'23.62"N 79°27'8.60"W

  • Quote

Post by loftwyr » Thu Feb 18, 2010 1:57 pm

If you want to maintain it, more power to you. You can get the source from the gentoo mirrors (just emerge -F udept) and copy it somewhere for the updating.
My emerge --info
Have you run revdep-rebuild lately? It's in gentoolkit and it's worth a shot if things don't work well.
Celebrating 5 years of Gentoo-ing.
Top
Makitk
n00b
n00b
Posts: 2
Joined: Thu Feb 18, 2010 11:47 am
Location: Netherlands
Contact:
Contact Makitk
Website

  • Quote

Post by Makitk » Mon Feb 22, 2010 11:35 pm

loftwyr wrote:If you want to maintain it, more power to you. You can get the source from the gentoo mirrors (just emerge -F udept) and copy it somewhere for the updating.
Considering the state of the most recent source, I'm looking at a total rework with a partner.
Further information with regards to that particular project will be released in due time. When related to udept, I'll link to it in this thread.

Might take a while, however. :oops:
"When Mirage shows you files you can't find using Dolphin, it truly lives up to its name." - me
Top
Dont Panic
Guru
Guru
User avatar
Posts: 322
Joined: Wed Jun 20, 2007 4:36 pm
Location: SouthEast U.S.A.
Contact:
Contact Dont Panic
Website

  • Quote

Post by Dont Panic » Tue Feb 23, 2010 3:20 am

I know udept did many more things, but I wrote a quick script to replicate the functionality of checking your world file for entries that could be cleaned.

I've called this script chk-world-deps.sh

Code: Select all

#!/bin/sh

for PKG in `cat /var/lib/portage/world`; do
        REVDEP_COUNT=`qdepends -C -Q ${PKG} | wc -l`
        if [ ! "${REVDEP_COUNT}" = "0" ]; then
                echo "*** ${PKG} is in world file, but has reverse deps"
                qdepends -C -Q ${PKG}
                echo ""
        fi
done
It can be run as a normal user, and simply checks every entry in the world file for reverse dependencies ('wc -l' counts the number of lines returned by the qdepends run). In theory, a package doesn't have to be in the world file if it has other packages that depend on it.

This script doesn't write back to the world file. But it could be modified to do so by adding a 'emerge --deselect ${PKG}' line, and then running as root.
Top
Henry78
Apprentice
Apprentice
Posts: 186
Joined: Mon Jul 12, 2004 4:12 pm
Location: Austria
Contact:
Contact Henry78
Website

  • Quote

Post by Henry78 » Wed Apr 28, 2010 8:05 pm

Dont Panic wrote: I've called this script chk-world-deps.sh
Thanks, "Don't Panic", I tried to enhance it and speed it up, also added an option to let the script do the actual removal, caution!

Code: Select all

#!/bin/bash 
#
# About: Clean up your worldfile by removing entries which are dependencies of
#        other packages, speak: Which have reverse dependencies.
#
# Usage: You may provide the '-v' switch to get more output.

VERBOSE=false
SUGGESTED_PKGS=""	# suggested for removal
WORLDFILE=/var/lib/portage/world

# Check if verbose flag was specified
[[ $1 = "-v" ]] && VERBOSE=true

# Find removeable packages
for PKG in `cat $WORLDFILE`; do 
	$VERBOSE && echo "${PKG}'s revdese dependencies:"
	REVDEPS=`qdepends -C -Q $PKG`

    if [[ -n $REVDEPS ]]; then
		for DEP in $REVDEPS; do
			$VERBOSE && echo -e "\t*** $DEP"
		done
		SUGGESTED_PKGS="$SUGGESTED_PKGS $PKG"
	else
		true	# need this to overcome an empty else if VERBOSE isn't set
		$VERBOSE && echo -e "\t--- No dependencies found"
	fi
done

# Summary, what may be removed?
if [[ -z $SUGGESTED_PKGS ]]; then
	echo "Couldn't find any reverse dependencies. Your world file is minimal!"
	exit
else
	echo -e "\n***********************************\n"
	echo "Suggested for removal:"
	for SUGGEST in $SUGGESTED_PKGS; do
		echo $SUGGEST
	done
fi

# Actually remove world file entries
echo -e "\n***********************************\n"
echo    "WARNING: Be shure to have a *recent* copy of your worldfile!"
echo -n "Do you want to remove all suggest now? (y/n) "
read -n1 ANSWER

if [[ $ANSWER = "y" ]] || [[ $ANSWER = "Y" ]]; then
	# Slash escaping is - as always - rather obscure. 
	# Here we find the slash and replace it by backslash and slash: / -> \/
	SUGGESTED_PKGS=`echo $SUGGESTED_PKGS | sed 's/\//\\\\\//g'`
	for SUGGESTED in $SUGGESTED_PKGS; do
		sed -i "/$SUGGESTED/d" $WORLDFILE
	done
fi
Top
orionbelt
Apprentice
Apprentice
User avatar
Posts: 183
Joined: Wed Apr 05, 2006 5:06 pm

Difference between "qdepends -Q" and "equery

  • Quote

Post by orionbelt » Thu Jun 17, 2010 2:04 pm

The script above uses "qdepends -Q" to determine dependencies. However, "equery depends" is also supposed to do that, and it looks like it is more thorough in its dependency searches, as mentioned in this thread:

http://forums.gentoo.org/viewtopic-p-63 ... ml#6317971

Is there any reason why "qdepends -Q" should be preferred over "equery depends" ?
Top
Dont Panic
Guru
Guru
User avatar
Posts: 322
Joined: Wed Jun 20, 2007 4:36 pm
Location: SouthEast U.S.A.
Contact:
Contact Dont Panic
Website

  • Quote

Post by Dont Panic » Wed Jun 23, 2010 3:41 pm

The reason I used 'qdepends -Q' as opposed to 'equery depends' is because equery tends to return false positives when employeed in the context of this script.

The 'equery' command does not take into account your actual USE flag settings. The 'qdepends' command attempts to do so.

The 'qdepends' command is not perfect, but is the closest thing I could find.

I've provided more details in another thread, so in the interest of avoiding cross-posting, I supply the link here: Difference between "qdepends -Q" and "equery depends" ?
Top
atommixz
n00b
n00b
Posts: 4
Joined: Thu Jun 24, 2010 2:27 pm

  • Quote

Post by atommixz » Thu Jun 24, 2010 2:43 pm

Henry78 wrote:
Dont Panic wrote: I've called this script chk-world-deps.sh
Thanks, "Don't Panic", I tried to enhance it and speed it up, also added an option to let the script do the actual removal, caution!
More useful for me. If "-v" then "No dependencies found" - simply no output. Thanks all.

$ cat ./script/chk-world-deps.sh

Code: Select all

#!/bin/bash 
# About: Clean up your worldfile by removing entries which are dependencies of 
#        other packages, speak: Which have reverse dependencies. 
# 
# Usage: You may provide the '-v' switch to get more output. 

WORLDFILE=/var/lib/portage/world 
VERBOSE=false
SUGGESTED_PKGS=""   # suggested for removal 

# Check if verbose flag was specified 
[[ $1 = "-v" ]] && VERBOSE=true

# Find removeable packages 
for PKG in `cat $WORLDFILE`; do 
   REVDEPS=`qdepends -C -Q $PKG` 

   if [[ -n $REVDEPS ]]; then 
      $VERBOSE && echo "${PKG}:"
      for DEP in $REVDEPS; do 
         $VERBOSE && echo -e "\t $DEP" 
      done 
      SUGGESTED_PKGS="$SUGGESTED_PKGS $PKG" 
   fi 
done 

# Summary, what may be removed? 
if [[ -z $SUGGESTED_PKGS ]]; then 
   echo "Couldn't find any reverse dependencies. Your world file is minimal!" 
   exit 
else 
   $VERBOSE && echo
   echo -e "Suggested for removal:"
   for SUGGEST in $SUGGESTED_PKGS; do 
      echo -e "\t $SUGGEST"
   done 
fi 

# Actually remove world file entries 
echo
echo    "WARNING: Be shure to have a *recent* copy of your worldfile!" 
echo -n "Do you want to remove all suggest now? (y/n) " 
read -n1 ANSWER 

if [[ $ANSWER = "y" ]] || [[ $ANSWER = "Y" ]]; then 
   # Slash escaping is - as always - rather obscure. 
   # Here we find the slash and replace it by backslash and slash: / -> \/ 
   SUGGESTED_PKGS=`echo $SUGGESTED_PKGS | sed 's/\//\\\\\//g'` 
   for SUGGESTED in $SUGGESTED_PKGS; do 
      sed -i "/$SUGGESTED/d" $WORLDFILE 
   done 
fi 
Top
s0be
Apprentice
Apprentice
User avatar
Posts: 240
Joined: Sat Nov 23, 2002 1:12 pm

  • Quote

Post by s0be » Thu Jun 24, 2010 3:23 pm

To clean up your slash replacement (a little, anyways):

Code: Select all

bigiron hosts $ echo "//" | sed 's:/:\\/:g'
\/\/
Top
green2000
n00b
n00b
Posts: 3
Joined: Sun Dec 05, 2010 3:31 am

"reverse approach" to cleaning world file

  • Quote

Post by green2000 » Sun Dec 05, 2010 6:26 am

from http://help.lockergnome.com/linux/gento ... 62179.html

There is also, let me name it "reverse approach".

You first make a back up and empty your world file:
1) gentoo ~ #cp /var/lib/portage/world ~/ && >/var/lib/portage/world
and then build it again:
2) gentoo ~ #regenworld

"regenworld" will put some packages which it thinks belong to the world
list.
Now check what portage finds to be useless when the world set is almost
empty:
3) gentoo ~ #emerge --depclean --pretend

From the list shown by the above command you chose the program packages
you *want* to have installed and put them in the world file. One "atom"
("category-name/package-name", without version numbers) per line.
Now do as "emerge --depclean" recommends:

4) gentoo ~ #emerge --update --newuse --deep world

Repeat the steps from (2) to (4) until (3) shows only packages that are
not familiar to you and (4) doesn't want to install anything.

Next. Check if there are no system packages in the list (3) shows:
5) gentoo ~ #emerge -pve system

It should not happen that (3) wants to remove system packages but its
better to be sure.

Now "cross your fingers" and execute emerge --deplcean for real (without
--pretend).
6) emerge --deplcean
Immediately after (6) finishes you *must* do:
7) emerge -DuN world
revdep-rebuild

When ( is successfully finished you should have a "clean" world set
within a healthy system.
If something goes wrong you can bring back your working "world" and
recheck all packages:

#cp ~/world /var/lib/portage/world
#emerge -DuN world
#revdep-rebuild

One more thing. You remember that saying "If it works don't fix it",
don't you?
I mean your system should work properly even with "polluted" world set,
no matter there are additional packages in it.
Top
Post Reply

714 posts
  • Page 29 of 29
    • Jump to page:
  • Previous
  • 1
  • …
  • 25
  • 26
  • 27
  • 28
  • 29

Return to “Unsupported Software”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic