Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Que pastas ou seu conteúdo podem ser apagadas
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Portuguese
View previous topic :: View next topic  
Author Message
penicho
n00b
n00b


Joined: 14 Feb 2004
Posts: 3
Location: Lisbon

PostPosted: Tue Feb 17, 2004 11:22 pm    Post subject: Que pastas ou seu conteúdo podem ser apagadas Reply with quote


Boas!!

Depois de instalar o sistema operativo deparei-me com falta de espaço em disco.
A partição onde está instalado o sistema tem 2,5GBytes e apenas me restaram 300MB.

Que pastas é posso limpar? :(
Back to top
View user's profile Send private message
RoadRunner
Bodhisattva
Bodhisattva


Joined: 12 Jun 2002
Posts: 490
Location: Coimbra, Portugal

PostPosted: Wed Feb 18, 2004 12:06 am    Post subject: Reply with quote

/var/tmp e a /tmp podem ser apagadas.. Mas não deve resolver muito uma vez que a partição é pequena.
Back to top
View user's profile Send private message
nafre
Guru
Guru


Joined: 27 Dec 2003
Posts: 388

PostPosted: Wed Feb 18, 2004 12:53 am    Post subject: Reply with quote

limpa o diretorio distfile

Code:
rm -rf /usr/portage/distfile/





OFFTOPIC: Repararam a minha assinatura a idade mudou :)
_________________
Nome- Felipe
Nick- Nafre
Idade- 25
Salvador - Bahia - Brasil
Back to top
View user's profile Send private message
jbrazio
Apprentice
Apprentice


Joined: 13 Dec 2002
Posts: 232
Location: .pt

PostPosted: Wed Feb 18, 2004 1:03 am    Post subject: Reply with quote

Já agora..
Code:
rm -rf /usr/portage/packages/

_________________
"Assim como falham as palavras quando querem exprimir qualquer
pensamento, assim falham os pensamentos quando querem exprimir
qualquer realidade." -- Fernando Pessoa
Back to top
View user's profile Send private message
penicho
n00b
n00b


Joined: 14 Feb 2004
Posts: 3
Location: Lisbon

PostPosted: Wed Feb 18, 2004 2:38 am    Post subject: Reply with quote

Thanks for ALL.
Back to top
View user's profile Send private message
Enderson
Retired Dev
Retired Dev


Joined: 12 Nov 2003
Posts: 141
Location: Arapiraca/Maceió, AL, Brazil

PostPosted: Wed Feb 18, 2004 3:10 pm    Post subject: Reply with quote

Se você procurar no forum você pode achar us script queazem uma limpexa "segura",
e apaga somente os distfiles com versões diferentes, deixando somente as versões atuais
instaladas, para um possível rebuild ou ualquer coisa.
_________________
--
Nothing to say here!
Back to top
View user's profile Send private message
jbrazio
Apprentice
Apprentice


Joined: 13 Dec 2002
Posts: 232
Location: .pt

PostPosted: Wed Feb 18, 2004 8:27 pm    Post subject: Reply with quote

Aonde andam eles ?
_________________
"Assim como falham as palavras quando querem exprimir qualquer
pensamento, assim falham os pensamentos quando querem exprimir
qualquer realidade." -- Fernando Pessoa
Back to top
View user's profile Send private message
nafre
Guru
Guru


Joined: 27 Dec 2003
Posts: 388

PostPosted: Wed Feb 18, 2004 9:02 pm    Post subject: Reply with quote

jbrazio wrote:
Aonde andam eles ?

Se acostuma não!
Em cima da página só é vc procurar :twisted:

Code:
#!/usr/bin/env python
import sys
import re
import string
import os
import os.path
import commands
import getopt

make_conf = {}
make_conf['PORTDIR'] = '/usr/portage'
make_conf['DISTDIR'] = '/usr/portage/distfiles'

def read_make_conf(make_conf):
    file = open('/etc/make.conf', 'r')
    while 1:
        line = file.readline()
        if line == '':
            break
        match = re.search('^\s*(\w+)=(.+)$', line)
        if match != None:
            make_conf[match.group(1)] = match.group(2)
    file.close()

    for var, value in make_conf.items():
        while 1:
            match = re.search('"?\$\{(\w+)\}"?', make_conf[var])
            if match == None:
                break
            make_conf[var] = re.sub('"?\$\{' + match.group(1) + '\}"?',
                                    make_conf[match.group(1)],
                                    value)
    return make_conf

opt_p = 0
try:
    if len(sys.argv) > 1:
        opt_p = getopt.getopt(sys.argv[1:], "p")[0][0][0] == '-p'
except getopt.GetoptError:
    print "oj!"
    pass

make_conf = read_make_conf(make_conf)
           
print 'PORTDIR =', make_conf['PORTDIR']
print 'DISTDIR =', make_conf['DISTDIR']
if make_conf.has_key('PORTDIR_OVERLAY'):
    print 'PORTDIR_OVERLAY =', make_conf['PORTDIR_OVERLAY']
else:
    print 'PORTDIR_OVERLAY ='
   
files = {}
status, packages = commands.getstatusoutput('qpkg -v -I -nc')
if status != 0:
    sys.exit("Can't list packages\n")
for package in string.split(packages):
    match = re.search('(.*)/(.*)-(\d.*)', package)
    category, program, version = match.group(1, 2, 3)
    digest_suffix = ('/' + category
                     + '/' + program + '/files/digest-' + program
                     + '-' + version)
    digest = make_conf['PORTDIR'] + digest_suffix
    if (make_conf.has_key('PORTDIR_OVERLAY')
        and (not os.path.isfile(digest))):
        digest = make_conf['PORTDIR_OVERLAY'] + digest_suffix
    if os.path.isfile(digest):
        file = open(digest, 'r')
        while 1:
            line = file.readline()
            if line == '':
                break
            fields = string.split(line)
            if len(fields) == 4:
                [hashtype, hash, filename, size] = fields
                files[filename] = 1
        file.close()

if len(files.keys()) == 0:
    sys.exit("sanity check: no package files found.  This can't be right.\n")

try:
    list = os.listdir(make_conf['DISTDIR'])
except os.OSError:
    sys.exit("can't open " + make_conf['DISTDIR'])

for file in list:
    abs_file = make_conf['DISTDIR'] + '/' + file
    if (os.path.isfile(abs_file) and (not os.path.islink(abs_file))
        and (not (files.has_key(file) and files[file]))):
        if opt_p:
            print 'Would erase', abs_file
        else:
            os.remove(abs_file)

Code:
#!/usr/bin/perl -w
use strict;

my $lastname = 0;
my $lastversion;
my $lastext;
my @stalefiles;
my @files;

# Insert your exclusions here with trailing '-'
my %maskedfiles = (
   'X420src-' => 1,
   'gcc-' => 1,
   'freetype-' => 1
);

# Root check
if ($< != 0) {
   print "You must be root to run this script.\n";
   exit 0;
}

# Determine sources present on the system
print "Determining available tarballs in /usr/portage/distfiles ...\n";
opendir(DIR, "/usr/portage/distfiles");
@files = sort(readdir(DIR));
closedir(DIR);

# Grab names/versions, checking each time whether current distfile
# has been superceded. Push anonymous array ref containing required
# info into @stalefiles array.
print "Determining stale versions ...\n";
foreach (@files) {
   my $name;
   my $version;
   # Only operate on tarballs   
   if (/(.+?\-)([0-9r\.\-]+)(\.tar\.gz|\.tgz|\.tar.bz2)/s) {
      $name = $1;
      $version = $2;
      next if ($maskedfiles{$name}); # Ignore "masked" files
      if ($lastname && $name eq $lastname) {
         if ($version gt $lastversion) {
            push (@stalefiles, [$name, $version, $lastversion, $lastext]);
         }
      }
      $lastname = $name;
      $lastversion = $version;
      $lastext = $3;
   }
}

if (@stalefiles == 0) {
   print "\nNo stale distfiles have been detected on your system!\n";
   exit 0;
}

if ($ARGV[0] && $ARGV[0] eq '--nopretend') {
   # User requested deletion so here goes ...
   print "*Nopretend* mode, deleting stale files:\n\n";
   foreach (@stalefiles) {
      my ($name, $version, $lastversion, $ext) = @{$_};
      unlink('/usr/portage/distfiles/' . $name . $lastversion . $ext);
      print "Deleted: $name$lastversion in favour of $name$version\n";
   }
}
else
{
   # Safe mode (default)!
   print "\7*Pretend* mode, will only pretend to delete files.\nTo actually delete the files, reinvoke with the --nopretend parameter.\n\n";
   foreach (@stalefiles) {
      my ($name, $version, $lastversion, $ext) = @{$_};
      print "Would delete: $name$lastversion in favour of $name$version\n";
   }
}
1;


Duas versões em python e em perl :)
_________________
Nome- Felipe
Nick- Nafre
Idade- 25
Salvador - Bahia - Brasil
Back to top
View user's profile Send private message
jbrazio
Apprentice
Apprentice


Joined: 13 Dec 2002
Posts: 232
Location: .pt

PostPosted: Wed Feb 18, 2004 11:31 pm    Post subject: Reply with quote

Thanks, I'll give them a try.
_________________
"Assim como falham as palavras quando querem exprimir qualquer
pensamento, assim falham os pensamentos quando querem exprimir
qualquer realidade." -- Fernando Pessoa
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portuguese All times are GMT
Page 1 of 1

 
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