<commit_before>#
# Java runtime environment file
# https://github.com/spoonapps/spoonme/tree/master/java
#
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0

meta title="jre"
meta namespace="oracle"
meta name="jre"

using wget,python:3.4.1

cmd pip install requests --quiet

workdir c:\
cmd mkdir c:\Workspace

batch
 echo import sys > getRelease.py
 echo import requests >> getRelease.py
 echo import re >> getRelease.py
 echo r = requests.get('http://java.com/en/download/manual.jsp') >> getRelease.py
 echo version = list(re.findall('Recommended Version (\d*) Update (\d*)', r.text)[0]) >> getRelease.py
 echo url = [re.findall('for Windows Offline^" href=^"(.*)^"', r.text)[0]] >> getRelease.py
 echo print(version + url) >> getRelease.py

cmd python getRelease.py

var data = last

cmd "python -c ""print(%data%[0])"""
var version = last

cmd "python -c ""print(%data%[1])"""
var update = last

cmd "python -c ""print(%data%[2])"""
var url = last

var tag = version + "u" + update

cmd wget -O setup.exe --no-check-certificate url

cmd "setup.exe /s"

cmd cd c:\

cmd rmdir c:\Workspace /s /q
cmd rmdir c:\wget /s /q


meta tag=tag<commit_msg>Working jre script<commit_after>#
# Java runtime environment file
# https://github.com/spoonapps/spoonme/tree/master/java
#
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0

meta title="jre"
meta namespace="oracle"
meta name="jre"

using wget,python:3.4.1

cmd pip install requests --quiet

workdir c:\
cmd mkdir c:\Workspace

batch
 echo import sys > getRelease.py
 echo import requests >> getRelease.py
 echo import re >> getRelease.py
 echo r = requests.get('http://java.com/en/download/manual.jsp') >> getRelease.py
 echo version = list(re.findall('Recommended Version (\d*) Update (\d*)', r.text)[0]) >> getRelease.py
 echo url = [re.findall('for Windows Offline^" href=^"(.*)^"', r.text)[0]] >> getRelease.py
 echo print(version + url) >> getRelease.py

cmd python getRelease.py

var data = last

cmd "python -c ""print(%data%[0])"""
var version = last

cmd "python -c ""print(%data%[1])"""
var update = last

cmd "python -c ""print(%data%[2])"""
var url = last

var tag = version + "." + update

cmd "wget -O setup.exe --no-check-certificate %url%"

cmd "setup.exe /s"

workdir c:\

cmd rmdir c:\Workspace /s /q
cmd rmdir c:\wget /s /q
# this path contains symlinks and currenlty they are not properly supported in vm
# so remove it 
cmd rmdir c:\ProgramData\Oracle /s /q

env path="@PROGRAMFILESX86@\java\jre1." + version + ".0_" + update + "\bin\"

meta tag=tag
{'fraction_non_alphanumeric': 0.1637897967011891, 'fraction_numerical': 0.010740314537782892, 'mean_word_length': 4.02504816955684, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7103690', 'n_tokens_mistral': 933, 'n_tokens_neox': 910, 'n_words': 278}