Skip to content

Commit

Permalink
Revert "remove system-skip-chunks image"
Browse files Browse the repository at this point in the history
This reverts commit 8381ab2.
  • Loading branch information
andiradulescu committed Sep 12, 2024
1 parent 1f9ae66 commit a4f0acb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 13 additions & 4 deletions src/utils/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,19 @@ export class Image {
constructor(json) {
this.name = json.name
this.sparse = json.sparse
this.checksum = json.hash
this.fileName = `${this.name}-${json.hash_raw}.img`
this.archiveUrl = json.url
this.size = json.size

if (this.name === 'system') {
this.checksum = json.alt.hash
this.fileName = `${this.name}-skip-chunks-${json.hash_raw}.img`
this.archiveUrl = json.alt.url
this.size = json.alt.size
} else {
this.checksum = json.hash
this.fileName = `${this.name}-${json.hash_raw}.img`
this.archiveUrl = json.url
this.size = json.size
}

this.archiveFileName = this.archiveUrl.split('/').pop()
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/utils/manifest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ for (const [branch, manifestUrl] of Object.entries(config.manifests)) {
})

if (image.name === 'system') {
test('system image', () => {
expect(image.sparse, 'system image to not be sparse').toBe(false)
test('alt image', () => {
expect(image.sparse, 'system image to be sparse').toBe(true)
expect(image.fileName, 'system image to be skip chunks').toContain('-skip-chunks-')
expect(image.archiveUrl, 'system image to point to skip chunks').toContain('-skip-chunks-')
})
}

Expand Down

0 comments on commit a4f0acb

Please sign in to comment.