-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fish: Convert cbl_upd_stable into cbl_upd_lnx_p and extend
Signed-off-by: Nathan Chancellor <[email protected]>
- Loading branch information
1 parent
1671efb
commit ddf8d3b
Showing
2 changed files
with
66 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/usr/bin/env fish | ||
# SPDX-License-Identifier: MIT | ||
# Copyright (C) 2021-2023 Nathan Chancellor | ||
|
||
function cbl_upd_lnx_p -d "Update $CBL_BLD_P to the latest versions" | ||
set targets $argv | ||
if test -z "$targets" | ||
set targets next mainline stable | ||
end | ||
|
||
for target in $targets | ||
switch $target | ||
case m mainline | ||
set -a folders $CBL_BLD_P/linux | ||
case n next | ||
set -a folders $CBL_BLD_P/linux-next | ||
case s stable | ||
set -a folders $CBL_BLD_P/linux-stable-$CBL_STABLE_VERSIONS | ||
end | ||
end | ||
|
||
for folder in $folders | ||
header "Updating $folder" | ||
|
||
if test -d $folder | ||
if is_tree_dirty $folder | ||
git -C $folder stash | ||
set pop true | ||
else | ||
set -e pop | ||
end | ||
|
||
switch $folder | ||
case '*'/linux '*'/linux-stable'*' | ||
git -C $folder pull -r | ||
case '*'/linux-next | ||
git -C $folder urbi | ||
end | ||
|
||
if string match -qr linux-stable $folder | ||
cbl_ptchmn -C $folder -s | ||
end | ||
|
||
if set -q pop | ||
git -C $folder stash pop | ||
end | ||
else | ||
if string match -qr linux-stable $folder | ||
cbl_upd_stbl_wrktrs $CBL_BLD_P/linux-stable | ||
else | ||
mkdir -p (dirname $folder) | ||
|
||
switch $folder | ||
case '*'/linux | ||
set url https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ | ||
case '*'/linux-next | ||
set url https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/ | ||
end | ||
|
||
git clone $url $folder | ||
end | ||
|
||
cbl_ptchmn -C $folder -a | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.