[Blends-commit] [SCM] blends-dev branch, master, updated. 4f186978c47b9758556f0317a301f98b96a48eae
Andreas Tille
tille at debian.org
Fri Jan 30 18:08:58 UTC 2015
The following commit has been merged in the master branch:
commit 4f186978c47b9758556f0317a301f98b96a48eae
Author: Andreas Tille <tille at debian.org>
Date: Fri Jan 30 17:26:43 2015 +0100
Install profile.d script to enable adjusting PATH for Blend users
diff --git a/debian/changelog b/debian/changelog
index f5431eb..bdc61d4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+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 at 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
diff --git a/devtools/blend-install-helper b/devtools/blend-install-helper
index 88b85b6..579f401 100755
--- a/devtools/blend-install-helper
+++ b/devtools/blend-install-helper
@@ -1,5 +1,4 @@
#!/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
diff --git a/templates/profile.sh b/templates/profile.sh
new file mode 100644
index 0000000..c3d881a
--- /dev/null
+++ b/templates/profile.sh
@@ -0,0 +1,20 @@
+# 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
--
Git repository for blends code
More information about the Blends-commit
mailing list