[perl-local-lib/f17] Fix CSH support

Petr Pisar ppisar at fedoraproject.org
Mon Aug 20 10:49:55 UTC 2012


commit 68f04a0ac9d151a8fb3ca5ff723ad9fc0b8044cf
Author: Petr Písař <ppisar at redhat.com>
Date:   Mon Aug 20 11:27:24 2012 +0200

    Fix CSH support

 ...l-lib-1.008004-Append-semicolon-to-setenv.patch |   27 ++++++++++++++++++++
 perl-homedir.csh                                   |   17 +++++++-----
 perl-local-lib.spec                                |   10 ++++++-
 3 files changed, 45 insertions(+), 9 deletions(-)
---
diff --git a/local-lib-1.008004-Append-semicolon-to-setenv.patch b/local-lib-1.008004-Append-semicolon-to-setenv.patch
new file mode 100644
index 0000000..3cee543
--- /dev/null
+++ b/local-lib-1.008004-Append-semicolon-to-setenv.patch
@@ -0,0 +1,27 @@
+From 0bcf85f024efcb8067bad99c7e9b7dee64ff7edf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at 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
+
diff --git a/perl-homedir.csh b/perl-homedir.csh
index e85b9df..ef7ad3b 100644
--- a/perl-homedir.csh
+++ b/perl-homedir.csh
@@ -4,14 +4,17 @@
 setenv PERL_HOMEDIR 1
 
 # load our configs, aka opportunities to set PERL_HOMEDIR=0
-[ -f /etc/sysconfig/perl-homedir ] && . /etc/sysconfig/perl-homedir
-[ -f $HOME/.perl-homedir         ] && . $HOME/.perl-homedir
+if (-f /etc/sysconfig/perl-homedir) then
+	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 [ "x$PERL_HOMEDIR" = "x1" ] ; then
-
-    eval `perl -Mlocal::lib`
-fi
+if ("x$PERL_HOMEDIR" == "x1") then
+	eval `perl -Mlocal::lib`
+endif
 
diff --git a/perl-local-lib.spec b/perl-local-lib.spec
index 88a6a78..098c81d 100644
--- a/perl-local-lib.spec
+++ b/perl-local-lib.spec
@@ -1,11 +1,13 @@
 Name:       perl-local-lib
 Version:    1.008004
-Release:    4%{?dist}
+Release:    5%{?dist}
 # lib/local/lib.pm -> GPL+ or Artistic
 License:    GPL+ or Artistic
 Group:      Development/Libraries
 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
+# 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
 Requires:   perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
 BuildArch:  noarch
@@ -56,7 +58,7 @@ Requires:   /usr/bin/cpan
 %description -n perl-homedir
 perl-homedir configures the system to automatically create a ~/perl5
 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.
 
 If you want your users to be able to install and use their own Perl modules,
@@ -64,6 +66,7 @@ install this package.
 
 %prep
 %setup -q -n local-lib-%{version}
+%patch0 -p1
 
 %build
 %{__perl} Makefile.PL INSTALLDIRS=vendor
@@ -92,6 +95,9 @@ make test
 %{_sysconfdir}/profile.d/*
 
 %changelog
+* Mon Aug 20 2012 Petr Pisar <ppisar at redhat.com> - 1.008004-5
+- Fix CSH support (bug #849609)
+
 * Fri Feb 10 2012 Iain Arnell <iarnell at gmail.com> 1.008004-4
 - avoid creating ~/perl5/ for all users (rhbz#789146)
 - drop defattr in files lists


More information about the scm-commits mailing list