Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a script to generate rpm manifest #289

Merged
merged 1 commit into from
Jun 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions LINK/usr/bin/generate_rpm_manifest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

manifest_dir=$APPLIANCE_SOURCE_DIRECTORY/../manifest
mkdir -p $manifest_dir

pushd $manifest_dir
manifest=rpm_manifest_$(date +"%m%d%y").csv

# dnf command gives yum repo used to install rpm
dnf list --installed | tr -s " " | while read name_arch version license
do
if [[ "$name_arch" == "Installed" ]]; then continue; fi
IFS=. read name arch <<< $name_arch
echo -e "$name\t$version\t$license" >> dnf_list
done
sort -o dnf_list dnf_list
bdunne marked this conversation as resolved.
Show resolved Hide resolved

# rpm command gives rpm license info
rpm -qa --qf '%{name}\t%{version}-%{release}.%{arch}\t"%{license}"\n' |sort > rpm_list
sed -i '/^gpg-pubkey/d' rpm_list

echo "name,version,license,repo" > $manifest
join -j 1 -o 1.1,1.2,1.3,2.3 -t $'\t' -a 1 rpm_list dnf_list >> $manifest
sed -i 's/\t/,/g' $manifest
rm -f rpm_list dnf_list
popd