Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cleaning the world file (wiki) - check the script
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Sun Jan 21, 2018 3:36 pm    Post subject: Reply with quote

bunder wrote:
yes that is true, but they are needed by other packages on your system.

Wrong. If they were needed by other packages, there was no reason to have them in the world file. They are in the world file - as everything there - because I installed them.

bunder wrote:
you can choose whether to remove them from world or not.

That's why we have the script shown at https://wiki.gentoo.org/wiki/World_set_%28Portage%29#Keep_it_clean
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Sun Jan 21, 2018 3:54 pm    Post subject: Reply with quote

helecho wrote:
charles17, I do not understand why you want to add a second step. Your algorithm could be done in one step.

Code:
#!/bin/bash

while read -r i ; do
   if equery depends "$i" >> /dev/null ; then
     echo $i' needs to stay in @world'
   else
     echo "$i can be deselected"
     echo $i >> /tmp/deselect
   fi
done < /var/lib/portage/world


However, this is the opposite result to the expected one.

In case you really want it one-step, try
Code:
#!/bin/bash

while read i ; do \
        if [ -n "$(emerge -p --quiet --depclean $i)" ]; then \
                echo $i' needs to stay in @world, otherwise next depclean would unmerge it.'
        else
                echo $i' can be deselected'
                echo $i >> /tmp/deselect
        fi
done < /var/lib/portage/world
Back to top
View user's profile Send private message
saboya
Guru
Guru


Joined: 28 Nov 2006
Posts: 552
Location: Brazil

PostPosted: Sun Jan 21, 2018 3:55 pm    Post subject: Reply with quote

The concept that packages that are depended upon by others shouldn't be in the world file is completely wrong. It's a very real possibility that you have a package A that is a dependency for package B but you actually want A installed regardless of B.

That script is just a bad practice and the real issue is managing the packages you want installed correctly.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Sun Jan 21, 2018 3:58 pm    Post subject: Reply with quote

saboya wrote:
The concept that packages that are depended upon by others shouldn't be in the world file is completely wrong. It's a very real possibility that you have a package A that is a dependency for package B but you actually want A installed regardless of B.

As long B is installed there is no reason for A being listed in the world file. Except you intentionally put it there for some strange reason.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Sun Jan 21, 2018 4:40 pm    Post subject: Reply with quote

charles17 wrote:
saboya wrote:
The concept that packages that are depended upon by others shouldn't be in the world file is completely wrong. It's a very real possibility that you have a package A that is a dependency for package B but you actually want A installed regardless of B.

As long B is installed there is no reason for A being listed in the world file. Except you intentionally put it there for some strange reason.


charles17 wrote:
In case you really want it one-step, try

Code:
#!/bin/bash

while read i ; do \
        if [ -n "$(emerge -p --quiet --depclean $i)" ]; then \
                echo $i' needs to stay in @world, otherwise next depclean would unmerge it.'
        else
                echo $i' can be deselected'
                echo $i >> /tmp/deselect
        fi
done < /var/lib/portage/world


charles17, you say something but you do the contrary!!

Edition: The confusion between the kind of dependencies seems unlikely.

Code:
-n string
              True if the length of string is non-zero.


helecho
Back to top
View user's profile Send private message
saboya
Guru
Guru


Joined: 28 Nov 2006
Posts: 552
Location: Brazil

PostPosted: Sun Jan 21, 2018 5:44 pm    Post subject: Reply with quote

charles17 wrote:
As long B is installed there is no reason for A being listed in the world file. Except you intentionally put it there for some strange reason.

That's a misinterpretation of the world file concept.

The world file should have packages that you want to explicitly have installed, and let portage figure out the dependencies of those packages. There's no reason to assume that the world file and it's dependencies should not intersect with each other.

