27 Commits

Author SHA1 Message Date
dramforever 90bd2ffbb4 scripts/update-package: Push .changes file to track commit
Push a .changes file to track the commit and directory used, which
should end up showing up in the RPM changelog.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-05-21 11:03:33 +08:00
dramforever 2beb696141 scripts/update-package: Track changed files better
Use git diff --max-depth to track changed files on the SPECS/* directory
level, and trigger updates using one $AFTER_COMMIT per package instead
of imprecisely asking OBS to just re-run services on file modifications.

This should fix the problem of triggering the same package (e.g. linux)
way too many times.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-05-21 11:03:33 +08:00
dramforever 50c096e917 scripts/remoteassetify.py: Fix one message going to stdout
These messages must never go to stdout. Use the message() function
instead.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-05-09 16:51:57 +08:00
dramforever 55948da794 scripts/remoteassetify.py: Also handle Patch* sources
This is useful for downloading patch files from the internet.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-05-07 12:53:38 +08:00
dramforever d1befdf161 scripts/remoteassetify.py: Call curl with URL after double dash
This script is not a security barrier, so command injection really isn't
a concern, but this is still a pedantic but nontheless valid correctness
fix.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-05-06 15:25:47 +08:00
dramforever d116d3c6e1 scripts/remoteassetify.py: Remove some unused f-strings
Fix ruff lints.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-05-06 15:25:47 +08:00
dramforever 09284d4373 scripts/remoteassetify.py: Fix f-string compatibility
Make f-string usage compatible with Python < 3.12, where quotes are
restricted to be compatible with plain string syntax.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-05-06 15:25:47 +08:00
dramforever 983e0f2535 scripts/remoteassetify.py: Do not strip stdin
Remove call to strip() while reading spec from stdin to avoid incorrect
detection of spec_noeol and patch generation at start or end of file.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-05-06 15:25:47 +08:00
dramforever ba46c4ce75 scripts/remoteassetify.py: Static type fixes
Fix problems found by ty check.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-04-30 13:11:47 +08:00
dramforever a756cf41c8 scripts/remoteassetify.py: Change the user agent
I really do mean just "change". Apparently some servers don't like the
original one because of some keyword matches. I'm not sure which ones,
but hopefully this shorter one is less likely to trip one of those
checks.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-04-28 16:11:26 +08:00
dramforever a994d29926 scripts/remoteassetify.py: Fix typo in help message
Fix typo .py -> .spec

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-04-22 14:39:26 +08:00
dramforever dbb7c29742 scripts/remoteassetify.py: Remove diff --git line from patch
This is not actually necessary. Don't pretend to be Git.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-04-22 14:39:26 +08:00
dramforever b16f8ae976 scripts/remoteassetify.py: Restrict protocol to http(s)
Avoid having curl send weird requests.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-04-20 10:22:41 +08:00
dramforever 8881bce761 scripts/remoteassetify.py: Improve error message for weird URLs
Print warning instead of filtering URL if a weird URL is found, to avoid
erroring out.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-04-20 10:22:41 +08:00
dramforever ef0c47d980 scripts/remoteassetify.py: Handle %if*, %else, %endif
Old-ish versions of RPM fail fatally with an error with stuff like two
different Name keys, which we use sometimes for bootstrap. Add %if\w*,
%else, %endif to GOOD to handle these.

However, we do want to enable as many lines as possible. Therefore,
replace "%if*" with "%if 1" so that stuff like "%if %{with bootstrap}"
gets included.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-04-14 16:38:17 +08:00
dramforever 46ab85bc67 scripts/remoteassetify.py: Handle failed downloads
Handle failed downloads (including HTTP errors) by reporting them.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-04-13 16:02:12 +08:00
dramforever 03e87142fe scripts/remoteassetify.py: Add workflow command support
Add support for printing some messages as workflow commands.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-04-13 16:02:12 +08:00
dramforever 4b1922522c scripts/remoteassetify.py: Make enosys optional
This is not yet available in Ubuntu 24.04, sadly. Add an option
--unsafe-optional-enosys to allow running without enosys.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-04-13 16:02:12 +08:00
dramforever 1f6eb96bdb scripts/remoteassetify: Add script
Add a script for automatically updating #!RemoteAsset lines. This
contains some atrocious RPM spec hacks, so hopefully it works.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
2026-04-10 19:16:02 +08:00
Z572 bca1aa3346 CI: Stricter packageing requirements 2026-04-08 11:05:15 +08:00
Z572 1048283d24 .github: update-package: Update apiurl.
Signed-off-by: Zheng Junjie <zhengjunjie@iscas.ac.cn>
2026-03-25 20:22:42 +08:00
Z572 f412b72c19 .github: Add update-package.yaml. 2026-02-28 11:46:57 +08:00
yyjeqhc 79b08a1338 pre-commit: enhance reuse headers check. 2026-01-26 16:28:48 +08:00
Z572 7e7fdf10b6 scripts: check remoteasset: Add cases with source:. 2025-12-30 14:43:05 +00:00
Z572 f1dac13b3e scripts: check remoteasset: Add cases with attached sha256. 2025-12-30 14:43:05 +00:00
Z572 bec4ec0bf1 scripts: check remoteasset: Add %{url} case. 2025-12-30 14:43:05 +00:00
lzyprime 12f53a69dc .pre-commit-config.yaml: add source with #!RemoteAsset check. 2025-12-11 09:52:15 +08:00