1 |
Harm Geerts posted <200511022259.51970.harmgeerts@××××.nl>, excerpted |
2 |
below, on Wed, 02 Nov 2005 22:59:51 +0100: |
3 |
|
4 |
> On Wednesday 02 November 2005 21:54, Duncan wrote: |
5 |
>> Hmm... That --noreplace is a new one on me. I normally simply |
6 |
>> |
7 |
>> echo <category/pkg> >> /var/lib/portage/world |
8 |
>> |
9 |
>> Newer versions of portage (don't believe it's in stable portage yet) even |
10 |
>> have an emaint command that removes the bad lines for you. |
11 |
> |
12 |
> So did I, but now the warning `emerge depclean` produces tells me I can use |
13 |
> this. I find this rather nice as it is a lot safer and keeps the world file |
14 |
> free from user errors. For example replacing >> with > would be the most |
15 |
> destructive user error :P |
16 |
> I have portage 2.0.53_rc7 installed and I'm not sure which version introduced |
17 |
> --noreplace so it might not be available for everyone yet. |
18 |
|
19 |
I'm still on rc6, so I guess I need to sync and emerge -uD world. |
20 |
However, it's probably in rc6 too, only I didn't notice it in the warning |
21 |
(<sheepish> as I don't read it as I know what the warning is about... only |
22 |
they added something! </sheepish>). |
23 |
|
24 |
Not here, forgetting the second > in >> wouldn't be destructive! I think |
25 |
this hint was featured in GWN a while back (yes, it was, comments are good |
26 |
things! =8^): |
27 |
|
28 |
-- snip -- |
29 |
|
30 |
# Based on a tips & tricks GWN feature. |
31 |
# Makes redirection to an existing file an error. |
32 |
# Use >> instead of > to append, or >| if overwriting is desired. |
33 |
set -o noclobber |
34 |
|
35 |
-- snip -- |
36 |
|
37 |
Put that in your .bashrc or whatever (my /etc/profile and .bashrc and all |
38 |
that are rather seriously customized, here, it's a file called |
39 |
noclobber.sh in /etc/profile.d/, but my bashrcs and profiles source |
40 |
everything in /etc/profile.d/ so it's added to them). |
41 |
|
42 |
That way, using > to redirect to an existing file produces an error saying |
43 |
it already exists. The comment gives the solution, use >> to append, or |
44 |
use >| to force-overwrite the file. |
45 |
|
46 |
So... "echo whatever > /var/lib/portage/world" would NOT "be the end of my |
47 |
world" here! (double entendre/entente) |
48 |
|
49 |
-- |
50 |
Duncan - List replies preferred. No HTML msgs. |
51 |
"Every nonfree program has a lord, a master -- |
52 |
and if you use the program, he is your master." Richard Stallman in |
53 |
http://www.linuxdevcenter.com/pub/a/linux/2004/12/22/rms_interview.html |
54 |
|
55 |
|
56 |
-- |
57 |
gentoo-amd64@g.o mailing list |