Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-07

Determining OS

42 messages · 13 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Chris Kelling

I'm writing a generic installer for a project, and want to set up things like the registry or system.d depending on the OS type. Is there an environment string, or a function to report what OS the system being hosted on, or do I need to write different versions specifically for the OS?

-Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110731/14f358b6/attachment.html>

Reply by email

ik
to Chris Kelling

2011/7/31 Chris Kelling

Show quoted text 5 lines
I?m writing a generic installer for a project, and want to set up things like the registry or system.d depending on the OS type. Is there an environment string, or a function to report what OS the system being hosted on, or do I need to write different versions specifically for the OS?

you have the macros of WINDOWS, UNIX, LINUX etc... {$IFDEF WINDOWS} ...

Please note that system.d is Fedora implementation (v15) so for Linux you need to detect also the Linux distro, and that's a bit more complicated.

/etc/issue Can help, but also /etc/redhat /etc/debian etc.. can also help you to figure out what distro it is, but that will work only on specific distro's as well.

Show quoted text 6 lines
**** ** ** -Chris

Ido

Show quoted text 9 lines
**** -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110731/3bfd5012/attachment.html>

Reply by email

Graeme Geldenhuys
to ik

2011/7/31 ik :

Please note that system.d is Fedora implementation (v15) so for Linux you need to detect also the Linux distro, and that's a bit more complicated.

Any distro worth using should support the LSB standards. With that being said, you can use the 'lsb_release' command to find out exactly what distribution and version is being used.

-------------------------------------------------------------------------- $ lsb_release --help
Usage: lsb_release [options]

Options:
-h, --help show this help message and exit -v, --version show LSB modules this system supports -i, --id show distributor ID
-d, --description show description of this distribution -r, --release show release number of this distribution -c, --codename show code name of this distribution -a, --all show all of the above information -s, --short show all of the above information in short format

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 8.04.4 LTS
Release: 8.04
Codename: hardy

--------------------------------------------------------------------------

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

ik
to Graeme Geldenhuys
Graeme Geldenhuys wrote 8 lines
2011/7/31 ik : > Please note that system.d is Fedora implementation (v15) so for Linux you > need to detect also the Linux distro, and that's a bit more complicated. Any distro worth using should support the LSB standards. With that being said, you can use the 'lsb_release' command to find out exactly what distribution and version is being used.

I'm using Arch Linux and that is my output:

------------------------
$ lsb_release
LSB Version: n/a

$
-------------------------

But I have the following file:
/etc/arch-release

