5c5 < # $Header: /var/cvsroot/gentoo-src/ufed/ufed.pl,v 1.19 2004/06/03 04:58:49 fava Exp $ --- > # $Header: /home/cvsroot/gentoo-src/ufed/ufed.pl,v 1.18 2003/08/11 04:44:03 fava Exp $ 513c513,532 < open(FILE, '/etc/make.profile/use.defaults') or die ('couldn\'t open ' . "use.defaults"); --- > my $tmppath; > my @tmpitem; > my @items; > my $path; > #open(FILE, '/etc/make.profile/use.defaults') or die ('couldn\'t open ' . "use.defaults"); > $path = readlink '/etc/make.profile'; > $path =~ s!\.\.!!; > @items = split /\//, $path ; > while(@items) > { > $tmppath = join '/', @items ; > if (open(FILE1,$tmppath . "/use.defaults")) > { > while () > { > s!#.*!!; > ($flag, $package) = split (m![\t ]+!); > $flag =~ s![ \t]!!g; > $package =~ s![ \t]!!g; > chomp($package); 515,521c534,541 < while () < { < s!#.*!!; < ($flag, $package) = split (m![\t ]+!); < $flag =~ s![ \t]!!g; < $package =~ s![ \t]!!g; < chomp($package); --- > if ((defined($package)) and my_glob("/var/db/pkg/$package")) > { > #the package exists, therefore we add the use flag > push (@flags, $flag); > } > } > close(FILE1); > } 523c543,544 < if ((defined($package)) and my_glob("/var/db/pkg/$package")) --- > open (FILE,$tmppath . '/parent') or last; > while () 525,527c546,559 < < #the package exists, therefore we add the use flag < push (@flags, $flag); --- > s!#.*!!; > s!\n!!g; > @tmpitem = split /\//, $_; > for my $buf (@tmpitem) > { > if ($buf =~ /\.\./) > { > pop @items; > } > else > { > push @items, $buf; > } > } 528a561 > close(FILE); 530d562 < close(FILE);