From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 83D1013857C for ; Sat, 19 Jan 2013 21:43:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8C1A921C0AA; Sat, 19 Jan 2013 21:43:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E3D1421C0AA for ; Sat, 19 Jan 2013 21:43:38 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BE51B33DAC8 for ; Sat, 19 Jan 2013 21:43:37 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 3D038E408F for ; Sat, 19 Jan 2013 21:43:35 +0000 (UTC) From: "Sven Eden" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Eden" Message-ID: <1358494437.daeca639017e2f78ab7a8f3e7abca8cca4e5ce8d.yamakuzure@gentoo> Subject: [gentoo-commits] proj/ufed:master commit in: / X-VCS-Repository: proj/ufed X-VCS-Files: Portage.pm X-VCS-Directories: / X-VCS-Committer: yamakuzure X-VCS-Committer-Name: Sven Eden X-VCS-Revision: daeca639017e2f78ab7a8f3e7abca8cca4e5ce8d X-VCS-Branch: master Date: Sat, 19 Jan 2013 21:43:35 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 530cb32c-cd8c-411c-8ee4-39641758b613 X-Archives-Hash: e84ab9cb3c14bb9f92d7f736b9f980a9 commit: daeca639017e2f78ab7a8f3e7abca8cca4e5ce8d Author: Sven Eden gmx de> AuthorDate: Fri Jan 18 07:33:57 2013 +0000 Commit: Sven Eden gmx de> CommitDate: Fri Jan 18 07:33:57 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=daeca639 Eventually removed the two remaining prototypes. Their usage is, even like this, is deprecated for ages now, and simply not reliable. --- Portage.pm | 51 ++++++++++++++++++++++++++------------------------- 1 files changed, 26 insertions(+), 25 deletions(-) diff --git a/Portage.pm b/Portage.pm index 2caed7d..5b9b233 100644 --- a/Portage.pm +++ b/Portage.pm @@ -23,8 +23,8 @@ our $eprefix; sub get_eprefix; sub have_package; -sub merge(\%%); -sub merge_env(\%); +sub merge; +sub merge_env; sub noncomments; sub norm_path; sub read_archs; @@ -48,10 +48,10 @@ read_archs; my $lastorder; for(reverse split /:/, $environment{USE_ORDER} || "env:pkg:conf:defaults:pkginternal:env.d") { if($_ eq 'defaults') { - merge(%default_flags, %make_defaults_flags); - merge(%all_flags, %make_defaults_flags); + merge(\%default_flags, \%make_defaults_flags); + merge(\%all_flags, \%make_defaults_flags); } elsif($_ eq 'conf') { - merge(%all_flags, %make_conf_flags); + merge(\%all_flags, \%make_conf_flags); } else { next; } @@ -95,38 +95,38 @@ sub have_package { # merges two hashes into the first. -# Parameter 1: destination hash -# Parameter 2: source hash -sub merge(\%%) { - my ($env, %env) = @_; - %{$env} = () if(exists $env{'*'}); - $env->{$_} = $env{$_} for(keys %env); +# Parameter 1: reference of the destination hash +# Parameter 2: reference of the source hash +sub merge { + my ($dst, $src) = @_; + %{$dst} = () if(exists $src->{'*'}); + $dst->{$_} = $src->{$_} for(keys %$src); return; } # Splits content of the source hash at spaces and # merges its contents into %environment. -# Parameter 1: hash to merge -sub merge_env(\%) { - my ($env) = @_; +# Parameter 1: reference of the hash to merge +sub merge_env { + my ($src) = @_; for(keys %environment) { if(ref $environment{$_} eq 'HASH') { - if(exists $env->{$_}) { + if(exists $src->{$_}) { my %split; - for(split ' ', $env->{$_}) { + for(split ' ', $src->{$_}) { my $off = s/^-//; %split = () if($_ eq '*'); $split{$_} = !$off; } - $env->{$_} = { %split }; - merge(%{$environment{$_}}, %{$env->{$_}}); + $src->{$_} = { %split }; + merge(\%{$environment{$_}}, \%{$src->{$_}}); } } } - for(keys %$env) { + for(keys %$src) { if(ref $environment{$_} ne 'HASH') { - $environment{$_} = $env->{$_}; + $environment{$_} = $src->{$_}; } } return; @@ -195,9 +195,10 @@ sub read_archs { # in @portagedirs. # No parameters accepted. sub read_make_conf { - my %env = read_sh "$eprefix/etc/make.conf"; - merge (%env, read_sh("$eprefix/etc/portage/make.conf")); - merge (%make_conf_flags, %{$env{USE}}) if exists $env{USE}; + my %oldEnv = read_sh("$eprefix/etc/make.conf"); + my %newEnv = read_sh("$eprefix/etc/portage/make.conf"); + merge (\%oldEnv, \%newEnv); + merge (\%make_conf_flags,\ %{$oldEnv{USE}}) if exists $oldEnv{USE}; @portagedirs = $environment{PORTDIR}; push @portagedirs, split ' ', $environment{PORTDIR_OVERLAY} if defined $environment{PORTDIR_OVERLAY}; return; @@ -210,7 +211,7 @@ sub read_make_conf { sub read_make_defaults { for my $dir(@profiles) { my %env = read_sh "$dir/make.defaults"; - merge (%make_defaults_flags, %{$env{USE}}) if exists $env{USE}; + merge (\%make_defaults_flags, \%{$env{USE}}) if exists $env{USE}; } return } @@ -384,7 +385,7 @@ sub read_sh { }; die "Parse error in $fname\n" if $@; } - merge_env(%env); + merge_env(\%env); return %env if wantarray; return; }