View previous topic :: View next topic |
Author |
Message |
devsk Advocate


Joined: 24 Oct 2003 Posts: 3003 Location: Bay Area, CA
|
Posted: Sat May 31, 2008 7:48 pm Post subject: |
|
|
Do you ever wonder why portage allows unmerging of programs (say python, coreutils, bash etc.) which it needs to run itself? It should not directly (i.e. from the command line) allow to unmerge packages that it needs for its operation, which I think is a small subset of 'system'. A warning is not enough. It JUST shouldn't be allowed.
If unmerge support for those packages is needed for some corner cases, it should be allowed only with a --force-i_am_elite_let_me_shoot_myself flag. |
|
Back to top |
|
 |
GlenCollins n00b

Joined: 11 Apr 2006 Posts: 53 Location: Australia
|
Posted: Mon Jun 02, 2008 1:16 pm Post subject: |
|
|
Just noted there's a lot of posts in here but not enough thanks for desultory for his excellent post.
This post (and some after) helped me a great deal. Although I had to create $PKDIR directory, even in the default location as it didn't exist (Gentoo manual still helpful to this day )
I had one more weird thing, when rebooting I had Code: | /bin/mktemp: No such file or directory | and depscan.sh errors. This was when any init.d scripts tried to be run (e.g. net.eth0!), but emerge of coreutils (although already done as per desultory's instructions) solved this.
Thanks again desultory. |
|
Back to top |
|
 |
audiodef Watchman


Joined: 06 Jul 2005 Posts: 6656 Location: The soundosphere
|
|
Back to top |
|
 |
gforum Tux's lil' helper


Joined: 31 Mar 2008 Posts: 140
|
Posted: Sun Jul 27, 2008 4:10 am Post subject: |
|
|
i had the same issue and fixed it through getting the bin and untaring it.
but maybe i didnt really get things strait, so i ask.
->
is now mktemp a part of coreutils?
as in... this issue is fixed?
cause im running fine without it i believe, all i got is coreutils. or so it seems... |
|
Back to top |
|
 |
desultory Bodhisattva


Joined: 04 Nov 2005 Posts: 9410
|
Posted: Sun Jul 27, 2008 5:05 am Post subject: |
|
|
gforum wrote: | is now mktemp a part of coreutils? | Yes.
gforum wrote: | as in... this issue is fixed? | It was only broken in the sense of not being properly documented before it propagated to users, as such it is now fixed. |
|
Back to top |
|
 |
rogerx Tux's lil' helper


Joined: 06 Apr 2004 Posts: 118
|
Posted: Fri Dec 26, 2008 1:25 am Post subject: |
|
|
You can easily fix an unmerged coreutils by rebooting with the install or minimal cd.
Obtain a binary built coreutils (either from your system if you build binaries -- set in make.conf or from the stage tarballs)
Mount your system on /mnt/gentoo
Simply untar coreutils designating from the root folder of your system (/mnt/gentoo) or by using the tar directory flag.
Reboot and everything should work again. It would be wise at this point to re-emerge coreutils as manually doing the above does not record into world. _________________ Roger
http://rogerx.freeshell.org/ |
|
Back to top |
|
 |
Captain Newbie Apprentice


Joined: 22 Dec 2006 Posts: 182 Location: Socal
|
Posted: Fri Dec 26, 2008 7:15 am Post subject: |
|
|
devsk wrote: | Do you ever wonder why portage allows unmerging of programs (say python, coreutils, bash etc.) which it needs to run itself? It should not directly (i.e. from the command line) allow to unmerge packages that it needs for its operation, which I think is a small subset of 'system'. A warning is not enough. It JUST shouldn't be allowed |
Saying that the operator doesn't know best is a bad idea, even if the operator doesn't know best.
While falling on one's sword with emerge -C sucks, it's almost always a good learning experience (if only for What Not To Do). Unmerging Python can be perfectly valid (i.e. upgrading 2.4->2.5)...
Quote: | If unmerge support for those packages is needed for some corner cases, it should be allowed only with a --force-i_am_elite_let_me_shoot_myself flag. |
There is already one - I_KNOW_WHAT_I_AM_DOING (set in the developer profiles) - although I don't think it's designed to prevent (or permit) emerge -C coreutils. And besides...some users, thinking they're $DEITY, enable it anyway, thereby defeating the purpose of having it. _________________ /* Nobody will ever see this message */
panic("Cannot initialize video hardware\n");
"As much as it pains me, we hope that developers know what they're doing." - wolf31o2 |
|
Back to top |
|
 |
desultory Bodhisattva


Joined: 04 Nov 2005 Posts: 9410
|
Posted: Fri Dec 26, 2008 8:16 am Post subject: |
|
|
Captain Newbie wrote: | There is already one - I_KNOW_WHAT_I_AM_DOING (set in the developer profiles) - although I don't think it's designed to prevent (or permit) emerge -C coreutils. | Indeed, it mostly reduces warning messages. |
|
Back to top |
|
 |
rogerx Tux's lil' helper


Joined: 06 Apr 2004 Posts: 118
|
Posted: Fri Dec 26, 2008 9:21 am Post subject: |
|
|
Yea. Gotta luv that 5 second warning after typing "emerge -C coreutils"!!!
In order to remove Portage's depends, should be a "--force" switch & the warning (w/o using --force switch) should state something like "In order to remove (coreutils), use the --force switch".
From here, if the admin always uses --force, it's his own d*rn fault!!
Other then this, I LOL @ the 5 second warning when typing "emerge -C coreutils". Absolutely hilarious!! _________________ Roger
http://rogerx.freeshell.org/ |
|
Back to top |
|
 |
Captain Newbie Apprentice


Joined: 22 Dec 2006 Posts: 182 Location: Socal
|
Posted: Fri Dec 26, 2008 5:15 pm Post subject: |
|
|
desultory wrote: | Indeed, it mostly reduces warning messages. |
That's what I gathered.
For those of you who are asleep at the switch (it happens!) :
Code: | dwhitese@annika ~ $ emerge -pC coreutils
>>> These are the packages that would be unmerged:
!!! 'sys-apps/coreutils' is part of your system profile.
!!! Unmerging it may be damaging to your system.
... |
I don't think it could possibly get any more clear than that - although it's probably a bit of an understatement, red text (if you're on a color terminal) and three '!'s is pretty clear. _________________ /* Nobody will ever see this message */
panic("Cannot initialize video hardware\n");
"As much as it pains me, we hope that developers know what they're doing." - wolf31o2 |
|
Back to top |
|
 |
rogerx Tux's lil' helper


Joined: 06 Apr 2004 Posts: 118
|
Posted: Fri Dec 26, 2008 8:05 pm Post subject: |
|
|
Hey. Isn't the number one rule when programming, assume users are dumb? As such, a good program adheres and provides errors detection.
Whomever noted this lacking, is right.
Cpt Newbie, you are right about the warning is clear enough. But Portage should protect removing it's depends due to admin naiveness.
Good programming practices dictate this well.
One thing I noted concerning implementing such a (--force) switch, Portage needs to distinguish between an upgrade (-u) of it's depends and removal (-C). And, provide the appropriate level of deterrence before one of it's dependencies are removed.
Think this is fact, and a bug should be filed. However, I have no time to take up the programming project.  _________________ Roger
http://rogerx.freeshell.org/ |
|
Back to top |
|
 |
Captain Newbie Apprentice


Joined: 22 Dec 2006 Posts: 182 Location: Socal
|
Posted: Fri Dec 26, 2008 9:06 pm Post subject: |
|
|
The real problem isn't so much that Portage should halt and refuse to do stupid things, but developer-user communication with respect to changes to system software could be improved (c.f. also: e2fsprogs-libs/com_err/ss stuff, which ~arch portage will handle automagically but stable portage will not, for instance). mktemp being obsoleted is the same sort of thing (in my view, anyway).
I wonder if it's possible to have some kind of news printed out about --update world following a sync that would alert users to changes in the tree like this. To me, that's a far more acceptable solution than kludging up emerge with training wheels. Reasoning:
(1) Nobody in their right minds manually types emerge -C coreutils (or rm -rf / ... etc.) except when trying to negotiate around a blocking package. Protecting the system from insane people would require the complete removal of root privileges.
(2) Changes to the system set causing blocking packages/other nastiness could be mentioned post-sync.
(3) If I remember correctly, newer Portages (unstable or masked, as yet) have automated block resolution to begin with. _________________ /* Nobody will ever see this message */
panic("Cannot initialize video hardware\n");
"As much as it pains me, we hope that developers know what they're doing." - wolf31o2 |
|
Back to top |
|
 |
rogerx Tux's lil' helper


Joined: 06 Apr 2004 Posts: 118
|
Posted: Fri Dec 26, 2008 10:33 pm Post subject: |
|
|
<shrugs> Bad things happen when a developer automatically assumes users know better!
Although I know better, I still did an emerge -C coreutils recently here. (Using ~arch portage, and maybe that's why I did it.) And, every now and then, I might get a nervous twitch on the carriage return key after typing "rm -rf ./*" and meant to type the additional keys to mean, "rm -rf ./*.log"
Good programs check for these obvious errors such as trying to remove Portage's depends. However, programs should still remain versatile in order not to hinder a user from performing tasks.
I do see you're point though (using rm -rf ./*). Many times we really do mean to type "rm -rf ./*", and we usually know better to "pwd" before typing. It would totally suck if "rm -rf ./*" popped-up a "Are You Sure?" gui click prompt! And, it would add additional bloat.
But, all in all, if Portage were my programing project, I would definitely protect my depends with an additional switch. But as you state, it would add too much bloat (and bloat == making code reading more difficult). _________________ Roger
http://rogerx.freeshell.org/ |
|
Back to top |
|
 |
|