From 0176926757c60d0f3a4b37b01b0be1d8b8f861b2 Mon Sep 17 00:00:00 2001 From: Lingchao Xin Date: Tue, 17 Dec 2013 11:13:58 +0800 Subject: [PATCH] Tune how to get ks or packages with a consistent format Now all files piled in MD5SUMS are in same format: 2122cfefa3a73e073f73a0662adcc2bb *tizen_20131217.2_ivi-min-efi-i586-sdb.raw.bz2 And all of them have same names in file list as in MD5SUMS. Change-Id: I6780d1a47a62f3b57a4fcf14877be8c615d6786a --- snapdiff/image.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/snapdiff/image.py b/snapdiff/image.py index 53babae..3146768 100644 --- a/snapdiff/image.py +++ b/snapdiff/image.py @@ -15,16 +15,11 @@ def _get_file(url, suffix='.ks'): lines = response.content.split('\n') for line in lines: if suffix in line: - # ks is named tizen_xxxxxxxx.x_x.ks in MD5SUMS - # while other files are named their real names :>o< - if suffix == '.ks': - ks = line.split()[-1].split('_')[-1] - else: - ks = line.split()[-1].split('*')[-1] - f_response = requests.get(url + '/' + ks) + target = line.split('*')[-1] + f_response = requests.get(url + '/' + target) if f_response.status_code == 200: # use StringIO to keep wrapped lines - return ks, StringIO(f_response.content).readlines() + return target, StringIO(f_response.content).readlines() break else: files = glob.glob(os.path.join(url, '*'+suffix)) -- 2.34.1