Skip to content

Commit 11f4b17

Browse files
committed
Refactor code structure and remove redundant sections for improved readability and maintainability
1 parent 151c59e commit 11f4b17

27 files changed

Lines changed: 151 additions & 95 deletions

.clang-format

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# ro-Control clang-format configuration
3-
# CI bu dosyayı kullanır; değişirse tüm C++ kaynakları yeniden formatlanmalıdır.
4-
# Kullanım:
3+
# CI uses this file. When it changes, reformat the full C++ source tree.
4+
# Usage:
55
# find src \( -name "*.cpp" -o -name "*.h" \) -print0 | xargs -0 clang-format -i
66

77
BasedOnStyle: LLVM

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ Describe the bug clearly.
2323
## Environment
2424

2525
- Distribution:
26+
- Distribution version:
2627
- Desktop session:
2728
- GPU:
2829
- Driver version:
2930
- ro-Control version:
3031

3132
## Logs or screenshots
33+
34+
## Regression?
35+
36+
- [ ] This worked in an earlier ro-Control build

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ assignees: ''
88

99
## Problem
1010

11+
Describe the current limitation or workflow pain clearly.
12+
1113
## Proposed change
1214

15+
Describe the expected user-facing behavior.
16+
1317
## Alternatives considered
1418

1519
## Additional context

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
## Summary
22

3+
State the user-facing outcome in 1-3 sentences.
4+
35
## What Changed
46

7+
-
58
-
69

710
## Validation
@@ -10,5 +13,8 @@
1013
- [ ] Tests passed
1114
- [ ] UI checked if applicable
1215
- [ ] Translations updated if applicable
16+
- [ ] Packaging and metadata checked if applicable
1317

1418
## Notes
19+
20+
Mention follow-up work, risk, or anything intentionally left out.

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,13 @@ jobs:
157157
exit 1
158158
fi
159159
160+
cp "${MAIN_RPM}" /tmp/ro-control-x86_64.rpm
161+
cp "${COMMON_RPM}" /tmp/ro-control-common-noarch.rpm
162+
160163
- name: Install and smoke-test RPMs
161164
run: |
162-
MAIN_RPM="$(find ~/rpmbuild/RPMS -maxdepth 2 -type f -name 'ro-control-*.x86_64.rpm' | head -n1)"
163-
COMMON_RPM="$(find ~/rpmbuild/RPMS -maxdepth 2 -type f -name 'ro-control-common-*.noarch.rpm' | head -n1)"
165+
MAIN_RPM=/tmp/ro-control-x86_64.rpm
166+
COMMON_RPM=/tmp/ro-control-common-noarch.rpm
164167
165168
dnf clean all
166169
dnf -y --refresh --setopt=install_weak_deps=False install "${MAIN_RPM}" "${COMMON_RPM}"

