perl-configpm-switch.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From 7a48538a7e8614a3342151b646d2105c0cb0cdd9 Mon Sep 17 00:00:00 2001
  2. From: Alexander Kanavin <alex.kanavin@gmail.com>
  3. Date: Sun, 27 May 2007 21:04:11 +0000
  4. Subject: [PATCH] perl: 5.8.7 -> 5.8.8 (from OE)
  5. This patch is used for perl-native only. It enables the switching of
  6. configuration files between Config_heavy.pl and
  7. Config_heavy-target.pl by setting the environment variables
  8. PERLCONFIGTARGET - the later containing settings for the target while
  9. the former contains those for the host. This will allow cpan.bbclass
  10. to use the settings appropriate for the native and/or target builds
  11. as required. This also disables the use of the cache since the cached
  12. values would be valid for the host only.
  13. Upstream-Status: Inappropriate [native]
  14. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
  15. ---
  16. configpm | 18 ++++++++++++++++--
  17. 1 file changed, 16 insertions(+), 2 deletions(-)
  18. diff --git a/configpm b/configpm
  19. index 07219d8..01a23fa 100755
  20. --- a/configpm
  21. +++ b/configpm
  22. @@ -718,7 +718,7 @@ $config_txt .= uncomment <<'ENDOFEND';
  23. # my($self, $key) = @_;
  24. #
  25. # # check for cached value (which may be undef so we use exists not defined)
  26. -# return exists $self->{$key} ? $self->{$key} : $self->fetch_string($key);
  27. +# return $self->fetch_string($key);
  28. # }
  29. #
  30. ENDOFEND
  31. @@ -876,7 +876,21 @@ $config_txt .= sprintf uncomment <<'ENDOFTIE', $fast_config;
  32. # sub DESTROY { }
  33. #
  34. # sub AUTOLOAD {
  35. -# require 'Config_heavy.pl';
  36. +# my $cfgfile = 'Config_heavy.pl';
  37. +# if (defined $ENV{PERLCONFIGTARGET} and $ENV{PERLCONFIGTARGET} eq "yes")
  38. +# {
  39. +# $cfgfile = 'Config_heavy-target.pl';
  40. +# }
  41. +# if (defined $ENV{PERL_ARCHLIB})
  42. +# {
  43. +# push @INC, $ENV{PERL_ARCHLIB};
  44. +# require $cfgfile;
  45. +# pop @INC;
  46. +# }
  47. +# else
  48. +# {
  49. +# require $cfgfile;
  50. +# }
  51. # goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/;
  52. # die "&Config::AUTOLOAD failed on $Config::AUTOLOAD";
  53. # }