I think that looking for /etc/*release is more reliable at the moment for distros.

BTW The TRegistry class is cross platform. On Windows it uses Registry, and on other OS, it uses INI files.

Show quoted text 30 lines
-------------------------------------------------------------------------- $ lsb_release --help Usage: lsb_release [options] Options: -h, --help show this help message and exit -v, --version show LSB modules this system supports -i, --id show distributor ID -d, --description show description of this distribution -r, --release show release number of this distribution -c, --codename show code name of this distribution -a, --all show all of the above information -s, --short show all of the above information in short format $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 8.04.4 LTS Release: 8.04 Codename: hardy -------------------------------------------------------------------------- -- Regards, - Graeme -

Ido

Show quoted text 12 lines
_______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110731/3492b2c9/attachment-0001.html>

Reply by email

Chris Kelling
to ik

Thank you for the suggestions so far -

$ lsb_release seems to give good information, my Fedora 15 machine returns

LSB Version: :core-4.0-ia32:core-4,0-noarch

In addition, I did a ls of the /etc directory and found a file called system-release-cpe, Looking in it says cpe:/o:fedoraproject:fedora:15

Now, this may be unique to fedora (isn't open source wonderful?), but if all distros have that file, I think that may be the solution, I've got an ubuntu machine running, too - I should look to see what it has.

Say what you will about the windows registry, but at least there's a common place to look for and put information. And no, I don't want to start a war over the merits of one OS over another, just trying to make my program portable to the most machines with the least effort for the end user.

_____

Earlier message 85 lines
From: ik [mailto:] Sent: Sunday, July 31, 2011 10:55 To: Lazarus mailing list Subject: Re: [Lazarus] Determining OS On Sun, Jul 31, 2011 at 17:43, Graeme Geldenhuys wrote: 2011/7/31 ik : > Please note that system.d is Fedora implementation (v15) so for Linux you > need to detect also the Linux distro, and that's a bit more complicated. Any distro worth using should support the LSB standards. With that being said, you can use the 'lsb_release' command to find out exactly what distribution and version is being used. I'm using Arch Linux and that is my output: ------------------------ $ lsb_release LSB Version: n/a $ ------------------------- But I have the following file: /etc/arch-release I think that looking for /etc/*release is more reliable at the moment for distros. BTW The TRegistry class is cross platform. On Windows it uses Registry, and on other OS, it uses INI files. -------------------------------------------------------------------------- $ lsb_release --help Usage: lsb_release [options] Options: -h, --help show this help message and exit -v, --version show LSB modules this system supports -i, --id show distributor ID -d, --description show description of this distribution -r, --release show release number of this distribution -c, --codename show code name of this distribution -a, --all show all of the above information -s, --short show all of the above information in short format $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 8.04.4 LTS Release: 8.04 Codename: hardy -------------------------------------------------------------------------- -- Regards, - Graeme - Ido _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net --

Reply by email

Graeme Geldenhuys
to ik: I'm using Arch Linux and that is my output: ------------------------ $ lsb_release LSB…

2011/7/31 ik :

Show quoted text 7 lines
I'm using Arch Linux and that is my output: ------------------------ $ lsb_release LSB Version:??? n/a

Under Ubuntu 8.04 the 'lsb_release' command on it's own doesn't give any usable output either. You need to specify a parameter.

eg: $ lsb_release -a

See 'lsb_release --help' for more available options. As shown below:

Show quoted text 22 lines
> -------------------------------------------------------------------------- > $ lsb_release --help > Usage: lsb_release [options] > > Options: > ?-h, --help ? ? ? ? show this help message and exit > ?-v, --version ? ? ?show LSB modules this system supports > ?-i, --id ? ? ? ? ? show distributor ID > ?-d, --description ?show description of this distribution > ?-r, --release ? ? ?show release number of this distribution > ?-c, --codename ? ? show code name of this distribution > ?-a, --all ? ? ? ? ?show all of the above information > ?-s, --short ? ? ? ?show all of the above information in short format > > $ lsb_release -a > No LSB modules are available. > Distributor ID: Ubuntu > Description: ? ?Ubuntu 8.04.4 LTS > Release: ? ? ? ?8.04 > Codename: ? ? ? hardy > > --------------------------------------------------------------------------
Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Graeme Geldenhuys
to Chris Kelling: Thank you for the suggestions so far - $ lsb_release seems to give good information, my…

2011/7/31 Chris Kelling :

$ lsb_release seems to give good information, my Fedora 15 machine returns LSB Version:???? :core-4.0-ia32:core-4,0-noarch

Specify some of the other parameters in the 'lsb_release' command and you will get the exact information your are looking for, on any distro that supports LSB standard.

Say what you will about the windows registry, but at least there?s a common place to look for and put information.

Well yes, it's very easy if you own the OS and there is just one or two controlled version of that OS. This applies both to Microsoft and Apple. The benefit of closed source OS's. If you want to apply the same principle, then you need to compare various Ubuntu releases to each other.

The LSB (Linux Standards Base) and the FreeDesktop.org standards are trying to make all distros more compliant with a set of standards - making the life of any ISV and lone software developer MUCH easier. LSB and FreeDesktop.org are supported by most mainstream distros (for years already). If your distro doesn't, use something better, or email the maintainers of that distro and demand better standardization.

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Ludo Brands
to Chris Kelling: Thank you for the suggestions so far - $ lsb_release seems to give good information, my…

Have you tried uname?
This works on virtually all unix platforms. Here
http://en.wikipedia.org/wiki/Uname you'll find a sample output given by different unix flavors.
My Fedora 13 64bit gives for uname -r : 2.6.34.7-56.fc13.x86_64

lsb_release on ubuntu 10 64 bit says: no LSB modules are available. On debian lenny for arm: command not found...

uname -m gives you also the cpu the os is running on which is also important for porting a program.

Ludo

Earlier message 123 lines
-----Message d'origine----- De : Chris Kelling [mailto:] Envoy? : dimanche 31 juillet 2011 17:30 ? : 'Lazarus mailing list' Objet : Re: [Lazarus] Determining OS Thank you for the suggestions so far ? $ lsb_release seems to give good information, my Fedora 15 machine returns LSB Version: :core-4.0-ia32:core-4,0-noarch In addition, I did a ls of the /etc directory and found a file called system-release-cpe, Looking in it says cpe:/o:fedoraproject:fedora:15 Now, this may be unique to fedora (isn?t open source wonderful?), but if all distros have that file, I think that may be the solution, I?ve got an ubuntu machine running, too ? I should look to see what it has. Say what you will about the windows registry, but at least there?s a common place to look for and put information. And no, I don?t want to start a war over the merits of one OS over another, just trying to make my program portable to the most machines with the least effort for the end user. _____ From: ik [mailto:] Sent: Sunday, July 31, 2011 10:55 To: Lazarus mailing list Subject: Re: [Lazarus] Determining OS On Sun, Jul 31, 2011 at 17:43, Graeme Geldenhuys wrote: 2011/7/31 ik : > Please note that system.d is Fedora implementation (v15) so for Linux you > need to detect also the Linux distro, and that's a bit more complicated. Any distro worth using should support the LSB standards. With that being said, you can use the 'lsb_release' command to find out exactly what distribution and version is being used. I'm using Arch Linux and that is my output: ------------------------ $ lsb_release LSB Version: n/a $ ------------------------- But I have the following file: /etc/arch-release I think that looking for /etc/*release is more reliable at the moment for distros. BTW The TRegistry class is cross platform. On Windows it uses Registry, and on other OS, it uses INI files. -------------------------------------------------------------------------- $ lsb_release --help Usage: lsb_release [options] Options: -h, --help show this help message and exit -v, --version show LSB modules this system supports -i, --id show distributor ID -d, --description show description of this distribution -r, --release show release number of this distribution -c, --codename show code name of this distribution -a, --all show all of the above information -s, --short show all of the above information in short format $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 8.04.4 LTS Release: 8.04 Codename: hardy -------------------------------------------------------------------------- -- Regards, - Graeme - Ido _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net --

Reply by email

Graeme Geldenhuys
to Ludo Brands

2011/7/31 Ludo Brands :

Have you tried uname?

That only gives you the kernel version.

lsb_release on ubuntu 10 64 bit says: no LSB modules are available. On debian lenny for arm: command not found...

Don't you guys READ!!! I specifically showed the parameters you need to specify with the 'lsb_release' command so you DO GET THE RIGHT OUTPUT.

Try this:

   $ lsb_release -a

Or from my original post...

Show quoted text 14 lines
-------------------------------------------------------------------------- $ lsb_release --help Usage: lsb_release [options] Options: ?-h, --help ? ? ? ? show this help message and exit ?-v, --version ? ? ?show LSB modules this system supports ?-i, --id ? ? ? ? ? show distributor ID ?-d, --description ?show description of this distribution ?-r, --release ? ? ?show release number of this distribution ?-c, --codename ? ? show code name of this distribution ?-a, --all ? ? ? ? ?show all of the above information ?-s, --short ? ? ? ?show all of the above information in short format
Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

ik
to Graeme Geldenhuys
Graeme Geldenhuys wrote 20 lines
2011/7/31 Ludo Brands : > Have you tried uname? That only gives you the kernel version. > lsb_release on ubuntu 10 64 bit says: no LSB modules are available. On > debian lenny for arm: command not found... Don't you guys READ!!! I specifically showed the parameters you need to specify with the 'lsb_release' command so you DO GET THE RIGHT OUTPUT. Try this: $ lsb_release -a Or from my original post...

$ lsb_release -a
LSB Version: n/a
Distributor ID: n/a
Description: (none)
Release: n/a
Codename: n/a

It is missing from some implementations. Arch Linux (my distro) is spread and not a small based distro, so lsb is not the way, only LSB based distro's are.

But the original person that asked the question should explain better what he is looking for. It might not require to detect the distro itself for example, or to allow the package builder to tweak things, or at the first run to ask the distro from a list of supported distro and save it in configuration files.

It's all depends on what he requires to do.

Show quoted text 32 lines
> -------------------------------------------------------------------------- > $ lsb_release --help > Usage: lsb_release [options] > > Options: > -h, --help show this help message and exit > -v, --version show LSB modules this system supports > -i, --id show distributor ID > -d, --description show description of this distribution > -r, --release show release number of this distribution > -c, --codename show code name of this distribution > -a, --all show all of the above information > -s, --short show all of the above information in short format > -- Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110731/aa0549cb/attachment.html>

Reply by email

Chris Kelling
to ik

I am looking to distribute my software to pc, linux, unix, and mac users. I'm using the registry in Windows, and was going to use systemd for linux.

From what I'm gathering, it would be best to just do a simple config or ini

file in the root directory of the program. I'm thinking that when creating the installer, I will ask where the program will reside, and provide a default that is platform independent. That way all I need to do is provide the deb or rpm for linux, the msi for windows, and what ever unix and apple require (OS X is a flavor of Darwin, thus the debain packager maybe?)

_____

Earlier message 26 lines
From: ik [mailto:] Sent: Sunday, July 31, 2011 14:13 To: Lazarus mailing list Subject: Re: [Lazarus] RE : Determining OS [edited for brevity] But the original person that asked the question should explain better what he is looking for. It might not require to detect the distro itself for example, or to allow the package builder to tweak things, or at the first run to ask the distro from a list of supported distro and save it in configuration files. It's all depends on what he requires to do. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110731/8e9e03b9/attachment.html>

Reply by email

ik
to Chris Kelling

2011/7/31 Chris Kelling

Show quoted text 10 lines
I am looking to distribute my software to pc, linux, unix, and mac users. I?m using the registry in Windows, and was going to use systemd for linux. From what I?m gathering, it would be best to just do a simple config or ini file in the root directory of the program. I?m thinking that when creating the installer, I will ask where the program will reside, and provide a default that is platform independent. That way all I need to do is provide the deb or rpm for linux, the msi for windows, and what ever unix and apple require (OS X is a flavor of Darwin, thus the debain packager maybe?)

You are thinking it wrong IMHO.
1. FPC's TRegistry handle that for you
2. In non Windows machines, you save custom settings in the home directory of the users. Mostly under a hidden directory with the program name.
3. System.d is a process boot system and not a system configuration saving
4. GTK have central setting system caled gconf, it was built in the idea of registry like system. Qt does not have one.
5. Each package for specific Linux distro solve you the requirement to understand in the program what is the exact distro. You can even hard code that data using IFDEF and use FPC to compile using the proper DEFINE (I wish there would be a better tool for that though).

6. OS X is based on FreeBSD (open source unix) and not Linux. Darwin is an engine inside OS-X.
7. OS-X have it's own package manager that use sit and dmg files (I don't really know Mac that well to fully expand it).

Ido

Show quoted text 35 lines
**** ** ** ------------------------------ *From:* ik [mailto:] *Sent:* Sunday, July 31, 2011 14:13 *To:* Lazarus mailing list *Subject:* Re: [Lazarus] RE : Determining OS**** ** ** ** ** [edited for brevity]**** ** ** But the original person that asked the question should explain better what he is looking for. It might not require to detect the distro itself for example, or to allow the package builder to tweak things, or at the first run to ask the distro from a list of supported distro and save it in configuration files. It's all depends on what he requires to do.**** ** ** -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110731/65ebc046/attachment-0001.html>

Reply by email

Eduardo

Yes, you are definily doing it wrong.
You shouldn't even have a installer for Linux. Programs in Linux with installers are just weird... Let the package manager do what a installer would do for you (you can have custom scripts in the package manager if that's strictly necessary, but it shouldn't).

On Mac, the most elegant install solution IMHO is to simply copy the Application Bundle to the /Applications folder and that is it. No install necessary, any configuration necessary is created the first time the application runs.
But if you really must have a installer for MacOSX I recommend creating a package for MacOSX default installer application. Again you just package everything with a few scripts and that is it.

Badilly written custom installer applications is a Windows thing and I'm happy that I don't need to bother with them anymore...

Show quoted text 68 lines
Send Lazarus mailing list submissions to To subscribe or unsubscribe via the World Wide Web, visit http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus or, via email, send a message with subject or body 'help' to You can reach the person managing the list at When replying, please edit your Subject line so it is more specific than "Re: Contents of Lazarus digest..." Today's Topics: 1. Re: RE : Determining OS (Graeme Geldenhuys) 2. Re: TAChart 2nd Y Axis (David M. Lawrence) 3. Re: RE : Determining OS (ik) 4. Re: RE : Determining OS (Chris Kelling) 5. Re: RE : Determining OS (ik) ---------------------------------------------------------------------- Message: 1 Date: Sun, 31 Jul 2011 19:37:59 +0200 From: Graeme Geldenhuys Subject: Re: [Lazarus] RE : Determining OS To: Lazarus mailing list Message-ID: Content-Type: text/plain; charset=UTF-8 2011/7/31 Ludo Brands: > Have you tried uname? That only gives you the kernel version. > lsb_release on ubuntu 10 64 bit says: no LSB modules are available. On > debian lenny for arm: command not found... Don't you guys READ!!! I specifically showed the parameters you need to specify with the 'lsb_release' command so you DO GET THE RIGHT OUTPUT. Try this: $ lsb_release -a Or from my original post... > -------------------------------------------------------------------------- > $ lsb_release --help > Usage: lsb_release [options] > > Options: > ?-h, --help ? ? ? ? show this help message and exit > ?-v, --version ? ? ?show LSB modules this system supports > ?-i, --id ? ? ? ? ? show distributor ID > ?-d, --description ?show description of this distribution > ?-r, --release ? ? ?show release number of this distribution > ?-c, --codename ? ? show code name of this distribution > ?-a, --all ? ? ? ? ?show all of the above information > ?-s, --short ? ? ? ?show all of the above information in short format >
Eduardo "Ela vir?, a revolu??o conquistar? a todos o direito n?o somente ao p?o mas, tamb?m, ? poesia." (Leon Trotsky)

Reply by email

Ludo Brands
to Graeme Geldenhuys: 2011/7/31 Ludo Brands : That only gives you the kernel version. Don't you guys READ!!! I…
Show quoted text 15 lines
> lsb_release on ubuntu 10 64 bit says: no LSB modules are available. On > debian lenny for arm: command not found... Don't you guys READ!!! I specifically showed the parameters you need to specify with the 'lsb_release' command so you DO GET THE RIGHT OUTPUT. Try this: $ lsb_release -a Or from my original post...

Debian arm: lsb_release: not found. That is even with -a.

Fedora 13: fresh installation: not found, also not found with -a

How many -a do I need to add?

http://lmgtfy.com/?q=fedora+lsb_release&l=1

Ludo

Reply by email

Mark Morgan Lloyd
to Graeme Geldenhuys: 2011/7/31 Chris Kelling : Specify some of the other parameters in the 'lsb_release'…
Graeme Geldenhuys wrote
The LSB (Linux Standards Base) and the FreeDesktop.org standards aretrying to make all distros more compliant with a set of standards -making the life of any ISV and lone software developer MUCH easier.LSB and FreeDesktop.org are supported by most mainstream distros (foryears already). If your distro doesn't, use something better, or emailthe maintainers of that distro and demand better standardization.

An older servo distro we've got around here has neither lsb_release nor the xdg utilities, I've not checked either of the Solaris systems. Looking at machines in my workroom, all of the Debians currently running have both, except for one Lenny which doesn't have lsb_release- other Lennies have it.

So while the utilities are undoubtedly useful and underused, it's clearly important to have some sort of fallback if they turn out not to be available.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mark Morgan Lloyd
to Ludo Brands: Debian arm: lsb_release: not found. That is even with -a. Fedora 13: fresh installation:…
Ludo Brands wrote 22 lines
>> lsb_release on ubuntu 10 64 bit says: no LSB modules are > available. On >> debian lenny for arm: command not found... > Don't you guys READ!!! I specifically showed the parameters > you need to specify with the 'lsb_release' command so you DO > GET THE RIGHT OUTPUT. > > Try this: > > $ lsb_release -a > > > Or from my original post... > Debian arm: lsb_release: not found. That is even with -a. Fedora 13: fresh installation: not found, also not found with -a How many -a do I need to add? http://lmgtfy.com/?q=fedora+lsb_release&l=1

Looks like a platform thing as far as Lenny goes. Not on ARM, not on x86, is on SPARC. Not tried others CPUs or versions. Not tried recent Slackware which is the only other Linux to hand. Not tried Solaris (8 or 10).

/If/ available, it looks useful. However the fact that one major distro doesn't uniformly include it emphasises that there has to be a fallback position, same applies to xdg*

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Marco van de Voort
to Graeme Geldenhuys: 2011/7/31 ik : Any distro worth using should support the LSB standards. With that being…
Graeme Geldenhuys wrote 7 lines
2011/7/31 ik : > Please note that system.d is Fedora implementation (v15) so for Linux you > need to detect also the Linux distro, and that's a bit more complicated. Any distro worth using should support the LSB standards. With that being said, you can use the 'lsb_release' command to find out exactly what distribution and version is being used.

Not installed by default on Fedora 15:

[marcov at atlas ~]$ lsb_release
bash: lsb_release: command not found...

so you can't really rely on it. Apparently the standard is optional.

Reply by email

Graeme Geldenhuys
to ik: $ lsb_release -a LSB Version: n/a Distributor ID: n/a Description: (none) Release: …

2011/7/31 ik :

Show quoted text 6 lines
$ lsb_release -a LSB Version:??? n/a Distributor ID: n/a Description:??? (none) Release:??????? n/a Codename:?????? n/a

OK, my apologies. It's just that if I run the 'lsb_release' command on it's own with no parameters, I too get useless information - even from Ubuntu 8.04

 $ lsb_release
No LSB modules are available.

.... and everybody (including you) replied quoting that 'lsb_release' (without parameters) doesn't return usable results.

It's all depends on what he requires to do.

Indeed.

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Graeme Geldenhuys
to Chris Kelling: I am looking to distribute my software to pc, linux, unix, and mac users. I'm using the…

2011/7/31 Chris Kelling :

I am looking to distribute my software to pc, linux, unix, and mac users. I?m using the registry in Windows, and was going to use systemd for linux.

Use the RTL function GetAppConfigDir(True) - this will normally return '/etc' under Linux and any Unix system. GetAppConfigDir(False) will return a directory that is writable for any normal user (no admin or root rights required).

Also take a look at GetAppConfigFile(). This might even be better than the above mentioned function.

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Graeme Geldenhuys
to Marco van de Voort: Not installed by default on Fedora 15: [marcov at atlas ~]$ lsb_release bash:…
Marco van de Voort wrote 5 lines
> Any distro worth using should support the LSB standards. With that > being said, you can use the 'lsb_release' command to find out exactly > what distribution and version is being used. Not installed by default on Fedora 15:

I did say "a distro worth using". ;-) Just kidding.

But thanks to all that replied regarding the lsb command. Clearly the various Linux distros still need to work on "standardization".

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Felipe Monteiro de Carvalho
to Michael Schnell

It works in Mandriva Linux:

[felipe at localhost fpvectorial]$ lsb_release -a
LSB Version:
lsb-4.0-ia32:lsb-4.0-noarch:core-3.0-ia32:core-3.0-noarch:core-3.2-ia32:core-3.2-noarch:core-4.0-ia32:core-4.0-noarch:cxx-3.2-ia32:cxx-3.2-noarch:graphics-3.2-ia32:graphics-3.2-noarch:lsb-3.0-ia32:lsb-3.0-noarch:lsb-3.2-ia32:lsb-3.2-noarch:lsb-4.0-ia32:lsb-4.0-noarch Distributor ID: MandrivaLinux
Description: Mandriva Linux 2010.1
Release: 2010.1
Codename: Henry_Farman

Felipe Monteiro de Carvalho

Reply by email

Mark Morgan Lloyd
to Graeme Geldenhuys: I did say "a distro worth using". ;-) Just kidding. But thanks to all that replied…
Graeme Geldenhuys wrote 5 lines
On 31 July 2011 23:10, Marco van de Voort wrote:>> Any distro worth using should support the LSB standards. With that>> being said, you can use the 'lsb_release' command to find out exactly>> what distribution and version is being used.>> Not installed by default on Fedora 15: I did say "a distro worth using". ;-) Just kidding. But thanks to all that replied regarding the lsb command. Clearly thevarious Linux distros still need to work on "standardization".

Noting your earlier comments on both lsb_release and xdg-open, the first thing I'd say is that it strikes me that xdg-open is specifically a desktop-related program, i.e. it might not be installed on "headless" systems. Taking that into account, I thought it worth taking a closer look at a number of systems.

Slackware x86 8.1 with desktop: neither lsb_release nor xdg-open.

Slackware x86 13.37 with desktop: no lsb_release, does have xdg-open.

Debian armel Lenny headless: neither lsb_release nor xdg-open.

Debian armel Lenny with desktop: neither lsb_release nor xdg-open.

Debian armel Squeeze with desktop: has lsb_release, no xdg-open.

Debian mipsel Squeeze with desktop: has lsb_release, no xdg-open.

Debian zSeries Lenny with desktop: neither lsb_release nor xdg-open.

Debian x86 Lenny with desktop: neither lsb_release nor xdg-open.

Debian x86 Squeeze with desktop: both lsb_release and xdg-open.

Debian SPARC Etch with desktop: both lsb_release and xdg-open.

Debian SPARC Lenny with desktop: both lsb_release and xdg-open.

Solaris (8 and 10) have neither lsb_release nor xdg-open as standard. Same probably applies to BSD.

I find this particularly disappointing since I've used and recommended xdg-open in the past, on the assumption that since it had appeared in some distreax and versions it would fairly rapidly be adopted by all. Mea culpa.

Debian can be recognised by the presence of /etc/apt/sources.list, and any version that's likely to be encountered will have the release name in the URLs it contains (older ones referenced 'stable' etc.).

Can somebody confirm this for Ubuntu? Are there comparable files for other distreax?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Graeme Geldenhuys
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote
Solaris (8 and 10) have neither lsb_release nor xdg-open as standard. Same probably applies to BSD.

:-) That doesn't come as a surprise considering that they are "Linux" Standards Base.

xdg-open in the past, on the assumption that since it had appeared in some distreax and versions it would fairly rapidly be adopted by all. Mea culpa.

+1
I can't believe that distros in today's time still make it so hard for ISV's to write common (as in distro) desktop applications. Clearly Linux based system just don't want to compete with the likes of Mac OSX and Windows. Maybe we should all jump ship to Haiku.

Can somebody confirm this for Ubuntu? Are there comparable files for other distreax?

Both my Ubuntu 8.04.4 and Ubuntu 10.04.3 systems have the lsb_release and the xdg-open commands available. So I guess that's +1 to Canonical for at least trying to be helpful!

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Mark Morgan Lloyd
to Marco van de Voort: Not installed by default on Fedora 15: [marcov at atlas ~]$ lsb_release bash:…
Marco van de Voort wrote 14 lines
On Sun, Jul 31, 2011 at 04:43:44PM +0200, Graeme Geldenhuys wrote: > 2011/7/31 ik : >> Please note that system.d is Fedora implementation (v15) so for Linux you >> need to detect also the Linux distro, and that's a bit more complicated. > Any distro worth using should support the LSB standards. With that > being said, you can use the 'lsb_release' command to find out exactly > what distribution and version is being used. Not installed by default on Fedora 15: [marcov at atlas ~]$ lsb_release bash: lsb_release: command not found... so you can't really rely on it. Apparently the standard is optional.

I've just come across its being announced on the Debian ML, circa 2000. Somebody immediately pointed out that it was curious that the copyright had been assigned to the FSF rather than to the LSB project itself.

So it looks as though lsb_release is potentially a useful tool, but is not actually part of the LSB standard.

http://lists.debian.org/lsb-discuss/2000/09/msg00004.html

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mark Morgan Lloyd
to Graeme Geldenhuys: :-) That doesn't come as a surprise considering that they are "Linux" Standards Base. +1…
Graeme Geldenhuys wrote 6 lines
> Can somebody confirm this for Ubuntu? Are there comparable files for > other distreax? Both my Ubuntu 8.04.4 and Ubuntu 10.04.3 systems have the lsb_release and the xdg-open commands available. So I guess that's +1 to Canonical for at least trying to be helpful!

Yes, but for cases where lsb_release might not work- e.g. an older release- does apt/sources.list refer to a section of their repository by name or simply as "stable" etc.?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Marco van de Voort
to Graeme Geldenhuys: :-) That doesn't come as a surprise considering that they are "Linux" Standards Base. +1…
Graeme Geldenhuys wrote 7 lines
On 08/01/2011 11:58 AM, Mark Morgan Lloyd wrote: > > Solaris (8 and 10) have neither lsb_release nor xdg-open as standard. > Same probably applies to BSD. :-) That doesn't come as a surprise considering that they are "Linux" Standards Base.

These parts are not terribly linux specific, and deal with desktop systems that are commonly used on BSD too. The "Linux" part is more branding between the big commercial desktops than that it is about operating systems.

Of course, due to Linux' fragmentation, the standards are most needed on Linux too :-)

Show quoted text 9 lines
> xdg-open in the past, on the assumption that since it had appeared in > some distreax and versions it would fairly rapidly be adopted by all. > Mea culpa. +1 I can't believe that distros in today's time still make it so hard for ISV's to write common (as in distro) desktop applications. Clearly Linux based system just don't want to compete with the likes of Mac OSX and Windows. Maybe we should all jump ship to Haiku.

Linux unification is IMHO further away then in the 1997-2000 timeframe.

Reply by email

Graeme Geldenhuys
to Marco van de Voort
Marco van de Voort wrote
Of course, due to Linux' fragmentation, the standards are most needed on Linux too :-)

Very true, and I see Linux fragmentation become more and more of a problem. Many people would like to move off Windows for all kinds of reasons, it's just that the thousands of Linux distros just don't seem to want that business. Go figure!

Luckily we are in a franchising business, so we can control out deployment OS with some control. We motivate our franchisees to use Ubuntu if they decide to go the Linux route. At least that way our support staff can help them for free.

Linux unification is IMHO further away then in the 1997-2000 timeframe.

I agree. Some things have improved, but others have not. And with every Tom, Dick and Harry wanting his own "distro" doesn't help the cause much.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Mark Morgan Lloyd
to Marco van de Voort: These parts are not terribly linux specific, and deal with desktop systems that are…
Marco van de Voort wrote 10 lines
On Mon, Aug 01, 2011 at 12:16:15PM +0200, Graeme Geldenhuys wrote: > On 08/01/2011 11:58 AM, Mark Morgan Lloyd wrote: >> Solaris (8 and 10) have neither lsb_release nor xdg-open as standard. >> Same probably applies to BSD. > :-) That doesn't come as a surprise considering that they are "Linux" > Standards Base. These parts are not terribly linux specific, and deal with desktop systems that are commonly used on BSD too. The "Linux" part is more branding between the big commercial desktops than that it is about operating systems.

It's particularly disappointing in the case of the xdg* utilities, which are supposed to be applicable to any unix system with a mainstream desktop. Hell, they could even be shimmed onto Windows.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys: Very true, and I see Linux fragmentation become more and more of a problem. Many people…
Graeme Geldenhuys wrote 5 lines
> Linux unification is IMHO further away then in the 1997-2000 timeframe. I agree. Some things have improved, but others have not. And with every Tom, Dick and Harry wanting his own "distro" doesn't help the cause much.

Funny to hear this from someone who rolls his own GUI toolkit instead of using the LCL :-)

Michael.

Reply by email

Ludo Brands
to Mark Morgan Lloyd: Yes, but for cases where lsb_release might not work- e.g. an older release- does…
Show quoted text 16 lines
>> Can somebody confirm this for Ubuntu? Are there comparable files for >> other distreax? > > Both my Ubuntu 8.04.4 and Ubuntu 10.04.3 systems have the lsb_release > and the xdg-open commands available. So I guess that's +1 to Canonical > for at least trying to be helpful! Yes, but for cases where lsb_release might not work- e.g. an older release- does apt/sources.list refer to a section of their repository by name or simply as "stable" etc.?

apt/sources.list for my ubuntu 10.04 64 bit refers to fe.

deb http://us.archive.ubuntu.com/ubuntu/ lucid-security main restricted

Kubuntu (ubuntu with KDE desktop) 10.04 32 bit and Xubuntu 10.04 (with XFCE4) point to the same repositories.

From older versions, I remember similar names containing ubuntu and the

codename (hardy, dapper, etc).

Ludo

Reply by email

Mark Morgan Lloyd
to Ludo Brands
Ludo Brands wrote 22 lines
>>> Can somebody confirm this for Ubuntu? Are there comparable > files for >>> other distreax? >> Both my Ubuntu 8.04.4 and Ubuntu 10.04.3 systems have the > lsb_release >> and the xdg-open commands available. So I guess that's +1 > to Canonical >> for at least trying to be helpful! > Yes, but for cases where lsb_release might not work- e.g. an older > release- does apt/sources.list refer to a section of their > repository by > name or simply as "stable" etc.? > apt/sources.list for my ubuntu 10.04 64 bit refers to fe. deb http://us.archive.ubuntu.com/ubuntu/ lucid-security main restricted Kubuntu (ubuntu with KDE desktop) 10.04 32 bit and Xubuntu 10.04 (with XFCE4) point to the same repositories. >From older versions, I remember similar names containing ubuntu and the codename (hardy, dapper, etc).

So with luck Ubuntu will either have lsb_release on newer systems, or a codename embedded in apt/sources.list on older ones.

All bets are off if access is through a proxy with non-standard names.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: Funny to hear this from someone who rolls his own GUI toolkit instead of using the LCL :-)
Michael Van Canneyt wrote
Funny to hear this from someone who rolls his own GUI toolkit instead of using the LCL :-)

Yeah, yeah. :) I think we can safely say there is a huge difference in project scale. "whole OS" vs "gui toolkit".

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Michael Schneider
to Mark Morgan Lloyd: Noting your earlier comments on both lsb_release and xdg-open, the first thing I'd say is…
Mark Morgan Lloyd wrote 27 lines
Taking that into account, I thought it worth taking a closer look at a number of systems. Slackware x86 8.1 with desktop: neither lsb_release nor xdg-open. Slackware x86 13.37 with desktop: no lsb_release, does have xdg-open. Debian armel Lenny headless: neither lsb_release nor xdg-open. Debian armel Lenny with desktop: neither lsb_release nor xdg-open. Debian armel Squeeze with desktop: has lsb_release, no xdg-open. Debian mipsel Squeeze with desktop: has lsb_release, no xdg-open. Debian zSeries Lenny with desktop: neither lsb_release nor xdg-open. Debian x86 Lenny with desktop: neither lsb_release nor xdg-open. Debian x86 Squeeze with desktop: both lsb_release and xdg-open. Debian SPARC Etch with desktop: both lsb_release and xdg-open. Debian SPARC Lenny with desktop: both lsb_release and xdg-open. Solaris (8 and 10) have neither lsb_release nor xdg-open as standard. Same probably applies to BSD.

just out of curiosity
is
cat /etc/*-release

working?

Reply by email

Alexsander Rosa
to Graeme Geldenhuys: Very true, and I see Linux fragmentation become more and more of a problem. Many people…

We motivate our customers to use Ubuntu if they decide to go the Linux route. (2)

2011/8/1 Graeme Geldenhuys

Show quoted text 22 lines
On 08/01/2011 12:49 PM, Marco van de Voort wrote: > > Of course, due to Linux' fragmentation, the standards are most needed on > Linux too :-) Very true, and I see Linux fragmentation become more and more of a problem. Many people would like to move off Windows for all kinds of reasons, it's just that the thousands of Linux distros just don't seem to want that business. Go figure! Luckily we are in a franchising business, so we can control out deployment OS with some control. We motivate our franchisees to use Ubuntu if they decide to go the Linux route. At least that way our support staff can help them for free. > Linux unification is IMHO further away then in the 1997-2000 timeframe. I agree. Some things have improved, but others have not. And with every Tom, Dick and Harry wanting his own "distro" doesn't help the cause much.
Atenciosamente, Alexsander da Rosa http://rednaxel.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110801/9468edd5/attachment.html>

Reply by email

Mark Morgan Lloyd
to Michael Schneider: just out of curiosity is cat /etc/*-release working?
Michael Schneider wrote 33 lines
Am Monday 01 August 2011 11:58:33 schrieb Mark Morgan Lloyd: > Taking that into account, I thought it worth taking a closer > look at a number of systems. > > Slackware x86 8.1 with desktop: neither lsb_release nor xdg-open. > > Slackware x86 13.37 with desktop: no lsb_release, does have xdg-open. > > Debian armel Lenny headless: neither lsb_release nor xdg-open. > > Debian armel Lenny with desktop: neither lsb_release nor xdg-open. > > Debian armel Squeeze with desktop: has lsb_release, no xdg-open. > > Debian mipsel Squeeze with desktop: has lsb_release, no xdg-open. > > Debian zSeries Lenny with desktop: neither lsb_release nor xdg-open. > > Debian x86 Lenny with desktop: neither lsb_release nor xdg-open. > > Debian x86 Squeeze with desktop: both lsb_release and xdg-open. > > Debian SPARC Etch with desktop: both lsb_release and xdg-open. > > Debian SPARC Lenny with desktop: both lsb_release and xdg-open. > > Solaris (8 and 10) have neither lsb_release nor xdg-open as standard. > Same probably applies to BSD. just out of curiosity is cat /etc/*-release working?

On e.g. x86 Lenny, no. Sorry I can't test in much more detail right now- gto problems.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Alberto Narduzzi
to Mark Morgan Lloyd

here, on a "sligthly" old Fedora 7:

cat /etc/*-release gives the following:

Fedora release 7 (Moonshine)

and lsb_release -a (of course, we ask for "-a" to have a handful of information...) gives:

LSB Version:
:core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch

Distributor ID: Fedora
Description: Fedora release 7 (Moonshine)
Release: 7
Codename: Moonshine

both installed by default. And we are talking about something at least 3.5 years old... go figure.

Just my 2c.

Cheers, A.

Reply by email