The world file's purpose is not "having the least amount of lines to pull the packages you want", it's about "having the necessary lines to express the packages you want installed". Because if package A depends on package B but you want B installed regardless of A, package B should be in the world file.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Sun Jan 21, 2018 5:50 pm    Post subject: Reply with quote

saboya wrote:
charles17 wrote:
As long B is installed there is no reason for A being listed in the world file. Except you intentionally put it there for some strange reason.

That's a misinterpretation of the world file concept.

The world file should have packages that you want to explicitly have installed, and let portage figure out the dependencies of those packages. There's no reason to assume that the world file and it's dependencies should not intersect with each other.

The world file's purpose is not "having the least amount of lines to pull the packages you want", it's about "having the necessary lines to express the packages you want installed". Because if package A depends on package B but you want B installed regardless of A, package B should be in the world file.
which brings us back to the perceived problem with the "automanagement of the world file"

Take my example... gcc

GCC does not need to be listed in the world file because
1) it is part of @system
2) other packages depend on GCC
Code:
equery depends gcc
 * These packages depend on gcc:
dev-java/icedtea-bin-3.6.0 (>=sys-devel/gcc-5.4.0[multilib?])
media-libs/libmypaint-1.3.0 (openmp ? sys-devel/gcc[openmp])
media-libs/mesa-17.3.1 (opencl ? >=sys-devel/gcc-4.6)
net-libs/webkit-gtk-2.18.5 (>=sys-devel/gcc-4.9)
sys-devel/llvm-5.0.1 (>=sys-devel/gcc-3.0)
sys-libs/glibc-2.26-r5 (>=sys-devel/gcc-4.9)
sys-libs/libcxx-5.0.1 (!libcxxrt ? >=sys-devel/gcc-4.7[cxx])
virtual/fortran-0 (sys-devel/gcc[fortran,openmp?])



If I have libcxx install why do I need to gcc in the world as portage will sort it out. HOWEVER while my main gcc is 7.2 I have 6.4 explicitly installed for other reasons. Any automanagement of world shortlisting will result in this being removed.

So far the wiki variant produces the most conservative review of the world file that permit additional steps to ensure the file is not scrubbed to much
_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun Jan 21, 2018 8:14 pm    Post subject: Reply with quote

bunder's script is faster, but use an even rawer logic than charles's one

the added value from charles's script is that it doesn't make any assumption of result, but do test the real result of depclean.
the difference is that bunder's script assume "if a package is in world, and it have a dependency -> the package is protect from depclean : remove it from world"
but the script didn't check if that dependency itself have any protection, because the package is protect by the dependency ONLY if that dependency itself is protect.

Which mean (as a real example in my own system) "vlc" in world, and "qdepends result is media-plugins/npapi-vlc-2.0.0 (>=media-video/vlc-1.1)", bunder script will hint me to remove "vlc" from world.
But i don't have media-plugins/npapi-vlc in world, because i have install it to test it and i don't care about it ; while "vlc" is something i want keep.

You could update bunder's script with the depclean test and get a 100% functionality of charles's script (i didn't test, i just assume it should).

The difference of both script will came from first test: Is qdepends -Q X faster than equery d X?
On my system, looks like qdepends is the winner
Code:
time qdepends -Q vlc
media-plugins/npapi-vlc-2.0.0

real   0m0.014s
user   0m0.007s
sys   0m0.006s
time equery d vlc
media-plugins/npapi-vlc-2.0.0 (>=media-video/vlc-1.1)

real   0m2.921s
user   0m2.845s
sys   0m0.076s

It might still be worth to update charles's script to add the "else echo keep it in world" over the qdepends test, or remove any "keep it in world" phrase from it to only keep the "remove it from world" ; for output clarity.
Back to top
View user's profile Send private message
Mr. T.
Guru
Guru


Joined: 26 Dec 2016
Posts: 477

PostPosted: Mon Jan 22, 2018 7:51 am    Post subject: Reply with quote

The thread progresses in spiral with frequent unnecessary and abusive repetitions.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum