Skip to content

Commit

Permalink
优化wpi-update,现可在更新时从清华源下载依赖包
Browse files Browse the repository at this point in the history
  • Loading branch information
sc-bin committed Jul 24, 2024
1 parent af0e76d commit 7c42b6b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 22 deletions.
3 changes: 2 additions & 1 deletion main/walnutpi1b-patch/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Package: walnutpi1b-patch
Description: walnutpi1b patch
Version: 1.0.4
Version: 1.0.5
Maintainer: sc-bin <[email protected]>
Section: free
Priority: optional
Installed-Size: 304
Architecture: all
Depends: btop
18 changes: 9 additions & 9 deletions server/dists/bookworm/Release
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Architectures: all arm64
Codename: bookworm
Components: main
Date: Mon, 08 Jul 2024 07:17:58 +0000
Date: Wed, 24 Jul 2024 01:37:14 +0000
Description: Your description
Label: Walnut Pi
Origin: Walnut Pi
Suite: stable
MD5Sum:
28ff6e52a107518e4a0348f9f578e028 178 Release
107d4e4c55c08bace7ed3aa4ae347527 15434 main/binary-all/Packages
7f2cd5c56f0e8e19bef34303dc5ac6ca 178 Release
7086e9afb1069ee0bf70f34b0095b82c 15448 main/binary-all/Packages
3ab14929d57c8552a4a5f0039fbbf631 2978 main/binary-arm64/Packages
SHA1:
8f1967f810c1404988126cb73fd56dedd6704dc6 178 Release
93fd71ac1092dd44f3593167e137d0c642b13830 15434 main/binary-all/Packages
ceb7759743d7d9b268787e5d306a5dbe2a441192 178 Release
907d57b701279c60d99cb755d3a2653b09f7f968 15448 main/binary-all/Packages
a643059d0038ce9a5e67f498af89223ee7006736 2978 main/binary-arm64/Packages
SHA256:
eca8de721565d18162dc0cad3784548485182fd9379dfb16680b4723a403a089 178 Release
342093eb176dcd9f1d7afcb682d3434189c966b4767577f49f4081408579e29d 15434 main/binary-all/Packages
7fc61cd5b7df03bccafe6dbab236eefd132cc3a4c3803f220f1323144bbc90f4 178 Release
1cd85a683705ef561a524b9e6a2e7374d6e517897b14c0860c6a229e1848d0ac 15448 main/binary-all/Packages
49243767594ddc321666e9791eed4e8868e890555dad0829d277031170b6f03b 2978 main/binary-arm64/Packages
SHA512:
4617283154d8a3bbdf4e73e11058468fbec8c4fbe5c9325ce698e16663d0fd5e92782eb337ea66c3f08abe3a23875c8730d4a06e019303a3d6661cb7cdbf2ffc 178 Release
1ad52754379647df5a67e3fd5f705fba9995ea7c83aabcb35e633b5d3692e81e3c77b84a8364169328c495efe41853931e33b7c433fd08953896bb45c055a429 15434 main/binary-all/Packages
63676aa960cbad0f27f1bd9d8179ac05140c5f802fb2c71f3ec2944dcd05bf870edd93591ac8724cd8db292ecc3fb5fe6e4d743ed161e9bfee7991da6dca117a 178 Release
c510eb65a124547b49148dd4a74a59896da901b4c66aee58cbabd2960f078d11e49a73ed3fec3681f9d0fbb0ca97e562a8eb2d0bc22a4f6a84ee90678aee6715 15448 main/binary-all/Packages
bf9c129ab9fdf608fa0ae1cb5b6e0768d660976c8490537ceefcdff3bcc4c1c011c272532d3d2a84670b6eab24f0638e32841669ff61ca4a10e84abd127cb1f0 2978 main/binary-arm64/Packages
13 changes: 7 additions & 6 deletions server/dists/bookworm/main/binary-all/Packages
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,16 @@ Priority: optional
Description: walnutpi 1b desktop

