Commit 4f186978 authored by Andreas Tille's avatar Andreas Tille

Install profile.d script to enable adjusting PATH for Blend users

parent 4f607d1b
blends (0.6.92.2+exp) experimental; urgency=medium
* templates/profile.sh: Enable users to specify a Blend name in ~/.blends
and prepend an according path to PATH
* devtools/blend-install-helper: Install profile.d script to enable adjusting
PATH for Blend users
-- Andreas Tille <tille@debian.org> Fri, 30 Jan 2015 14:14:03 +0100
blends (0.6.92.2) unstable; urgency=medium
* devtools/blend-gen-control: Prevent respecting users sources.list.d dir
......
#!/bin/sh
blend=`/usr/share/blends-dev/blend-get-names metapackageprefix`
menudir=usr/share/blends/"$blend"/menu
......@@ -13,6 +12,7 @@ SubstBlendName () {
# Make dependency from menu containing packages to the right #BLEND#-config version
# version="(>= `dpkg-parsechangelog | grep "^Version:" | sed -e "s/^Version:[[:space:]]\+\([\.0-9]*\)[[:space:]]*/\1/"`)"
version="(>= `dpkg-parsechangelog | awk '/^Version/ { print $2 }'`)"
srcpkgname="`dpkg-parsechangelog | awk '/^Source:/ {print $2}'`"
# First make sure that we really have to prepare a metapackage for all
# tasks. It might be that there are tasks without any existing Dependency
......@@ -137,4 +137,8 @@ if [ -s config/conf ] ; then
# Add common config file for ${blend}
mkdir -p debian/"$blend"-config/etc/blends/"$blend"
cp -a config/conf debian/"$blend"-config/etc/blends/"$blend"/"$blend".conf
# Add profile.d script to enable adjusting PATH for Blends users
mkdir -p debian/"$blend"-config/etc/profile.d
sed "s/#BLENDNAME#/$srcpkgname/g" /usr/share/blends/templates/profile.sh > debian/"$blend"-config/etc/profile.d/${srcpkgname}.sh
fi
# To avoid name clashed while at the same time enabling
# Blends users finding their tools under the names they
# expect them to be the tools in question of each Blend
# will be installed to /usr/lib/$blend/bin and this
# script prepends this dir to the usual system PATH if
# a user is a has mentioned the Blend #BLENDNAME# in a
# file ~/.blends
BLEND=#BLENDNAME#
if [ -e "$HOME"/.blends ] ; then
for blend in `sed 's/#.*//' "$HOME"/.blends` ; do
if [ "$blend" = "$BLEND" ] ; then
blendpath="/usr/lib/$BLEND/bin"
if [ -d "$blendpath" ] ; then
export PATH="$blendpath:${PATH}"
fi
break
fi
done
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment