# pkg-analyzer **Repository Path**: shiloong/pkg-analyzer ## Basic Information - **Project Name**: pkg-analyzer - **Description**: A tool help to analyze the package similarity among given Linux distro, by checking the NVR of package. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-07-17 - **Last Updated**: 2022-07-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # The package similarity analyzer A simple analyzer help to check the similarity among Linux distroes. Now it only support the rpm packages, by comparing the Name and Version. ## Requirements - python3 is needed to run this tool; - `repoquery' command is needed, which can be install by 'dnf install yum-utils'; - root permission is needed for distro in ISO image. ## Usage ``` $./pkg_analyzer -h usage: pkg_analyzer [-h] -a DISTROA -b DISTROB [DISTROB ...] Package Similarity Analyzer optional arguments: -h, --help show this help message and exit -a DISTROA, --distroA DISTROA distro A source repo, ISO or URL -b DISTROB [DISTROB ...], --distroB DISTROB [DISTROB ...] distro B source repo, ISO or URL ``` ## Examples ### 1. Check the package similarity between distro by ISO: `./pkg_analyzer -a Fedora-Server-dvd-x86_64-33-1.2.iso -b Fedora-Server-dvd-x86_64-29-1.2.iso` The results: ```bash =============================================================== PACKAGES : TOTAL SAME_NAME SAME_NAME_&_VERSION ----------------------:---------------------------------------- distro A : 1770 -- -- distro B : 2980 1550 504 [SIMILARITY: A vs B ] : -- 87.57% 28.47% =============================================================== ``` ### 2. Check the package similarity between distro by remote yum repo: `./pkg_analyzer -a https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/30/Server/source/tree/ -b https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/29/Server/source/tree/` The results: ```bash =============================================================== PACKAGES : TOTAL SAME_NAME SAME_NAME_&_VERSION ----------------------:---------------------------------------- distro A : 1690 -- -- distro B : 1666 1602 1149 [SIMILARITY: A vs B ] : -- 94.79% 67.99% =============================================================== ``` ### 3. Check the package similarity among multiple distroes: `./pkg_analyzer -a https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/29/Everything/source/tree/ -b https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/30/Everything/source/tree/ https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/31/Everything/source/tree/https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/32/Everything/source/tree/ https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/33/Everything/source/tree/` ```bash =============================================================== PACKAGES : TOTAL SAME_NAME SAME_NAME_&_VERSION ----------------------:---------------------------------------- distro A : 21847 -- -- distro B0 : 21292 20619 16279 [SIMILARITY: A vs B0] : -- 94.38% 74.51% ----------------------:---------------------------------------- distro B1 : 21192 10 6 distro B2 : 20934 10 1 distro B3 : 20965 6 0 [SIMILARITY: A vs B*] : -- 94.50% 74.55% =============================================================== ``` ## TODO 1. to support multiple repo in url for the repo without "Everything" repo; 2. add more dimension of similarity calculation.