* makeWrapper: --add-flags to add extra flags to the command being
wrapped. svn path=/nixpkgs/trunk/; revision=12091
This commit is contained in:
parent
4ea9f7ca5d
commit
91258d9884
@ -2,6 +2,7 @@ makeWrapper() {
|
||||
local original=$1
|
||||
local wrapper=$2
|
||||
local params varName value command separator n fileNames
|
||||
local flagsBefore flags
|
||||
|
||||
ensureDir "$(dirname $wrapper)"
|
||||
|
||||
@ -57,9 +58,15 @@ makeWrapper() {
|
||||
echo "export $varName=\$$varName\${$varName:+$separator}$(cat $fileName)" >> $wrapper
|
||||
done
|
||||
fi
|
||||
|
||||
if test "$p" = "--add-flags"; then
|
||||
flags=${params[$((n + 1))]}
|
||||
n=$((n + 1))
|
||||
flagsBefore="$flagsBefore $flags"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "exec \"$original\" \"\$@\"" >> $wrapper
|
||||
echo "exec \"$original\" $flagsBefore \"\$@\"" >> $wrapper
|
||||
|
||||
chmod +x $wrapper
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user