From 9a35dc0351e7843fcbba4f3f54c5b773ff28f215 Mon Sep 17 00:00:00 2001 From: strahi-linux Date: Thu, 27 Jun 2024 15:08:28 +0200 Subject: [PATCH] Fixed legacy package installation --- scripts/index.py | 3 ++- scripts/package_assets.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/index.py b/scripts/index.py index 6ba7554..74baf6a 100644 --- a/scripts/index.py +++ b/scripts/index.py @@ -68,7 +68,8 @@ def index_release_to_elasticsearch(es : Elasticsearch, index_name, release_detai 'updated_at' : asset['updated_at'], 'category': 'Software Development Kit', 'download_link': asset['url'], # Adjust as needed for actual URL - 'package_changed': True + 'package_changed': True, + 'install_location' : "%APPLICATION_DATA_DIR%/sdk" } # Index the document diff --git a/scripts/package_assets.py b/scripts/package_assets.py index 8d257ff..81d27ed 100644 --- a/scripts/package_assets.py +++ b/scripts/package_assets.py @@ -11,14 +11,14 @@ def zip_directory(data): dirToZip, version = data source_dir = f"packages/{dirToZip}" - result_dir = f"temp/{source_dir}/v{version}" + result_dir = f"temp/{source_dir}/legacy-{dirToZip}" print(f"Starting to copy files from {source_dir} to {result_dir}...") shutil.copytree(source_dir, result_dir, dirs_exist_ok=True) print(f"Files copied successfully to {result_dir}.") archive_name = f"{os.path.dirname(result_dir)}/{dirToZip}.7z" print(f"Starting to create archive {archive_name}...") with py7zr.SevenZipFile(archive_name, mode='w') as z: - z.writeall(result_dir, f"v{version}") + z.writeall(result_dir, f"legacy-{dirToZip}") print(f"Archive {archive_name} created successfully.") return archive_name @@ -46,7 +46,7 @@ async def upload_release_asset(session, token, repo, tag_name, asset_path): async def main(token, repo, tag_name): print("Number of CPU cores available:", os.cpu_count()) - + dirs_to_process = os.listdir("./packages") print(f"Found directories: {dirs_to_process}") zip_data = [prepare_zip_data(dir) for dir in dirs_to_process] @@ -70,7 +70,7 @@ async def main(token, repo, tag_name): parser.add_argument("repo", help="Repository name, e.g., 'username/repo'") parser.add_argument("tag_name", help="Tag name from the release") args = parser.parse_args() - + print("Starting the upload process...") asyncio.run(main(args.token, args.repo, args.tag_name)) print("Upload process completed.")