Skip to content

Commit 11092e0

Browse files
committed
Fix updates-repository links in build website for non-release builds
Follow-up on #3554
1 parent bc0ed6a commit 11092e0

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

sites/eclipse/build/index.html

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,14 @@ <h3 id="repository">Eclipse p2 Repository
7171
</h3>
7272
<p>
7373
To update your Eclipse installation to this development stream, you can use the software repository at
74+
<br>
75+
<code><a class="data-ref" href="${updatesP2RepositoryComposite}">${updatesP2RepositoryComposite}</a></code>
7476
</p>
75-
<ul>
76-
<li><a class="data-ref" href="https://download.eclipse.org/eclipse/updates/${releaseShort}/">https://download.eclipse.org/eclipse/updates/${releaseShort}</a></li>
77-
</ul>
7877
<p>
7978
To update your build to use this specific build, you can use the software repository at
79+
<br>
80+
<code><a class="data-ref" href="${updatesP2Repository}">${updatesP2Repository}</a></code>
8081
</p>
81-
<ul>
82-
<li><a class="data-ref" href="https://download.eclipse.org/eclipse/updates/${releaseShort}/${identifier}/">https://download.eclipse.org/eclipse/updates/${releaseShort}/${identifier}</a></li>
83-
</ul>
8482
<table class="files-table" data-path="p2Repository"></table>
8583

8684
<h3 id="eclipse-sdk">Eclipse SDK
@@ -110,7 +108,22 @@ <h3 id="swt">SWT Binary and Source
110108

111109
</main>
112110
<script>
113-
loadPageData('buildproperties.json')
111+
loadPageData('buildproperties.json', data => {
112+
data.updatesP2RepositoryComposite = `https://download.eclipse.org/eclipse/updates/${data.releaseShort}`
113+
const buildID = data.identifier
114+
const buildType = buildID.charAt(0)
115+
if (buildType == 'I' || buildType == 'Y') {
116+
data.updatesP2RepositoryComposite += `-${buildType}-builds`
117+
}
118+
if (buildType == 'S') {
119+
data.updatesP2RepositoryComposite += `-I-builds`
120+
const timestamp = buildID.substring(buildID.lastIndexOf('-') + 1, buildID.length)
121+
data.updatesP2Repository = `${data.updatesP2RepositoryComposite}/I${timestamp.substring(0, 8)}-${timestamp.substring(8, 12)}`
122+
} else {
123+
data.updatesP2Repository = `${data.updatesP2RepositoryComposite}/${buildID}`
124+
}
125+
return data
126+
})
114127

115128
contentPostProcessor = (mainElement, build) => {
116129
document.title = `${build.label} - ${document.title}`

sites/eclipse/page.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ if (typeof Intl.DurationFormat !== 'undefined') {
120120

121121
function formatRuntime(runtime) {
122122
const totalSeconds = Math.trunc(runtime);
123-
123+
124124
// Try to use Temporal API if both Temporal and DurationFormat are available (not supported in all browsers yet)
125125
if (typeof Temporal !== 'undefined' && Temporal.Duration && runtimeFormat) {
126126
try {
@@ -133,12 +133,12 @@ function formatRuntime(runtime) {
133133
// Fall through to fallback implementation
134134
}
135135
}
136-
136+
137137
// Fallback implementation for browsers without Temporal/DurationFormat support
138138
const hours = Math.floor(totalSeconds / 3600);
139139
const minutes = Math.floor((totalSeconds % 3600) / 60);
140140
const seconds = totalSeconds % 60;
141-
141+
142142
if (hours > 0) {
143143
// For durations >= 1 hour, show hours and minutes
144144
return `${hours} hr, ${minutes} min`;
@@ -163,8 +163,11 @@ function fetchAllJSON(urls) {
163163

164164
let pageData = null
165165

166-
function loadPageData(dataPath) {
166+
function loadPageData(dataPath, dataGenerator = null) {
167167
pageData = fetch(dataPath).then(res => res.json())
168+
if (dataGenerator) {
169+
pageData = pageData.then(dataGenerator)
170+
}
168171
}
169172

170173
let contentPostProcessor = (_mainElement, _contentData) => {}

0 commit comments

Comments
 (0)