1 |
commit: 497edc4c920a2a01f91e5af51f118d21ef0b140a |
2 |
Author: Kenton Groombridge <concord <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 1 18:23:13 2022 +0000 |
4 |
Commit: Kenton Groombridge <concord <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 3 13:07:37 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=497edc4c |
7 |
|
8 |
Make release-userspace script prefer pkgdev |
9 |
|
10 |
Use pkgdev and pkgcheck if they are available and fallback to repoman |
11 |
otherwise. |
12 |
|
13 |
Signed-off-by: Kenton Groombridge <concord <AT> gentoo.org> |
14 |
|
15 |
gentoo/release-userspace.sh | 27 ++++++++++++++++++++++----- |
16 |
1 file changed, 22 insertions(+), 5 deletions(-) |
17 |
|
18 |
diff --git a/gentoo/release-userspace.sh b/gentoo/release-userspace.sh |
19 |
index 93565f23..4b81d2fd 100644 |
20 |
--- a/gentoo/release-userspace.sh |
21 |
+++ b/gentoo/release-userspace.sh |
22 |
@@ -21,6 +21,9 @@ sys-apps/restorecond |
23 |
# app-admin/setools not released together |
24 |
# dev-python/sepolgen became selinux-python in 2.7 release |
25 |
|
26 |
+SCAN="$(command -v pkgcheck || command -v repoman)" |
27 |
+COMMIT="$(command -v pkgdev || command -v repoman)" |
28 |
+ |
29 |
usage() { |
30 |
echo "Usage: $0 <release date> <newversion>" |
31 |
echo "" |
32 |
@@ -51,6 +54,20 @@ die() { |
33 |
exit 2 |
34 |
} |
35 |
|
36 |
+# scan the tree for QA issues with pkgcheck or repoman |
37 |
+doScan() { |
38 |
+ if [[ "$(basename "${SCAN}")" == "pkgcheck" ]]; then |
39 |
+ "${SCAN}" -q scan --staged |
40 |
+ else |
41 |
+ "${SCAN}" -q full |
42 |
+ fi |
43 |
+} |
44 |
+ |
45 |
+# commit the current staged changes with pkgdev or repoman |
46 |
+doCommit() { |
47 |
+ "${COMMIT}" -q commit -m "${@}" |
48 |
+} |
49 |
+ |
50 |
# set the release date in the live ebuilds so it will be correct when copying to the new version |
51 |
updateLiveEbuilds() { |
52 |
local PKG |
53 |
@@ -80,10 +97,10 @@ updateLiveEbuilds() { |
54 |
# commit changes |
55 |
git add "${PN}-9999.ebuild" |
56 |
git --no-pager diff --cached |
57 |
- repoman -q full |
58 |
+ doScan |
59 |
if [[ $? -eq 0 ]] |
60 |
then |
61 |
- repoman -q commit -m "$PKG: update live ebuild" |
62 |
+ doCommit "$PKG: update live ebuild" |
63 |
else |
64 |
git reset -- . |
65 |
fi |
66 |
@@ -112,14 +129,14 @@ createEbuilds() { |
67 |
sed -i -e "/${PN}-${NEWVERSION//_/-}/d" Manifest || die |
68 |
cp ${PN}-9999.ebuild ${PN}-${NEWVERSION}.ebuild || die |
69 |
|
70 |
- repoman -q manifest || die |
71 |
+ "${COMMIT}" -q manifest || die |
72 |
git add Manifest ${PN}-${NEWVERSION}.ebuild || die |
73 |
|
74 |
#git --no-pager diff --cached |
75 |
- repoman -q full |
76 |
+ doScan |
77 |
if [[ $? -eq 0 ]] |
78 |
then |
79 |
- repoman -q commit -m "$PKG: bump to ${NEWVERSION}" || die |
80 |
+ doCommit "$PKG: bump to ${NEWVERSION}" || die |
81 |
else |
82 |
git reset -- . || die |
83 |
fi |