mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
zsh: move zprofile and zshenv to additional-files.
This commit is contained in:
18
app-shells/zsh/additional-files/zprofile
Normal file
18
app-shells/zsh/additional-files/zprofile
Normal file
@@ -0,0 +1,18 @@
|
||||
# Emulate ksh as a walkaround for ksh-syntax within /etc/profile
|
||||
emulate ksh -c 'source /etc/profile'
|
||||
PS1="${PS1/'$PWD'/%~}"
|
||||
|
||||
# Migration path for users who rely on the old behavior
|
||||
(
|
||||
setopt EXTENDED_GLOB
|
||||
if [[ -n $ZDOTDIR && -z $ZDOTDIR/.z(login|logout|profile|shrc|shenv)(#qN) ]]; then
|
||||
for i in "$HOME/config/settings/zsh"/z(login|logout|profile|shrc|shenv)(#qN)
|
||||
do
|
||||
local target=$ZDOTDIR/.$(basename "$i")
|
||||
echo "Symlinking $i to $target..."
|
||||
ln -sv "$i" "$target"
|
||||
unset target
|
||||
done
|
||||
[[ -e $ZDOTDIR/.zshenv ]] && source $ZDOTDIR/.zshenv
|
||||
fi
|
||||
)
|
||||
5
app-shells/zsh/additional-files/zshenv
Normal file
5
app-shells/zsh/additional-files/zshenv
Normal file
@@ -0,0 +1,5 @@
|
||||
setopt EXTENDED_GLOB
|
||||
if [ -z ~/.z(login|logout|profile|shrc|shenv)(N) ]; then
|
||||
ZDOTDIR="$(finddir B_USER_SETTINGS_DIRECTORY)/zsh"
|
||||
fi
|
||||
unsetopt EXTENDED_GLOB
|
||||
@@ -13,6 +13,10 @@ CHECKSUM_SHA256="e1c38808fcbe0cc1344d55c9a758349f7ba1e317325b154621ac37eddac4aa8
|
||||
SOURCE_URI_2="https://downloads.sf.net/zsh/zsh-$portVersion-doc.tar.xz"
|
||||
CHECKSUM_SHA256_2="41ce13a89a6bc7e709b6f110e54288d59f02ba2becd2646895d28188d4dd6283"
|
||||
PATCHES="zsh-$portVersion.patchset"
|
||||
ADDITIONAL_FILES="
|
||||
zprofile
|
||||
zshenv
|
||||
"
|
||||
|
||||
ARCHITECTURES="x86_gcc2 ?x86 x86_64"
|
||||
|
||||
@@ -101,36 +105,13 @@ INSTALL()
|
||||
|
||||
install -d -m 755 "$settingsDir/zsh"
|
||||
|
||||
# Source /etc/profile on startup, which contains important settings
|
||||
# Keep dots in B_USER_SETTINGS_DIRECTORY, if the user hasn't got any
|
||||
# dots in their home directory
|
||||
cat > "$settingsDir/zsh/zshenv" << EOF
|
||||
setopt EXTENDED_GLOB
|
||||
if [ -z ~/.z(login|logout|profile|shrc|shenv)(N) ]; then
|
||||
ZDOTDIR="\$(finddir B_USER_SETTINGS_DIRECTORY)/zsh"
|
||||
fi
|
||||
unsetopt EXTENDED_GLOB
|
||||
EOF
|
||||
# Source /etc/profile on startup, which contains important settings
|
||||
cat > "$settingsDir/zsh/zprofile" << EOF
|
||||
# Emulate ksh as a walkaround for ksh-syntax within /etc/profile
|
||||
emulate ksh -c 'source /etc/profile'
|
||||
PS1="\${PS1/'\$PWD'/%~}"
|
||||
|
||||
# Migration path for users who rely on the old behavior
|
||||
(
|
||||
setopt EXTENDED_GLOB
|
||||
if [[ -n \$ZDOTDIR && -z \$ZDOTDIR/.z(login|logout|profile|shrc|shenv)(#qN) ]]; then
|
||||
for i in "\$HOME/config/settings/zsh"/z(login|logout|profile|shrc|shenv)(#qN)
|
||||
do
|
||||
local target=\$ZDOTDIR/.\$(basename "\$i")
|
||||
echo "Symlinking \$i to \$target..."
|
||||
ln -sv "\$i" "\$target"
|
||||
unset target
|
||||
done
|
||||
[[ -e \$ZDOTDIR/.zshenv ]] && source \$ZDOTDIR/.zshenv
|
||||
fi
|
||||
)
|
||||
EOF
|
||||
install -m 644 \
|
||||
"$portDir"/additional-files/zprofile \
|
||||
"$portDir"/additional-files/zshenv \
|
||||
"$settingsDir"/zsh
|
||||
|
||||
make install.html
|
||||
install -t "$developDocDir" -m 644 Doc/*.pdf
|
||||
|
||||
Reference in New Issue
Block a user