Fix CSH support

This commit is contained in:
Petr Písař 2012-08-20 11:27:24 +02:00
parent a22799c8a1
commit f0e34f9bcc
3 changed files with 45 additions and 9 deletions

View File

@ -0,0 +1,27 @@
From 0bcf85f024efcb8067bad99c7e9b7dee64ff7edf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Mon, 20 Aug 2012 11:32:32 +0200
Subject: [PATCH] Append semicolon to setenv
This allows to "eval `perl -Mlocal::lib`" in CSH.
<https://rt.cpan.org/Public/Bug/Display.html?id=60072>
---
lib/local/lib.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/local/lib.pm b/lib/local/lib.pm
index 87d1869..cef5ebf 100644
--- a/lib/local/lib.pm
+++ b/lib/local/lib.pm
@@ -333,7 +333,7 @@ sub build_bourne_env_declaration {
sub build_csh_env_declaration {
my $class = shift;
my($name, $value) = @_;
- return defined($value) ? qq{setenv ${name} "${value}"\n} : qq{unsetenv ${name}\n};
+ return defined($value) ? qq{setenv ${name} "${value}";\n} : qq{unsetenv ${name};\n};
}
sub build_win32_env_declaration {
--
1.7.11.4

View File

@ -4,14 +4,17 @@
setenv PERL_HOMEDIR 1 setenv PERL_HOMEDIR 1
# load our configs, aka opportunities to set PERL_HOMEDIR=0 # load our configs, aka opportunities to set PERL_HOMEDIR=0
[ -f /etc/sysconfig/perl-homedir ] && . /etc/sysconfig/perl-homedir if (-f /etc/sysconfig/perl-homedir) then
[ -f $HOME/.perl-homedir ] && . $HOME/.perl-homedir source /etc/sysconfig/perl-homedir
endif
if (-f "$HOME/.perl-homedir") then
source "$HOME/.perl-homedir"
endif
alias perlll='eval `perl -Mlocal::lib`' alias perlll 'eval `perl -Mlocal::lib`'
# if system default # if system default
if [ "x$PERL_HOMEDIR" = "x1" ] ; then if ("x$PERL_HOMEDIR" == "x1") then
eval `perl -Mlocal::lib`
eval `perl -Mlocal::lib` endif
fi

View File

@ -1,11 +1,13 @@
Name: perl-local-lib Name: perl-local-lib
Version: 1.008004 Version: 1.008004
Release: 9%{?dist} Release: 10%{?dist}
# lib/local/lib.pm -> GPL+ or Artistic # lib/local/lib.pm -> GPL+ or Artistic
License: GPL+ or Artistic License: GPL+ or Artistic
Group: Development/Libraries Group: Development/Libraries
Summary: Create and use a local lib/ for perl modules Summary: Create and use a local lib/ for perl modules
Source: http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-%{version}.tar.gz Source: http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-%{version}.tar.gz
# Allow evaluation in CSH, RHBZ #849609, CPAN RT #60072
Patch0: local-lib-1.008004-Append-semicolon-to-setenv.patch
Url: http://search.cpan.org/dist/local-lib Url: http://search.cpan.org/dist/local-lib
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
BuildArch: noarch BuildArch: noarch
@ -56,7 +58,7 @@ Requires: /usr/bin/cpan
%description -n perl-homedir %description -n perl-homedir
perl-homedir configures the system to automatically create a ~/perl5 perl-homedir configures the system to automatically create a ~/perl5
directory in each user's $HOME on user login. This allows each user to directory in each user's $HOME on user login. This allows each user to
install and CPAN packages via the CPAN to their $HOME, with no additional install CPAN packages via the CPAN to their $HOME, with no additional
configuration or privileges, and without installing them system-wide. configuration or privileges, and without installing them system-wide.
If you want your users to be able to install and use their own Perl modules, If you want your users to be able to install and use their own Perl modules,
@ -64,6 +66,7 @@ install this package.
%prep %prep
%setup -q -n local-lib-%{version} %setup -q -n local-lib-%{version}
%patch0 -p1
%build %build
%{__perl} Makefile.PL INSTALLDIRS=vendor %{__perl} Makefile.PL INSTALLDIRS=vendor
@ -92,6 +95,9 @@ make test
%{_sysconfdir}/profile.d/* %{_sysconfdir}/profile.d/*
%changelog %changelog
* Mon Aug 20 2012 Petr Pisar <ppisar@redhat.com> - 1.008004-10
- Fix CSH support (bug #849609)
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.008004-9 * Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.008004-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild