portability improvements for wineshelllink script
Robert Lunnon
bobl at optushome.com.au
Sat May 7 04:14:52 CDT 2005
Changelog
tools/wineshelllink
Laurent Blume
Explicitly define bash as the script interpretor for compatibility with OSes
with real bourne shells
Protect against test of an unset variable
Patch Notes
I received this from the Solaris x86 mailing list and have permission from the
author to post it on the authors behalf.
---------- Forwarded Message ----------
Subject: Re: [solarisx86] Re: using wine on sun w2100z
Date: Wed, 4 May 2005 07:54 pm
From: Laurent Blume <laurent at elanor.org>
To: solarisx86 at yahoogroups.com
Robert Lunnon wrote:
> Yes, the link was broken but I fixed it this morning, I've got the right
> archive uploaded and hyperlinked now so it should now work better on stock
> Solaris 10 systems (Hopefully).
I'm just trying it right now, using the sidenet config script.
I'm not finished yet, but I had to do the following modifications to one
script, use bash, and protect against the test of an unset variable:
# diff -u wineshelllink.old wineshelllink
--- wineshelllink.old mer mai 4 11:47:30 2005
+++ wineshelllink mer mai 4 11:50:03 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Create menu/desktop entries for an application
# This is used by the IShellLink interface
@@ -163,34 +163,36 @@
kdeversion=`kde-config -v | grep KDE: | sed -n "s/^KDE:
\([^.]*\)\..*$/\1/p"` fi
- if [ $kdeversion -ge 2 ]
- then
- copy_icon "$HOME/.kde/share/applnk/Wine"
- if [ $mode = "menu" ]
+ if [ -n "$kdeversion" ]; then
+ if [ "$kdeversion" -ge 2 ]
then
- gnome_entry > "$HOME/.kde/share/applnk/Wine/$link.desktop"
- elif [ -d "$HOME/Desktop" ]
- then
- gnome_entry > "$HOME/Desktop/$link.desktop"
- fi
- else
- copy_icon "$HOME/.kde/share/applnk/Wine"
- if [ $mode = "menu" ]
- then
- kde_entry > "$HOME/.kde/share/applnk/Wine/$link.kdelnk"
+ copy_icon "$HOME/.kde/share/applnk/Wine"
+ if [ $mode = "menu" ]
+ then
+ gnome_entry > "$HOME/.kde/share/applnk/Wine/$link.desktop"
+ elif [ -d "$HOME/Desktop" ]
+ then
+ gnome_entry > "$HOME/Desktop/$link.desktop"
+ fi
+ else
+ copy_icon "$HOME/.kde/share/applnk/Wine"
+ if [ $mode = "menu" ]
+ then
+ kde_entry > "$HOME/.kde/share/applnk/Wine/$link.kdelnk"
- # KDE 1.x kludge. Wake up KDE, if we can find kpanel running
- which kwmcom >/dev/null 2>/dev/null && \
- ps u -C kpanel >/dev/null 2>/dev/null && \
- kwmcom kpanel:restart
-
- elif [ -d "$HOME/Desktop" ]
- then
- kde_entry > "$HOME/Desktop/$link.kdelnk"
- # KDE 1.x kludge: wake up KDE, if we can find kfm running...
- which kfmclient >/dev/null 2>/dev/null && \
- ps u -C kfm >/dev/null 2>/dev/null && \
- kfmclient refreshDesktop
+ # KDE 1.x kludge. Wake up KDE, if we can find kpanel running
+ which kwmcom >/dev/null 2>/dev/null && \
+ ps u -C kpanel >/dev/null 2>/dev/null && \
+ kwmcom kpanel:restart
+
+ elif [ -d "$HOME/Desktop" ]
+ then
+ kde_entry > "$HOME/Desktop/$link.kdelnk"
+ # KDE 1.x kludge: wake up KDE, if we can find kfm running...
+ which kfmclient >/dev/null 2>/dev/null && \
+ ps u -C kfm >/dev/null 2>/dev/null && \
+ kfmclient refreshDesktop
+ fi
fi
fi
fi
--
A hundred thousand lemmings can't be wrong!
Please check the Links page before posting:
http://groups.yahoo.com/group/solarisx86/links
Post message: solarisx86 at yahoogroups.com
UNSUBSCRIBE: solarisx86-unsubscribe at yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/solarisx86/
<*> To unsubscribe from this group, send an email to:
solarisx86-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
-------------------------------------------------------
More information about the wine-patches
mailing list