This repository has been archived by the owner on Sep 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenerate_modulemd_with_hashes.sh
executable file
·65 lines (61 loc) · 1.83 KB
/
generate_modulemd_with_hashes.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
source ./config.sh
module=$1
echo "Generating modulemd for $module"
{
cat << EOF
document: modulemd
version: 1
data:
summary: $module module
description: This $module module has been generated.
license:
module:
- MIT
dependencies:
buildrequires:
EOF
for dep in $(cat "$topdir/modules/$module/modular-build-deps.txt"); do
echo " $dep: $buildrequires_ref"
done
cat << EOF
requires:
EOF
for dep in $(cat "$topdir/modules/$module/modular-deps.txt"); do
echo " $dep: $requires_ref"
done
cat << EOF
references:
community: https://docs.pagure.org/modularity/
documentation: https://github.com/modularity-modules/$module
tracker: https://github.com/modularity-modules/$module
api:
rpms:
EOF
for pkg in $(cat "$topdir/modules/$module/all/toplevel-binary-packages.txt"); do
echo " - $pkg"
done
cat << EOF
profiles:
default:
description: A generated profile based on top-lvl package list.
rpms:
EOF
for pkg in $(cat "$topdir/modules/$module/all/toplevel-binary-packages.txt"); do
echo " - $pkg"
done
cat << EOF
components:
rpms:
EOF
for pkg in $(cat "$topdir/modules/$module/all/runtime-source-packages-full.txt"); do
echo " ${pkg%-*-*}:"
echo " rationale: Generated."
ref=$(./get_package_hashes.py $(echo $pkg | sed -e "s/\(.*\).src$/\1/") | sed -e "s/^.*:\([^)]*\))/\1/")
if [ -n "$ref" ]; then
echo " ref: $ref"
else
echo " ref: $components_ref"
fi
done
} > "$topdir/modules/$module/$module.yaml"