Compare commits

..

2 Commits

Author SHA1 Message Date
Brett T. Warden 3db02dd609 Implement backport-<commit> target
For packages with a GitHub repo configured in options.conf, allow
downloading and applying backport patches via the 'backport-<commit>'
target. If given an abbreviated commit ID, it will still create a
backport-<commit>.patch file with the full commit hash, plus add it (if
it does not already exist) to the end of the series file.

Because this handles a single commit at a time, this should be wrappable
by a future Makefile target that applies individual commits to catch up
to a target tag, for example.
2024-12-02 16:13:06 -08:00
Arjan van de Ven 5866d7afbf update packages file 2024-11-25 21:15:54 +00:00
2 changed files with 37 additions and 0 deletions
+30
View File
@@ -582,6 +582,36 @@ cloc: $(SRPMFILE)
@$(MOCK) --clean --scrub=chroot --uniqueext=$(PKG_NAME)
cat results/cloc.txt
#help backport-<commit>: Retrieve a commit from the upstream git repository and save it as a backport patch.
#help Currently only works with GitHub repositories. The giturl is read from options.conf.
backport-%:
@commit=$*; \
echo "Backporting commit: $${commit}"; \
giturl=$$(grep -E '^giturl\s*=\s*https://github.com' options.conf | sed 's/giturl\s*=\s*//' | sed 's/\.git$$//' | sed 's/\/$$//' 2>/dev/null); \
if [[ -z "$${giturl}" ]]; then \
echo "Error: giturl not defined in options.conf"; \
exit 1; \
fi; \
if ! curl -s -L -o $@.patch $${giturl}/commit/$*.patch || [[ "Not Found" == $$(< $@.patch) ]]; then \
rm -f $@.patch; \
echo "Error: Failed to download commit $*"; \
exit 1; \
fi; \
patch=$@.patch; \
full_commit=$$(head -1 $@.patch | grep -oE '\b$*\S+' 2>/dev/null); \
if ! [[ -z "$${full_commit}" ]]; then \
patch=backport-$${full_commit}.patch; \
mv $@.patch $${patch}; \
fi; \
if [[ -s $${patch} ]]; then \
echo "$${patch} created"; \
grep -qE "^$${patch}$$" series 2>/dev/null || echo "$${patch}" >> series; \
else \
rm -f $${patch}; \
echo "Error: Failed to create backport patch"; \
exit 1; \
fi \
.PHONY: whatrequires
#help whatrequires: Output a list of packages that directly depend on this one,
#help showing the subpackage-level breakdown. Each line of output has the format
+7
View File
@@ -180,6 +180,7 @@ R-Ryacas
R-SGP
R-SGPdata
R-SQUAREM
R-SimDesign
R-Sleuth2
R-SnowballC
R-SparseM
@@ -232,6 +233,7 @@ R-bayesplot
R-bazar
R-bbmle
R-bdsmatrix
R-beepr
R-beeswarm
R-bench
R-benchr
@@ -871,6 +873,7 @@ R-rsvg
R-runjags
R-rversions
R-rvest
R-rworldmap
R-s2
R-sampling
R-sandwich
@@ -1583,6 +1586,7 @@ fsearch
fuse
fwupd
fwupd-efi
game-music-emu
garcon
gawk
gbinder-python
@@ -2260,6 +2264,7 @@ libmbim
libmediaart
libmemcached
libmicrohttpd
libmikmod
libmnl
libmodbus
libmodplug
@@ -3915,6 +3920,7 @@ pypi-decorator
pypi-deepmerge
pypi-deepspeed
pypi-dep_logic
pypi-dependency_groups
pypi-deprecated
pypi-deprecation
pypi-devpi_client
@@ -5311,6 +5317,7 @@ xrandr
xrdb
xrdp
xrestop
xscorch
xscreensaver
xsel
xset