How to make my .pet download the correct Java version?

Using applications, configuring, problems
Post Reply
Message
Author
elroy

How to make my .pet download the correct Java version?

#1 Post by elroy »

Hi,

This is a package-manager issue concerning Saluki/wary. Hopefully someone can help me with this because it’s driving me crazy. I suspect that I’m overlooking something very simple, but I can’t quite wrap my head around it. So here it goes...

I have a problem with a .pet I’ve created. It requires a version of java that’s greater than or equal to a said version; upon install (while downloading - trying to locate missing deps) it insists on downloading an earlier version. I’ve tried everything I can think of - &ge, &eq, and even &lt (just for s-and-g’s). The following are the Pet-specs of the two versions of the java Pets in question, the first is the older, undesirable version, and the second is the version I would like downloaded (at the minimum):

Code: Select all

jre-1.6u30-i586|jre|1.6u30-i586||BuildingBlock|110080K||jre-1.6u30-i586.pet||java runtime environment|puppy|wary5||

Code: Select all

jre-1.7.0-06|jre|1.7.0-06||BuildingBlock|139124K||jre-1.7.0-06.pet||Java Web Start|puppy|wary5||
And here’s the Pet specs of the package in question, with the &ge flag set:

Code: Select all

tuxguitar-1.2|tuxguitar|1.2||Multimedia|8640K||tuxguitar-1.2.pet|+fluidsynth,+jack-audio-connection-kit,+jre&ge1.7.0-06|Write/play-back guitar tablature|puppy|wary5||
Regardless which flags I choose, it only offers to download the older 1.6u30-i586 version.

Any help would be greatly appreciated. Thank you in advance.

User avatar
Monsie
Posts: 631
Joined: Thu 01 Dec 2011, 07:37
Location: Kamloops BC Canada

How to make my .pet download the correct Java version?

#2 Post by Monsie »

Hi elroy,

This is an interesting problem...

I looked at some of the source code and I see that the tuxguitar shell script searches for the version of Java that you have installed on your system... and even tries to guess at other locations than those found in various operating systems. Having found this, here is what I would do:
  • install or load Java 1.7x
    edit tuxguitar.sh in the source code to include the path and variables for Java 1.7x
    re-compile Tux Guitar from source, then build your pet from that
It looks like you might also have to have to include the path for SeaMonkey in the tuxguitar shell script.

Hope this helps,
Monsie
My [u]username[/u] is pronounced: "mun-see". Derived from my surname, it was my nickname throughout high school.

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#3 Post by npierce »

elroy wrote:Regardless which flags I choose, it only offers to download the older 1.6u30-i586 version.
I do not know why it does not offer to download the specified version. When I try the specs you supplied, PPM offers to download either version.

So I do not have an answer for that.

But the other problem -- the fact that it is offering to download a version that doesn't meet the specification -- appears to be a bug. See Some PPM versioning problems

elroy

#4 Post by elroy »

Thank you for the replies, gentlemen. You've given me some great ideas to try and sort this out. I'll update this thread if I do indeed find an answer.

elroy

#5 Post by elroy »

My solution, which actually doesn't solve the problem but does create a workable work-around, is to create a script that does nothing if java is installed, but nags the user, and exits, if it isn't...

Code: Select all

onError()
{
	yad --title="TuxGuitar" --button="gtk-close:0"  --text="Java must be installed before running TuxGuitar."
	exit 0
}

command -v java >/dev/null 2>&1 || onError
/usr/share/tuxguitar-1.2/tuxguitar &
exit 0
[/b]

In this way, if java is installed, the app works as expected. If java isn't installed, or it has been removed at some point, upon trying to run TuxGuitar an error message appears and the application exits.

The whole impetus to download the desired version of java was the fact that the said older version of java completely wiped out the /usr/lib/firefox folder when loaded as a pet. When loaded as an sfs (it's offered as both pet/sfs in the Saluki repository, and the sfs is exactly the same as the pet, just repackaged as an sfs) it doesn't display this behavior. Odd...you'd think it'd overlay in both cases, but this is not the case when used as a pet. If I could use an sfs as a dependency I would have done so as I wouldn't have had to create a newer version of java that did not display this behavior when loaded as a pet. But that is what I indeed had to do. That was why it was so frustrating that the repo wouldn't download the newer version of java by default. I didn't want Firefox users to be inconvenienced by having their .desktop file rendered useless when using the older jave pet.

So, in closing, this isn't the perfect solution. I ended up creating a newer version of java as a pet that doesn't destroy the /usr/lib/firefox folder. But in the end it's up to the end user to download the correct version. However, I believe it'd be better if this whole process was more 'idiot-proof'. The ability of dependencies to be sfs' would be nice, as would the ability of pets to run install/uninstall scripts would be key, too. Perhaps something to consider in future versions of Puppy Linux.

This is the solution I used. If you have a better idea, then please let me know.

Thank you,
elroy

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#6 Post by BarryK »

npierce wrote:
elroy wrote:Regardless which flags I choose, it only offers to download the older 1.6u30-i586 version.
I do not know why it does not offer to download the specified version. When I try the specs you supplied, PPM offers to download either version.

So I do not have an answer for that.

But the other problem -- the fact that it is offering to download a version that doesn't meet the specification -- appears to be a bug. See Some PPM versioning problems
The solution from npierce has been implemented in Woof, so will be in future puppies (such as the next Precise Puppy beta5):

http://bkhome.org/blog/?viewDetailed=02978
[url]https://bkhome.org/news/[/url]

elroy

#7 Post by elroy »

Thank you, Barry. Am looking forward to the future :)

Post Reply