Skip to content

Commit

Permalink
wiki: Add script for syncing kernel versions with GitHub
Browse files Browse the repository at this point in the history
Maintainers are sometimes upgrading their kernels...

Change-Id: I29de6f1219427b4c39c3be85fe2472aa59b20637
  • Loading branch information
luk1337 committed Dec 19, 2023
1 parent 92e01ff commit 0973c37
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/sync_kernel_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

for f in _data/devices/*.yml; do
repo=$(yq '.kernel.repo' $f)
current_branch=$(yq '.current_branch' $f)

if [ "${current_branch::2}" -gt 14 ]; then
current_branch="lineage-$current_branch"
else
current_branch="cm-$current_branch"
fi

version=$(curl -s https://raw.githubusercontent.com/LineageOS/$repo/$current_branch/Makefile | grep -E '^(VERSION|PATCHLEVEL)')
version=$(echo "$version" | xargs echo | awk '{ print $3"."$6 }')

sed -i "s/^kernel:.*/kernel: {repo: $repo, version: '$version'}/" $f
done

0 comments on commit 0973c37

Please sign in to comment.