Re: [gentoo-dev] make_desktop_entry in eutils.eclass
On Thursday 01 February 2007, Jim Ramsay wrote: > Nice. I like this idea, and humbly request that someone implement it > in this way, or give me permission to do so. that assumes format limitations ... an additional cruft argument would be more likely to be merged -mike pgpGG8puWkLxF.pgp Description: PGP signature
Re: [gentoo-dev] make_desktop_entry in eutils.eclass
Thomas de Grenier de Latour wrote: > On Wed, 31 Jan 2007 23:30:53 -0500, Mike Frysinger <[EMAIL PROTECTED]> > wrote: > > > about the only thing that'd work is an additional parameter called > > "cruft" that'd be passed unfiltered into the .desktop file > > You can also imagine a "-v" switch, which would make this function print > the full path (with its $D prefix) of the file.desktop it has created. > This way, people could do: > > src_install() { > ... > local desktop_file=$(make_desktop_entry -v ...) || die > echo "MimeType=..." >> "${desktop_file}" > ... > } > > I don't say this solution is better than the "cruft" parameter though, > it's really a matter of taste. Nice. I like this idea, and humbly request that someone implement it in this way, or give me permission to do so. -- Jim Ramsay Gentoo/Linux Developer (rox) signature.asc Description: PGP signature
Re: [gentoo-dev] make_desktop_entry in eutils.eclass
On Thursday 01 February 2007, Thomas de Grenier de Latour wrote: > local desktop_file=$(make_desktop_entry -v ...) || die semi-unrelated, this die will never be called by design, use of the local keyword overrides the exit status of the subshell in the assignment ... you'd need to write it: local desktop_file; desktop_file=$(make_desktop_entry -v ...) || die -mike pgpK63kx9l7iE.pgp Description: PGP signature
Re: [gentoo-dev] make_desktop_entry in eutils.eclass
On Wed, 31 Jan 2007 23:30:53 -0500, Mike Frysinger <[EMAIL PROTECTED]> wrote: > about the only thing that'd work is an additional parameter called > "cruft" that'd be passed unfiltered into the .desktop file You can also imagine a "-v" switch, which would make this function print the full path (with its $D prefix) of the file.desktop it has created. This way, people could do: src_install() { ... local desktop_file=$(make_desktop_entry -v ...) || die echo "MimeType=..." >> "${desktop_file}" ... } I don't say this solution is better than the "cruft" parameter though, it's really a matter of taste. -- TGL. -- gentoo-dev@gentoo.org mailing list
Re: [gentoo-dev] make_desktop_entry in eutils.eclass
On Wednesday 31 January 2007, Jim Ramsay wrote: > Personally I'd rather just add one line to my ebuild as opposed to > creating and maintaining a .desktop file in the files directory. This > would just add a useful feature for those who want that level of > flexibility. which is rarely needed/wanted i could add an option for every single aspect of the .desktop file spec but in reality, you have to draw the line somewhere the items you requested, while useful, are not nearly common enough to warrant attention on any scale about the only thing that'd work is an additional parameter called "cruft" that'd be passed unfiltered into the .desktop file -mike pgp8RYgO4Auwm.pgp Description: PGP signature
Re: [gentoo-dev] make_desktop_entry in eutils.eclass
Mike Frysinger wrote: > On Tuesday 30 January 2007 16:10, Jim Ramsay wrote: > > In other words, I propose that this function should probably do > > 'basename' on $exec before using it for the .desktop filename. > > no ... the point of using $exec is to make sure the .desktop file is unique > > i'll change it to sanitize the filename and turn them into underscores Sure, but the name is already based on $exec AND ${PN} (and SLOT too if SLOT != 0), so the uniqueness is already guaranteed per-package, it would just be a matter of the package maintainer not using the same exec twice in the same package, which probably wouldn't even happen anyway. I still think basename would be sufficient. > > I propose an optional environment variable an ebuild can set before > > calling make_desktop_entry, called "DESKTOP_BASENAME", which would be > > the basename of the file (not including the .desktop suffix) that the > > function would use (if set) to create the file. > > env vars to functions are lame In that case it could be another optional parameter instead. > > 3 - Allow me to add other important settings like 'NoDisplay', > > 'OnlyShowIn', and/or 'MimeType'. > > at this point, you might as well write your own .desktop file Personally I'd rather just add one line to my ebuild as opposed to creating and maintaining a .desktop file in the files directory. This would just add a useful feature for those who want that level of flexibility. -- Jim Ramsay Gentoo/Linux Developer (rox) signature.asc Description: PGP signature
Re: [gentoo-dev] make_desktop_entry in eutils.eclass
On Tuesday 30 January 2007 16:10, Jim Ramsay wrote: > In other words, I propose that this function should probably do > 'basename' on $exec before using it for the .desktop filename. no ... the point of using $exec is to make sure the .desktop file is unique i'll change it to sanitize the filename and turn them into underscores > I propose an optional environment variable an ebuild can set before > calling make_desktop_entry, called "DESKTOP_BASENAME", which would be > the basename of the file (not including the .desktop suffix) that the > function would use (if set) to create the file. env vars to functions are lame > 3 - Allow me to add other important settings like 'NoDisplay', > 'OnlyShowIn', and/or 'MimeType'. at this point, you might as well write your own .desktop file -mike pgpSoHUlKA305.pgp Description: PGP signature
[gentoo-dev] make_desktop_entry in eutils.eclass
I have a few suggestions for the make_desktop_entry function in eutils.eclass: 1 - Allow me to pass in a full application path. If you pass in the full path to an executable as the first argument, it comes up with a crazy filename like this: /var/tmp/portage/rox-base/mime-editor-0.5/temp//usr/lib/rox/MIME-Editor/AppRun-mime-editor.desktop When a more appropriate name would be: /var/tmp/portage/rox-base/mime-editor-0.5/temp/AppRun-mime-editor.desktop In other words, I propose that this function should probably do 'basename' on $exec before using it for the .desktop filename. 2 - Allow me to explicitly set the name of the .desktop file. This would perhaps solve #1 above as well. I propose an optional environment variable an ebuild can set before calling make_desktop_entry, called "DESKTOP_BASENAME", which would be the basename of the file (not including the .desktop suffix) that the function would use (if set) to create the file. 3 - Allow me to add other important settings like 'NoDisplay', 'OnlyShowIn', and/or 'MimeType'. I propose an optional environment variable 'DESKTOP_EXTRAS' that the ebuild could set before calling make_desktop_entry. This would be an actual verbatim (newline-delimited) copy of the extra lines to be added to the desktop file, for example: DESKTOP_EXTRAS="OnlyShowIn=Yes" or DESKTOP_EXTRAS="MimeType=text/plain NoDisplay=Yes" Any objections? Suggestions? I would be willing to add these myself if no one else is. -- Jim Ramsay Gentoo/Linux Developer (rox) signature.asc Description: PGP signature