diff --git a/.gitignore b/.gitignore index c9af961..1938052 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ !/tmp.out/.keep /tmp.in/* !/tmp.in/.keep +/.venv diff --git a/in b/in index 04c2717..1172b34 100755 --- a/in +++ b/in @@ -17,6 +17,7 @@ import os import shutil import requests import semver +import re root = os.path.dirname(os.path.abspath(__file__)) config = json.loads(sys.stdin.read()) @@ -48,6 +49,10 @@ for packages_data_block in packages_data_blocks: if package['Package'] != config['source']['package']: continue + match_result = re.search(r'(\d+\.\d+\.\d+)(\w+-\d*)', package['Version']) + if (match_result): + package['Version'] = match_result.group(1) + '-' + match_result.group(2) + if semver.compare(version, package['Version']) != 0: continue @@ -63,9 +68,9 @@ package_uri = config['source']['repo_uri'] \ package_filename = package_uri.rsplit('/', 1)[1] package_filepath = directory + '/' + package_filename -with requests.get(package_uri, stream = True) as r: - with open(package_filepath, 'wb') as f: - shutil.copyfileobj(r.raw, f) +#with requests.get(package_uri, stream = True) as r: +# with open(package_filepath, 'wb') as f: +# shutil.copyfileobj(r.raw, f) with open(directory + '/filemane', 'wb') as f: f.write(package_filename.encode()) diff --git a/requirements.txt b/requirements.txt index 67e5938..debda84 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ charset-normalizer==2.0.12 idna==3.3 iso8601==1.0.2 pytz==2021.3 -PyYAML==6.0 +PyYAML==6.0.2 requests==2.27.1 semver==2.13.0 typing==3.7.4.3