Skip to content

Commit

Permalink
fish: Add cbl_upd_lnx_c
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Jan 24, 2024
1 parent 4bacd21 commit 14c44e3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 deletions.
24 changes: 6 additions & 18 deletions fish/functions/cbl_test_llvm_linux.fish
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,16 @@ function cbl_test_llvm_linux -d "Test stable and mainline Linux with all support
set targets mainline stable
end

for target in $targets
switch $target
case mainline
set folder $CBL_BLD_C/linux
if not test -d $folder
mkdir -p (dirname $folder)
git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ $folder
end
cbl_upd_lnx_c $targets

set -a linux_folders $folder

case stable
set base $CBL_BLD_C/linux-stable
cbl_upd_stbl_wrktrs $base

set -a linux_folders $base-$CBL_STABLE_VERSIONS
end
if contains mainline $targets
set -a linux_folders $CBL_BLD_C/linux
end
if contains stable $targets
set -a linux_folder $CBL_BLD_C/linux-stable-$CBL_STABLE_VERSIONS
end

for linux_folder in $linux_folders
git -C $linux_folder pull --rebase

for ver in (korg_llvm latest $LLVM_VERSIONS_KERNEL_STABLE)
if not test -x $CBL_TC_LLVM_STORE/$ver/bin/clang-(string split -f 1 -m 1 . $ver)
print_error "LLVM $ver not available in $CBL_TC_LLVM_STORE!"
Expand Down
33 changes: 33 additions & 0 deletions fish/functions/cbl_upd_lnx_c.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env fish
# SPDX-License-Identifier: MIT
# Copyright (C) 2024 Nathan Chancellor

function cbl_upd_lnx_c -d "Update $CBL_BLD_C to the latest versions"
set targets $argv
if test -z "$targets"
set targets mainline stable
end

for target in $targets
switch $target
case m mainline
set folder $CBL_BLD_C/linux

if not test -d $folder
mkdir -p (dirname $folder)
git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git $folder
end

git -C $folder pull
or return
case s stable
set folder $CBL_BLD_C/linux-stable

cbl_upd_stbl_wrktrs $folder

for folder in $CBL_BLD_C/linux-stable-$CBL_STABLE_VERSIONS
git -C $folder reset --hard @{u}
end
end
end
end

0 comments on commit 14c44e3

Please sign in to comment.