diff --git a/tools/ubuntu_package_puller/README.md b/tools/ubuntu_package_puller/README.md index a9eacaf..331fcc7 100644 --- a/tools/ubuntu_package_puller/README.md +++ b/tools/ubuntu_package_puller/README.md @@ -27,8 +27,11 @@ grep ^Source /var/lib/apt/lists/*_Packages | awk ' {print $2}' | sort -u > sourc # this works for me pulling the following: # ubuntu:latest, ubuntu:22.10, ubuntu:22.04, ubuntu:20.04 -docker run ubuntu:latest /bin/bash -c "apt-get update && apt-get install lz4 && lz4cat /var/lib/apt/lists/*_Packages.lz4 | grep ^Source | cut -f 2 -d : | cut -f 2 -d ' ' | sort -u " -``` +# SEED INDIVIDUAL OS DATA TO FILE +docker run ubuntu:latest /bin/bash -c "apt-get update && apt-get install lz4 && lz4cat /var/lib/apt/lists/*_Packages.lz4 | grep ^Source | cut -f 2 -d : | cut -f 2 -d ' ' | sort -u " > ubuntu_latest_source_packages.container + +# to seed all modern ubuntu from their containers run the provided shellscript +./source_package_names.sh # it is grepping through information that is stored as follows. Below is an example from the package lvm2 diff --git a/tools/ubuntu_package_puller/export_to_json.py b/tools/ubuntu_package_puller/export_to_json.py index 83eb9bd..31aa6c5 100644 --- a/tools/ubuntu_package_puller/export_to_json.py +++ b/tools/ubuntu_package_puller/export_to_json.py @@ -4,10 +4,10 @@ import json from package_version_history import PackageVersionHistory as pvh -# start with just ubuntu 20.04 -distro_version = '20.04' +# start with just ubuntu 22.04 +distro_version = '22.04' -source_pkgs_filepath = './package_data/source_packages_remote_ubuntu_2004.default' +source_pkgs_filepath = './package_data/ubuntu_22.04_source_packages.container' source_file = open(source_pkgs_filepath, 'r') lines = source_file.readlines() @@ -27,5 +27,5 @@ json_obj = json.dumps(results) json_arr = json.loads(json_obj) # write to a file -with open('./version_history_data/ubuntu_2004_source_package_version_history.data', 'w') as outfile: +with open('./version_history_data/ubuntu_latest_source_package_version_history.container', 'w') as outfile: json.dump(json_arr, outfile, indent=4)