.github/workflows/release.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,17 @@ jobs:
168168
--define "upstream_version ${VERSION}" \
169169
--define "dist .fc${FEDORA_VERSION}"
170170
171-
find ~/rpmbuild/RPMS -maxdepth 2 -type f -name "${MAIN_RPM_PATTERN}" -exec cp {} dist/rpm/ \;
172-
find ~/rpmbuild/RPMS -maxdepth 2 -type f -name "${COMMON_RPM_PATTERN}" -exec cp {} dist/rpm/ \;
171+
MAIN_RPM_FILE="$(find ~/rpmbuild/RPMS -maxdepth 2 -type f -name "${MAIN_RPM_PATTERN}" | head -n1)"
172+
if [[ -z "${MAIN_RPM_FILE}" ]]; then
173+
echo "Failed to find built ${RPM_ARCH} main RPM." >&2
174+
exit 1
175+
fi
176+
cp "${MAIN_RPM_FILE}" "dist/rpm/ro-control-${RPM_ARCH}.rpm"
177+
178+
COMMON_RPM_FILE="$(find ~/rpmbuild/RPMS -maxdepth 2 -type f -name "${COMMON_RPM_PATTERN}" | head -n1)"
179+
if [[ -n "${COMMON_RPM_FILE}" ]]; then
180+
cp "${COMMON_RPM_FILE}" "dist/rpm/ro-control-common-noarch.rpm"
181+
fi
173182
174183
if [[ "${RPM_ARCH}" == "x86_64" ]]; then
175184
cp ~/rpmbuild/SRPMS/*.src.rpm dist/rpm/
@@ -180,9 +189,8 @@ jobs:
180189
VERSION: ${{ needs.metadata.outputs.version }}
181190
RPM_ARCH: ${{ matrix.arch }}
182191
run: |
183-
RPM_PATTERN="*.${RPM_ARCH}.rpm"
184-
RPM_FILE="$(find dist/rpm -maxdepth 1 -type f -name "${RPM_PATTERN}" | head -n1)"
185-
if [[ -z "${RPM_FILE}" ]]; then
192+
RPM_FILE="dist/rpm/ro-control-${RPM_ARCH}.rpm"
193+
if [[ ! -f "${RPM_FILE}" ]]; then
186194
echo "Failed to locate built ${RPM_ARCH} RPM." >&2
187195
exit 1
188196
fi
@@ -200,15 +208,15 @@ jobs:
200208
env:
201209
RPM_ARCH: ${{ matrix.arch }}
202210
run: |
203-
MAIN_RPM_FILE="$(find dist/rpm -maxdepth 1 -type f -name "ro-control-*.${RPM_ARCH}.rpm" | head -n1)"
204-
COMMON_RPM_FILE="$(find dist/rpm -maxdepth 1 -type f -name 'ro-control-common-*.noarch.rpm' | head -n1)"
211+
MAIN_RPM_FILE="dist/rpm/ro-control-${RPM_ARCH}.rpm"
212+
COMMON_RPM_FILE="dist/rpm/ro-control-common-noarch.rpm"
205213
206-
if [[ -z "${MAIN_RPM_FILE}" ]]; then
214+
if [[ ! -f "${MAIN_RPM_FILE}" ]]; then
207215
echo "Main ro-control RPM is missing." >&2
208216
exit 1
209217
fi
210218
211-
if [[ -z "${COMMON_RPM_FILE}" ]]; then
219+
if [[ ! -f "${COMMON_RPM_FILE}" ]]; then
212220
echo "ro-control-common noarch RPM is missing." >&2
213221
exit 1
214222
fi
@@ -229,17 +237,15 @@ jobs:
229237
VERSION: ${{ needs.metadata.outputs.version }}
230238
RPM_ARCH: ${{ matrix.arch }}
231239
run: |
232-
RPM_PATTERN="*.${RPM_ARCH}.rpm"
233-
NOARCH_PATTERN="*.noarch.rpm"
234-
RPM_FILE="$(find dist/rpm -maxdepth 1 -type f -name "${RPM_PATTERN}" | head -n1)"
235-
NOARCH_FILE="$(find dist/rpm -maxdepth 1 -type f -name "${NOARCH_PATTERN}" | head -n1)"
240+
RPM_FILE="dist/rpm/ro-control-${RPM_ARCH}.rpm"
241+
NOARCH_FILE="dist/rpm/ro-control-common-noarch.rpm"
236242
237-
if [[ -z "${RPM_FILE}" ]]; then
243+
if [[ ! -f "${RPM_FILE}" ]]; then
238244
echo "Failed to locate built ${RPM_ARCH} RPM for smoke testing." >&2
239245
exit 1
240246
fi
241247
242-
if [[ -z "${NOARCH_FILE}" ]]; then
248+
if [[ ! -f "${NOARCH_FILE}" ]]; then
243249
echo "Failed to locate ro-control-common noarch RPM for smoke testing." >&2
244250
exit 1
245251
fi

.github/workflows/rpm-artifacts.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ jobs:
131131
exit 1
132132
fi
133133
134-
cp "${MAIN_RPM_FILE}" dist/rpm/
134+
cp "${MAIN_RPM_FILE}" "dist/rpm/ro-control-${RPM_ARCH}.rpm"
135135
136136
COMMON_RPM_FILE="$(find ~/rpmbuild/RPMS -maxdepth 2 -type f -name "${COMMON_RPM_PATTERN}" | head -n1)"
137137
if [[ -n "${COMMON_RPM_FILE}" ]]; then
138-
cp "${COMMON_RPM_FILE}" dist/rpm/
138+
cp "${COMMON_RPM_FILE}" "dist/rpm/ro-control-common-noarch.rpm"
139139
fi
140140
141141
- name: Validate metadata and RPM dependency surface
@@ -145,8 +145,8 @@ jobs:
145145
desktop-file-validate data/icons/io.github.projectroasd.rocontrol.desktop
146146
appstreamcli validate --no-net data/icons/io.github.projectroasd.rocontrol.metainfo.xml
147147
148-
MAIN_RPM_FILE="$(find dist/rpm -maxdepth 1 -type f -name "ro-control-*.${RPM_ARCH}.rpm" | head -n1)"
149-
COMMON_RPM_FILE="$(find dist/rpm -maxdepth 1 -type f -name 'ro-control-common-*.noarch.rpm' | head -n1)"
148+
MAIN_RPM_FILE="dist/rpm/ro-control-${RPM_ARCH}.rpm"
149+
COMMON_RPM_FILE="dist/rpm/ro-control-common-noarch.rpm"
150150
151151
rpm -qpR "${MAIN_RPM_FILE}" | tee /tmp/ro-control.requires
152152
if grep -E 'Qt_6\.10|PRIVATE_API' /tmp/ro-control.requires; then
@@ -155,7 +155,7 @@ jobs:
155155
fi
156156
157157
rpm -qpl "${MAIN_RPM_FILE}" | grep -Fx '/usr/bin/ro-control'
158-
if [[ -n "${COMMON_RPM_FILE}" ]] && rpm -qpl "${COMMON_RPM_FILE}" | grep -Fx '/usr/bin/ro-control'; then
158+
if [[ -f "${COMMON_RPM_FILE}" ]] && rpm -qpl "${COMMON_RPM_FILE}" | grep -Fx '/usr/bin/ro-control'; then
159159
echo "/usr/bin/ro-control must only be shipped by the main RPM." >&2
160160
exit 1
161161
fi

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ cmake --build build --parallel
2929
ctest --test-dir build --output-on-failure
3030
```
3131

32+
Fedora contributors can use:
33+
34+
```bash
35+
./scripts/fedora-bootstrap.sh
36+
```
37+
3238
## Style
3339

3440
- keep English as the source language in code

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
Native Qt6/QML desktop application for NVIDIA driver management and Linux system monitoring.
44

5+
Primary packaging target:
6+
7+
- Fedora 43 KDE Plasma
8+
- x86_64 and aarch64
9+
510
## Overview
611

712
ro-Control focuses on three things:
@@ -35,6 +40,12 @@ cmake --build build --parallel
3540
ctest --test-dir build --output-on-failure
3641
```
3742

43+
On Fedora development hosts, you can also bootstrap dependencies with:
44+
45+
```bash
46+
./scripts/fedora-bootstrap.sh
47+
```
48+
3849
## Packaging
3950

4051
The repository includes:

data/helpers/ro-control-helper.sh.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ run_allowed_command() {
6363
if [ "$#" -ge 1 ] && [ "$1" = "--batch" ]; then
6464
tab="$(printf '\t')"
6565

66+
# Each batch line is tab-separated: command<TAB>arg1<TAB>arg2...
6667
while IFS= read -r command_line || [ -n "${command_line}" ]; do
6768
[ -z "${command_line}" ] && continue
6869

6970
old_ifs="${IFS}"
7071
IFS="${tab}"
72+
# shellcheck disable=SC2086
7173
set -- ${command_line}
7274
IFS="${old_ifs}"
7375

0 commit comments

Comments
 (0)