Skip to content

Commit

Permalink
Merge pull request #9282 from cms-sw/crab-zsh
Browse files Browse the repository at this point in the history
Drop crab nosort option; fizes for zsh
  • Loading branch information
smuzaffar authored Jul 5, 2024
2 parents 0951a76 + 33e7d01 commit 1fb7532
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cms-common.spec
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### RPM cms cms-common 1.0
## REVISION 1234
## REVISION 1235
## NOCOMPILER

%define tag f1821e6c6953b601cb5501ced2125b15b65d6e26
%define tag 2f8b40d4907649b7cca9a7750bf6e57b7b1f195d
Source: git+https://github.com/cms-sw/cms-common.git?obj=master/%{tag}&export=%{n}-%{realversion}-%{tag}&output=/%{n}-%{realversion}-%{tag}.tgz

%prep
Expand Down
2 changes: 1 addition & 1 deletion crab-build.file
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ for pkg in %{crabserver_packages} ; do
done

#complete command in crab-bash-completion.sh should match '^\s*complete\s+-F\s+.*\s<Crab-function-Name>\s.*\scrab\s*$'
COMPLETE_CMD=$(grep '^\s*complete\s\s*-F\s' %{i}/etc/crab-bash-completion.sh | grep '\scrab\s*$')
COMPLETE_CMD=$(grep '^\s*complete\s\s*-F\s' %{i}/etc/crab-bash-completion.sh | grep '\scrab\s*$' | sed 's|-o\s\s*nosort||')
if [ "${COMPLETE_CMD}" != "" ] ; then
CRAB_FUNC=$(echo "${COMPLETE_CMD}" | sed 's|^.*\s-F\s\s*||;s|\s.*||')
sed -i -e 's|^\s*complete\s\s*-F\s.*$|@COMPLETE_CMD@|' %{i}/etc/crab-bash-completion.sh
Expand Down
2 changes: 1 addition & 1 deletion crab-dev.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#For new crabclient_version, set the version_suffix to 00
#For any other change, increment version_suffix
##########################################
%define version_suffix 00
%define version_suffix 01
%define crabclient_version v3.240621
### RPM cms crab-dev %{crabclient_version}.%{version_suffix}
%define crabserver_version v3.240527
Expand Down
2 changes: 1 addition & 1 deletion crab-pre.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#For new crabclient_version, set the version_suffix to 00
#For any other change, increment version_suffix
##########################################
%define version_suffix 01
%define version_suffix 02
%define crabclient_version v3.240416
### RPM cms crab-pre %{crabclient_version}.%{version_suffix}
%define crabserver_version v3.240325
Expand Down
2 changes: 1 addition & 1 deletion crab-prod.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#For new crabclient_version, set the version_suffix to 00
#For any other change, increment version_suffix
##########################################
%define version_suffix 00
%define version_suffix 01
%define crabclient_version v3.240621
### RPM cms crab-prod %{crabclient_version}.%{version_suffix}
%define crabserver_version v3.240527
Expand Down
6 changes: 3 additions & 3 deletions crab/crab-env.sh.file
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash
#CMSDIST_FILE_REVISION=3
#CMSDIST_FILE_REVISION=4
cms_basedir="@CMS_PATH@/share/cms"
crab_shared_dir="${cms_basedir}/crab/@CRAB_COMMON_VERSION@"
for crab_latest in $(ls ${crab_shared_dir}/etc/crab-*.latest 2>/dev/null) ; do
crab_type=$(basename ${crab_latest} | sed 's|.latest$||;s|^crab-||')
crab_version=$(cat ${crab_latest})
if [ -e ${cms_basedir}/crab-${crab_type}/${crab_version}/etc/crab-bash-completion.sh ]; then
if [ "$(ps -p$$ -ocmd=)" = "zsh" ] ; then
autoload -U +X compinit && compinit
if [[ $(ps -p$$ --no-headers -o cmd | cut -d' ' -f1) =~ ^.*zsh$ ]] ; then
autoload -U +X compinit && compinit -u
autoload -U +X bashcompinit && bashcompinit
fi
source ${cms_basedir}/crab-${crab_type}/${crab_version}/etc/crab-bash-completion.sh >/dev/null 2>&1
Expand Down

0 comments on commit 1fb7532

Please sign in to comment.