mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-22 22:00:49 +00:00
Use a single sed command to extract the executable name from the
Info-gnustep.plist ... using a better regexp too git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@12155 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
76495f25a5
commit
4f33dc705d
1 changed files with 12 additions and 4 deletions
|
@ -125,10 +125,18 @@ app=`echo $app | sed 's/\.[a-z]*$//'`
|
|||
app=`basename $app`
|
||||
appname=
|
||||
if [ -f "$full_appname/Resources/Info-gnustep.plist" ]; then
|
||||
appname=`grep NSExecutable $full_appname/Resources/Info-gnustep.plist`
|
||||
if [ -n "$appname" ]; then
|
||||
appname=`echo "$appname" | tr -d '\";=' | awk '{print $2}'`
|
||||
fi
|
||||
# -n disable auto-print (for portability reasons)
|
||||
# /^[ ]*NSExecutable[ ]*=/ matches every line beginning with
|
||||
# zero or more spaces, followed by 'NSExecutable', followed by zero or
|
||||
# more spaces, followed by '='
|
||||
# to this line we apply the following commands:
|
||||
# s/^[ ]*NSExecutable[ ]*=[ ]*"\?\([^ ]*\)"\?[ ]*;/\1/p;
|
||||
# which replaces 'NSExecutable = "Gorm";' with Gorm, then, because
|
||||
# of the 'p' at the end, prints out the result
|
||||
# q; which quits sed since we know there must be a single line to replace.
|
||||
appname=`sed -n -e '/^[ ]*NSExecutable[ ]*=/ \
|
||||
{s/^[ ]*NSExecutable[ ]*=[ ]*"\?\([^ ]*\)"\?[ ]*;/\1/p; q;}' \
|
||||
"$full_appname/Resources/Info-gnustep.plist"`
|
||||
fi
|
||||
if [ -z "$appname" ]; then
|
||||
appname=$app
|
||||
|
|
Loading…
Reference in a new issue