From e2a83bc61922bcdd03d2e752cfd3bb33c7b292ec Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Mon, 27 Oct 2025 10:50:57 +0800 Subject: [PATCH] fix csh support (cherry picked from commit 73124da2ae5d3795bae124d88e3da125d41a72c4) --- perl-homedir.csh | 17 ++++++++++------- perl-local-lib.spec | 12 ++++++++---- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/perl-homedir.csh b/perl-homedir.csh index 0e6e35a..1c7dc49 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 + eval `sed -ne 's|^[[:blank:]]*\([^#=]\{1,\}\)=\([^=]*\)|setenv \1 \2;|p' /etc/sysconfig/perl-homedir` +endif +if (-f "$HOME/.perl-homedir") then + eval `sed -ne 's|^[[:blank:]]*\([^#=]\{1,\}\)=\([^=]*\)|setenv \1 \2;|p' "$HOME/.perl-homedir"` +endif -alias perlll="eval `perl -Mlocal::lib`" +alias perlll 'eval "`env SHELL=csh perl -Mlocal::lib`"' # if system default -if [ "x$PERL_HOMEDIR" = "x1" ] ; then - - eval `perl -Mlocal::lib` -fi +if ("x$PERL_HOMEDIR" == "x1") then + eval "`env SHELL=csh perl -Mlocal::lib`" +endif diff --git a/perl-local-lib.spec b/perl-local-lib.spec index d5205bf..45e7827 100644 --- a/perl-local-lib.spec +++ b/perl-local-lib.spec @@ -1,6 +1,6 @@ Name: perl-local-lib Version: 2.000029 -Release: 1 +Release: 2 %define pkg_name local-lib License: GPL+ or Artistic Group: Development/Libraries @@ -62,6 +62,7 @@ to a module of theirs that you need for your application. Group: Development/Libraries Summary: Automatically setup user $HOME Requires: %{name} = %{version}-%{release} +Requires: sed %description -n perl-homedir perl-homedir automatically create a ~/perl5 directory in user's $HOME when user login. @@ -88,11 +89,14 @@ install -pm0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d/ %{_sysconfdir}/profile.d/* %changelog -* Tue Jul 18 2023 renhongxun - 2.000029 - 1 +* Sat Oct 25 2025 Funda Wang - 2.000029-2 +- fix csh support + +* Tue Jul 18 2023 renhongxun - 2.000029-1 - upgrade version to 2.000029 -* Tue Jan 14 2020 openEuler Buildteam - 2.000024 - 2 +* Tue Jan 14 2020 openEuler Buildteam - 2.000024-2 - Fix build dependence -* Mon Aug 26 2019 openEuler Buildteam - 2.000024 - 1 +* Mon Aug 26 2019 openEuler Buildteam - 2.000024-1 - Package Init -- Gitee