Skip to content

added support for java6#940

Merged
boegel merged 10 commits intoeasybuilders:developfrom
pescobar:java6
Sep 19, 2016
Merged

added support for java6#940
boegel merged 10 commits intoeasybuilders:developfrom
pescobar:java6

Conversation

@pescobar
Copy link
Copy Markdown
Member

I know this is not ready to merge. @boegel please review? :)

This is an easyconfig to test
https://gist.github.com/10a77ea9b266f3020b40bbfb8c582f51

To download java jdk6:
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/6u24-b07/jdk-6u24-linux-x64.bin

Comment thread easybuild/easyblocks/j/java.py Outdated
print self.builddir
if LooseVersion(self.version) < LooseVersion('1.7'):
# uncompress java6 to build dir
cmd = 'cd %s; yes | bash %s' % (self.builddir, self.src[0]['path'])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like you should use run_cmd_qa instead? what type of question is being asked?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what you get...you just need to press enter that's why I did the yes trick...seems simpler to me but I will implement it as you prefer...

Java(TM) SE Development Kit 6 successfully installed.

Product Registration is FREE and includes many benefits:
* Notification of new versions, patches, and updates
* Special offers on Oracle products, services and training
* Access to early releases and documentation

Product and system data will be collected. If your configuration
supports a browser, the JDK Product Registration form will
be presented. If you do not register, none of this information
will be saved. You may also register your JDK later by
opening the register.html file (located in the JDK installation
directory) in a browser.

For more information on what data Registration collects and 
how it is managed and used, see:
http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html

Press Enter to continue.....


Done.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pescobar alternatively, use the inp argument to run_cmd to specify input to stdin; you probably need to pass a space (rather than an empty string):

run_cmd(cmd, log_all=True, simple=True, inp=' ')

@boegel boegel added this to the v2.9.0 milestone May 31, 2016
@pescobar
Copy link
Copy Markdown
Member Author

I tested with a java6 easyconfig and also with a java7 easyconfig.

seem to be ready for merging

Comment thread easybuild/easyblocks/j/java.py Outdated
def extract_step(self):
"""Unpack the source"""
if LooseVersion(self.version) < LooseVersion('1.7'):
cmd = 'cd %s; bash %s' % (self.builddir, self.src[0]['path'])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pescobar please do the cd in Python, and there's no need for bash, run_cmd already runs commands in a subshell

try:
    os.chdir(self.builddir)
except OSError, err:
    raise EasyBuildError("Failed to move to build dir: %s", err)

run_cmd(self.src[0]['path'], log_all=True, simple=True, inp='')

Comment thread easybuild/easyblocks/j/java.py Outdated
try:
os.chmod(self.src[0]['path'], 0755)
except OSError, err:
raise EasyBuildError("Failed adding execution permission to java installer: %s", err)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pescobar please use adjust_permissions (from filetools):

adjust_permissions(self.src[0]['path'], stat.S_IXUSR, add=True)

Also, this will change permissions of the actual source file itself, should we worry about that (and copy it to build dir before changing permissions & running it)?

@boegel
Copy link
Copy Markdown
Member

boegel commented Sep 19, 2016

@pescobar looks good, but I'd like to see a PR for an easyconfig for Java 1.6.x so we have a test case for this?

@pescobar
Copy link
Copy Markdown
Member Author

@boegel here you have easybuilders/easybuild-easyconfigs#3577

@boegel
Copy link
Copy Markdown
Member

boegel commented Sep 19, 2016

tested with easybuilders/easybuild-easyconfigs#3577, looks good, going in, thanks @pescobar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants