1 |
commit: 292e03dc22ddc1d5a3bf143d311344f8cc0d9f75 |
2 |
Author: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net> |
3 |
AuthorDate: Fri Apr 2 07:16:15 2021 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net> |
5 |
CommitDate: Fri Apr 2 09:52:30 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=292e03dc |
7 |
|
8 |
.github/workflows/repoman.yml: Use script to auto run the latest rm |
9 |
|
10 |
By using a seperate script instead of running everything in the yml |
11 |
file, we gain the ability to use and manipulate variables. This |
12 |
means that we can now automatically run the latest version of |
13 |
repoman, which should make this more hands-off by removing the |
14 |
need to update this every now and then. |
15 |
|
16 |
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net> |
17 |
|
18 |
.github/workflows/pkgcheck.yml | 4 +--- |
19 |
.github/workflows/repoman.yml | 15 ++------------- |
20 |
scripts/check-duplicates.sh | 1 - |
21 |
scripts/setup-and-run-repoman.sh | 30 ++++++++++++++++++++++++++++++ |
22 |
4 files changed, 33 insertions(+), 17 deletions(-) |
23 |
|
24 |
diff --git a/.github/workflows/pkgcheck.yml b/.github/workflows/pkgcheck.yml |
25 |
index 048f17c5f..e98762769 100644 |
26 |
--- a/.github/workflows/pkgcheck.yml |
27 |
+++ b/.github/workflows/pkgcheck.yml |
28 |
@@ -10,9 +10,7 @@ jobs: |
29 |
build: |
30 |
runs-on: ubuntu-latest |
31 |
steps: |
32 |
- - name: Checkout code |
33 |
- uses: actions/checkout@v2 |
34 |
- |
35 |
+ - uses: actions/checkout@v2 |
36 |
- name: Run pkgcheck |
37 |
uses: pkgcore/pkgcheck-action@v1 |
38 |
with: |
39 |
|
40 |
diff --git a/.github/workflows/repoman.yml b/.github/workflows/repoman.yml |
41 |
index 8eb8668ad..b229afc94 100644 |
42 |
--- a/.github/workflows/repoman.yml |
43 |
+++ b/.github/workflows/repoman.yml |
44 |
@@ -11,17 +11,6 @@ jobs: |
45 |
runs-on: ubuntu-latest |
46 |
steps: |
47 |
- uses: actions/checkout@v2 |
48 |
- - name: Set up Python 3.9 |
49 |
- uses: actions/setup-python@v2 |
50 |
- with: |
51 |
- python-version: 3.9 |
52 |
- - name: Setup repoman |
53 |
- run: | |
54 |
- python -m pip install --upgrade pip |
55 |
- pip install lxml pyyaml |
56 |
- wget -qO - "https://github.com/gentoo/portage/archive/portage-3.0.12.tar.gz" | tar xz |
57 |
- sudo groupadd -g 250 portage |
58 |
- sudo useradd -g portage -d /var/tmp/portage -s /bin/false -u 250 portage |
59 |
- name: Setup master gentoo repository |
60 |
run: | |
61 |
sudo mkdir -p /var/db/repos/gentoo /etc/portage /var/cache/distfiles |
62 |
@@ -29,6 +18,6 @@ jobs: |
63 |
sudo wget "https://www.gentoo.org/dtd/metadata.dtd" -O /var/cache/distfiles/metadata.dtd |
64 |
sudo wget "https://gitweb.gentoo.org/proj/portage.git/plain/cnf/repos.conf" -O /etc/portage/repos.conf |
65 |
sudo ln -s /var/db/repos/gentoo/profiles/default/linux/amd64/17.1 /etc/portage/make.profile |
66 |
- - name: Test with repoman |
67 |
+ - name: Setup and run Repoman |
68 |
run: | |
69 |
- python3 portage-portage-3.0.12/repoman/bin/repoman full -dx |
70 |
+ ./scripts/setup-and-run-repoman.sh |
71 |
|
72 |
diff --git a/scripts/check-duplicates.sh b/scripts/check-duplicates.sh |
73 |
index 8c6743bbd..ddd63fa68 100755 |
74 |
--- a/scripts/check-duplicates.sh |
75 |
+++ b/scripts/check-duplicates.sh |
76 |
@@ -4,7 +4,6 @@ |
77 |
# |
78 |
# This checks for potential and exact package matches within an overlay & ::gentoo |
79 |
# Note that this is not going to be 100% accurate |
80 |
-# |
81 |
|
82 |
GENTOO_DIR="/var/db/repos/gentoo" |
83 |
GENTOO_PACKAGES=( |
84 |
|
85 |
diff --git a/scripts/setup-and-run-repoman.sh b/scripts/setup-and-run-repoman.sh |
86 |
new file mode 100755 |
87 |
index 000000000..f6607549d |
88 |
--- /dev/null |
89 |
+++ b/scripts/setup-and-run-repoman.sh |
90 |
@@ -0,0 +1,30 @@ |
91 |
+#! /usr/bin/env bash |
92 |
+# Maintainer: Andrew Ammerlaan <andrewammerlaan@××××××.net> |
93 |
+# |
94 |
+# This sets up repoman and runs the latest version |
95 |
+# |
96 |
+# TODO: Force repoman to output in colour |
97 |
+ |
98 |
+### Setup prerequisites |
99 |
+python3 -m pip install --upgrade pip |
100 |
+pip install lxml pyyaml |
101 |
+sudo groupadd -g 250 portage |
102 |
+sudo useradd -g portage -d /var/tmp/portage -s /bin/false -u 250 portage |
103 |
+ |
104 |
+### Sync the portage repository |
105 |
+git clone https://github.com/gentoo/portage.git |
106 |
+cd portage |
107 |
+ |
108 |
+# Get all versions, and read into array |
109 |
+mapfile -t RM_VERSIONS < <( git tag | grep repoman | sort -u ) |
110 |
+ |
111 |
+# Select latests version (last element in array) |
112 |
+RM_VERS="${RM_VERSIONS[-1]}" |
113 |
+ |
114 |
+# Checkout this version |
115 |
+git checkout tags/${RM_VERS} -b ${RM_VERS} |
116 |
+ |
117 |
+cd .. |
118 |
+ |
119 |
+### Run repoman |
120 |
+python3 portage/repoman/bin/repoman -dx full |