# vim: se ft=zsh:

cd
rm -rf linux.old
mv linux linux.old
~/soft/lilac/scripts/yaourt-G linux-lts
mv linux{-lts,}

cd linux.old
mkdir ../linux/src
mv src/archlinux-linux ../linux/src
vimdiff PKGBUILD ../linux/PKGBUILD

cd ../linux/src/archlinux-linux
git clean -xdf
git fetch --all
git fetch --tags archlinux
git co -b lily-6.19 v6.19.11-arch1

patch -p1 < ~/cjktty-6.19.patch
git add .
git commit -m 'apply cjktty patch'
patch -p1 < ~/cjktty-add-cjk32x32-font-data.patch
git add .
git commit -m 'apply cjktty 32x32 font data'

cp ../../config.x86_64 .config
patch .config ~/archgitrepo/archlinuxcn/linux-lily/config.diff.6.16.4
make clean oldconfig
diff -Naur ../../config.x86_64 .config > ../../config.diff.6.19.11
vim ../../config.diff.6.19.11

cd ../..
# 升级 gcc
command makepkg

for f in ./*.pkg.tar.zst(om[1,2]); do gpg --detach-sign $f; done
cp -l ./*.pkg.tar.zst(|.sig)(om[1,4]) ~/repo/
