Re: Script to run Wine and save log

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 24, 2009 at 4:30 PM, Gert van den Berg<wine-users@xxxxxxxxx> wrote:
> On Wed, Jun 24, 2009 at 21:52, Austin English<austinenglish@xxxxxxxxx> wrote:
>> On Wed, Jun 24, 2009 at 2:38 PM, Gert van den Berg<wine-users@xxxxxxxxx> wrote:
>>> TODO:
>>> 1. Distro detection with lsb_release if available.
>>
>> Not all distro's use lsb_release. /etc/release, /etc/issue,
>> /etc/redhat-release, etc. are other popular ways to get that info.
>> Keep in mind, not everyone uses Linux ;-). `uname -s` will give you
>> the OS type (in a portable way).
>>
> There is a uname -a further down.
>
> lsb_release works nice for identifying the Linux distro, *if* it is
> present... (And for now at least, uname should be suffiecient on
> non-Linux anyway, except maybe with some OpenSolaris distributions...)

uname is portable, and should work everywhere. What's *not* portable,
is, e.g., grepping uname for answers, e.g.,:
`uname -a` | grep Linux
Yes, I've seen this done. But what happens if you're on a *BSD box
with the hostname 'Linux_sucks'.

I meant if you want to do OS specific code paths, use uname -s.

>>> date=`date +%Y%m%d-%H:%M:%S`
>>>
>>> if [ -d "$WINEPREFIX" ]; then
>>>        wineprefixstatus="Not clean"
>>> else
>>>        wineprefixstatus="Clean"
>>> fi
>>
>> the '[ ] ; then' isn't portable (just found this out myself ;-) ). Put
>> the 'then' on a separate line, remove the ';'.
>>
>
> "Why I normally use Perl ;)"
>
> (I *know* it works under bash on Solaris, I usually don't bother with
> plain Bourne...)

Right. I'm not sure where it doesn't work (I'm told Solaris, but
haven't tested). But never hurts to be safe.

> Somethings that would be nice to add (preferably with a proper option parser):
> Graphics card model / driver detection (Portability might be hard....)

Not sure how easy that is, tbh.

> State of common problematic processes, such as pulseaudio / compiz

Yes, good idea. Preferably with a warning/error if they're enabled.

> Logged in user (`id` should work..)

`id` gives a lot more info, e.g., groups a user is in. `whoami` would
be better. Or $USER.

> (I should probably test it on my MacBook and the OpenSolaris box that
> I'm planning to install soon...)

Good good.

-- 
-Austin



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux