Skip to content

Commit

Permalink
update-system: remove checks for old releases.json format
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Leonard <[email protected]>
  • Loading branch information
antonlacon committed Mar 24, 2024
1 parent 3f09573 commit 7987d01
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions distributions/LibreELEC/filesystem/usr/bin/update-system
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,24 @@ class UpdateSystem():
self.candidate['filename'] = device_json['image']['name']
self.candidate['sha256'] = device_json['image']['sha256']
# old releases.json without subpath field
self.candidate['subpath'] = device_json['image']['subpath'] if 'subpath' in device_json['image'] else None
self.candidate['subpath'] = device_json['image']['subpath']
# old releases.json without timestamp field
self.candidate['timestamp'] = datetime.strptime(device_json['image']['timestamp'], '%Y-%m-%d %H:%M:%S') if 'timestamp' in device_json['image'] else None
self.candidate['timestamp'] = datetime.strptime(device_json['image']['timestamp'], '%Y-%m-%d %H:%M:%S')
else: # uboot entry
self.candidate['filename'] = device_json['uboot'][0]['name']
self.candidate['sha256'] = device_json['uboot'][0]['sha256']
# old releases.json without subpath field
self.candidate['subpath'] = device_json['uboot'][0]['subpath'] if 'subpath' in device_json['uboot'][0] else None
self.candidate['subpath'] = device_json['uboot'][0]['subpath']
# old releases.json without timestamp field
self.candidate['timestamp'] = datetime.strptime(device_json['uboot'][0]['timestamp'], '%Y-%m-%d %H:%M:%S') if 'timestamp' in device_json['uboot'][0] else None
self.candidate['timestamp'] = datetime.strptime(device_json['uboot'][0]['timestamp'], '%Y-%m-%d %H:%M:%S')
else: # file entry
self.candidate['filename'] = device_json['file']['name']
# Assumes filename format is 'distribution-device.arch-version.tar'
self.candidate['sha256'] = device_json['file']['sha256']
# old releases.json without subpath field
self.candidate['subpath'] = device_json['file']['subpath'] if 'subpath' in device_json['file'] else None
self.candidate['subpath'] = device_json['file']['subpath']
# old releases.json without timestamp field
self.candidate['timestamp'] = datetime.strptime(device_json['file']['timestamp'], '%Y-%m-%d %H:%M:%S') if 'timestamp' in device_json['file'] else None
self.candidate['timestamp'] = datetime.strptime(device_json['file']['timestamp'], '%Y-%m-%d %H:%M:%S')
version = tuple(int(i) for i in self.candidate['filename'].split('-')[-1].removesuffix('.tar').split('.')) if not 'devel' in self.candidate['filename'] and not 'nightly' in self.candidate['filename'] else (None, None, None)
self.candidate['version_major'] = version[0]
self.candidate['version_minor'] = version[1]
Expand Down

0 comments on commit 7987d01

Please sign in to comment.