Skip to content

Commit

Permalink
scheds-git: Replace patch loop with git loop
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Gorski <[email protected]>
  • Loading branch information
sirlucjan committed Feb 8, 2024
1 parent 7a6569d commit 17c9848
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
8 changes: 4 additions & 4 deletions scx-scheds-git/.SRCINFO
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Generated by makepkg 6.0.2
# Sat Jan 27 16:53:12 UTC 2024
# Thu Feb 8 22:10:51 UTC 2024
pkgbase = scx-scheds-git
pkgdesc = sched_ext schedulers
pkgver = 0.1.6.r10.g46ba590
pkgrel = 1
pkgver = 0.1.6.r57.g73c68c6
pkgrel = 3
url = https://github.com/sched-ext/scx
arch = x86_64
license = GPL-2.0-only
Expand All @@ -18,7 +18,7 @@ pkgbase = scx-scheds-git
depends = bpf
depends = libelf
depends = zlib
provides = scx-scheds=0.1.6.r10.g46ba590
provides = scx-scheds=0.1.6.r57.g73c68c6
conflicts = scx-scheds
options = !lto
backup = etc/default/scx
Expand Down
27 changes: 18 additions & 9 deletions scx-scheds-git/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

pkgname=scx-scheds-git
gitname=scx
pkgver=0.1.6.r10.g46ba590
pkgrel=1
pkgver=0.1.6.r57.g73c68c6
pkgrel=3
pkgdesc="sched_ext schedulers"
arch=('x86_64')
url="https://github.com/sched-ext/scx"
Expand All @@ -18,6 +18,12 @@ options=(!lto)
provides=("scx-scheds=$pkgver")
conflicts=("scx-scheds")

_backports=(
)

_reverts=(
)

pkgver() {
cd $gitname
git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
Expand All @@ -26,13 +32,16 @@ pkgver() {
prepare() {
cd $gitname

local src
for src in "${source[@]}"; do
src="${src%%::*}"
src="${src##*/}"
[[ $src = *.patch ]] || continue
echo "Applying patch $src..."
patch -Np1 < "../$src"
local _c _l
for _c in "${_backports[@]}"; do
if [[ "${_c}" == *..* ]]; then _l='--reverse'; else _l='--max-count=1'; fi
git log --oneline "${_l}" "${_c}"
git cherry-pick --mainline 1 --no-commit "${_c}"
done
for _c in "${_reverts[@]}"; do
if [[ "${_c}" == *..* ]]; then _l='--reverse'; else _l='--max-count=1'; fi
git log --oneline "${_l}" "${_c}"
git revert --mainline 1 --no-commit "${_c}"
done
}

Expand Down

0 comments on commit 17c9848

Please sign in to comment.