fluca1978 said:is there a smarter way to do a clean on the ports without having to specify every single port to clean?
# rm -rf /usr/ports/*/*/work
# make -C /usr/ports clean
Absolutely! But in some cases, especially after a major upgrade that went bad or if you follow experimental ports, you end up with leftovers.Dru said:Seems like
would be a lot simpler in the first place.Code:make install clean
No?
gkontos said:Absolutely! But in some cases, especially after a major upgrade that went bad or if you follow experimental ports, you end up with leftovers.
Now, I know that most people will disagree here. But what I usually do to clean my messy desktop ports is:
[CMD=""] # cd /usr/ports && rm -rf * && portsnap extract[/CMD]
I never do it on a server though
# touch Clean
# echo #\!/bin/sh > Clean
# echo set -x >> Clean
# echo >> Clean
# chmod +x Clean
# find /usr/ports -name work -type d | \
sed -e 's,/usr,cd /usr,g' \
-e 's,/work, \&\& make clean,g' >> Clean
# ./Clean
gkontos said:Absolutely! But in some cases, especially after a major upgrade that went bad or if you follow experimental ports, you end up with leftovers.
wblock@ said:Careful, that also gets rid of all the distfiles that have been downloaded.
# rm -rf /usr/ports/*
or even to combine the two into # cd /usr/ports/ && rm -rf /usr/ports/*
phoenix said:And it also has the potential to backfire and destroy the entire system if you mistype command or use & accidentally instead of &&. You should never use rm -rf and * together. Much better to write the command like# rm -rf /usr/ports/*
or even to combine the two into# cd /usr/ports/ && rm -rf /usr/ports/*
Or, if you really want to make things fast, put /usr/ports onto a separate filesystem, and just newfs(1) it to clear it.
# cd /usr/ports/ && rm -rf /usr/ports/*
does not solves the problem of a mispelled & (moreover the first command is useless). Finally having the ports on a separate filesystem resilvered each time sounds like a bit too much to me.New users that use (t)csh might want to do this:phoenix said:And it also has the potential to backfire and destroy the entire system if you mistype command or use & accidentally instead of &&. You should never use rm -rf and * together.
dice@molly:~/test>echo $SHELL
/bin/tcsh
dice@molly:~/test>touch test1
dice@molly:~/test>touch test2
dice@molly:~/test>touch test3
dice@molly:~/test>ll
total 0
-rw-r--r-- 1 dice dice 0 Dec 2 08:32 test1
-rw-r--r-- 1 dice dice 0 Dec 2 08:32 test2
-rw-r--r-- 1 dice dice 0 Dec 2 08:32 test3
dice@molly:~/test>rm *
dice@molly:~/test>
dice@molly:~/test>ll
total 0
dice@molly:~/test>touch test1
dice@molly:~/test>touch test2
dice@molly:~/test>touch test3
dice@molly:~/test>ll
total 0
-rw-r--r-- 1 dice dice 0 Dec 2 08:32 test1
-rw-r--r-- 1 dice dice 0 Dec 2 08:32 test2
-rw-r--r-- 1 dice dice 0 Dec 2 08:32 test3
dice@molly:~/test>set rmstar
dice@molly:~/test>rm *
Do you really want to delete all files? [n/y]
dice@molly:~/test>
portsclean -C
?JamesElstone said:What is wrong withportsclean -C
?
James.