Package: walnutpi1b-patch
Version: 1.0.4
Version: 1.0.5
Architecture: all
Maintainer: sc-bin <[email protected]>
Installed-Size: 304
Filename: main/walnutpi1b-patch_1.0.4_all.deb
Size: 56280
MD5sum: a98c636f7563c22350f52eb474e6dc80
SHA1: a586d637323f623f067125a571929b3e3f997054
SHA256: 50a040e5c632484be5c6f42fa6cc3b1051b0b7d5ebb55cf7c29686946d8fc227
Depends: btop
Filename: main/walnutpi1b-patch_1.0.5_all.deb
Size: 56300
MD5sum: bc67b836c7abcbc94df977cc36663fad
SHA1: 44fa951dd9bdfe4522772c0dec7e2c1f3424ec04
SHA256: 4b6b6b45849522f058a5113da18ca6a8fa83f51343f9cedd5ce03c747fd6e638
Section: free
Priority: optional
Description: walnutpi1b patch
Expand Down
Binary file added server/main/walnutpi1b-patch_1.0.5_all.deb
Binary file not shown.
15 changes: 10 additions & 5 deletions server/wpi-update
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#!/bin/bash
THIS_SCRIPT_VERSION=1.4
THIS_SCRIPT_VERSION=1.5
SERVER_DOMAIN="apt.walnutpi.com"
THIS_SCRIPT_URL="http://${SERVER_DOMAIN}//debian/wpi-update.gz"
THIS_SCRIPT_SAVE="/tmp/wpi-update.gz"
THIS_SCRIPT_FILE="/tmp/wpi-update"

SOURCE_STR="deb [trusted=yes] http://${SERVER_DOMAIN}//debian/ bookworm main"
SOURCE_STR_WALNUTPI="deb [trusted=yes] http://${SERVER_DOMAIN}//debian/ bookworm main"
SOURCE_STR_TSINGHUA="deb http://mirrors.tuna.tsinghua.edu.cn/debian bookworm main"
if [ -f /proc/device-tree/model ];then
BOARD_MODEL=$(tr -d '\0' < /proc/device-tree/model)
PATCH_LIST_URL="http://${SERVER_DOMAIN}/debian/patch-list/${BOARD_MODEL}.gz"
fi
TMP_SOURCE_FILE="/tmp/wpi-update-source"
TMP_SOURCE_FILE_WPI="/tmp/wpi-update-source-wpi"
LOG_URL_CN="http://${SERVER_DOMAIN}/debian/release-cn.log"
LOG_URL_EN="http://${SERVER_DOMAIN}/debian/release-en.log"
LOG_URL=""
Expand All @@ -21,6 +23,7 @@ FILE_PACKAGES="/tmp/wpi-update-packages.txt"
[[ -f $THIS_SCRIPT_SAVE ]] && rm $THIS_SCRIPT_SAVE
[[ -f $THIS_SCRIPT_FILE ]] && rm $THIS_SCRIPT_FILE
[[ -f $TMP_SOURCE_FILE ]] && rm $TMP_SOURCE_FILE
[[ -f $TMP_SOURCE_FILE_WPI ]] && rm $TMP_SOURCE_FILE_WPI
[[ -f $FILE_LOG_SAVE ]] && rm $FILE_LOG_SAVE
[[ -f $FILE_PACKAGES ]] && rm $FILE_PACKAGES

Expand Down Expand Up @@ -113,7 +116,9 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi

echo $SOURCE_STR > $TMP_SOURCE_FILE
echo -e "$SOURCE_STR_WALNUTPI \n" > $TMP_SOURCE_FILE_WPI
echo -e "$SOURCE_STR_WALNUTPI \n" > $TMP_SOURCE_FILE
echo -e "$SOURCE_STR_TSINGHUA \n" >> $TMP_SOURCE_FILE
COMMAND=$1
COMMAND_VALUE=$2

Expand Down Expand Up @@ -150,7 +155,7 @@ case $COMMAND in
;;
install)

run_status "get the package info ..." apt-get update -o Dir::Etc::sourcelist="$TMP_SOURCE_FILE" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
run_status "get the package info ..." apt-get update -o Dir::Etc::sourcelist="$TMP_SOURCE_FILE_WPI" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
apt-get install -o Dir::Etc::sourcelist="$TMP_SOURCE_FILE" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" $COMMAND_VALUE
exit 0
;;
Expand Down Expand Up @@ -262,7 +267,7 @@ done < "$file"
[[ -f $new_file ]] && package_opt "$new_file" "add" install

# 获取更新,安装
apt-get --just-print upgrade -o Dir::Etc::sourcelist="$TMP_SOURCE_FILE" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" | grep 'Inst' | cut -d ' ' -f 2 > $FILE_PACKAGES
apt-get --just-print upgrade -o Dir::Etc::sourcelist="$TMP_SOURCE_FILE_WPI" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" | grep 'Inst' | cut -d ' ' -f 2 > $FILE_PACKAGES
package_opt "$FILE_PACKAGES" "update" install


Expand Down
Binary file modified server/wpi-update.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion wpi-update
Submodule wpi-update updated from 202fd2 to 30c124

0 comments on commit 7c42b6b

Please sign in to comment.