Skip to content

Commit

Permalink
更正升级软件包命令选项
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperManito committed Jan 18, 2024
1 parent d959129 commit d4e0cb3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions ChangeMirrors.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
## Author: SuperManito
## Modified: 2024-01-18
## Modified: 2024-01-19
## License: MIT
## GitHub: https://github.com/SuperManito/LinuxMirrors
## Website: https://linuxmirrors.cn
Expand Down Expand Up @@ -1002,8 +1002,8 @@ function ChangeMirrors() {
fi
}
## 更新软件包
function UpdateSoftware() {
## 升级软件包
function UpgradeSoftware() {
function CleanCache() {
## 跳过特殊系统
case "${SYSTEM_JUDGMENT}" in
Expand Down Expand Up @@ -1052,23 +1052,23 @@ function UpdateSoftware() {
;;
esac
## 交互确认
if [[ -z "${UPDATA_SOFTWARE}" ]]; then
UPDATA_SOFTWARE="false"
if [[ -z "${UPGRADE_SOFTWARE}" ]]; then
UPGRADE_SOFTWARE="false"
local CHOICE
CHOICE=$(echo -e "\n${BOLD}└─ 是否跳过更新软件包? [Y/n] ${PLAIN}")
read -rp "${CHOICE}" INPUT
[[ -z "${INPUT}" ]] && INPUT=Y
case "${INPUT}" in
[Yy] | [Yy][Ee][Ss]) ;;
[Nn] | [Nn][Oo])
UPDATA_SOFTWARE="true"
UPGRADE_SOFTWARE="true"
;;
*)
echo -e "\n$WARN 输入错误,默认不更新!"
;;
esac
fi
if [[ "${UPDATA_SOFTWARE}" == "false" ]]; then
if [[ "${UPGRADE_SOFTWARE}" == "false" ]]; then
return
fi
echo -e ''
Expand Down Expand Up @@ -4963,7 +4963,7 @@ function CommandOptions() {
--close-firewall 关闭防火墙 true 或 false
--backup 备份原有软件源 true 或 false
--ignore-backup-tips 忽略覆盖备份提示 无
--updata-software 更新软件包 true 或 false
--upgrade-software 更新软件包 true 或 false
--clean-cache 清理下载缓存 true 或 false
--print-diff 打印源文件修改前后差异 无
Expand Down Expand Up @@ -5149,11 +5149,11 @@ function CommandOptions() {
IGNORE_BACKUP_TIPS="true"
;;
## 更新软件包
--updata-software)
--upgrade-software | --updata-software)
if [ "$2" ]; then
case "$2" in
[Tt]rue | [Ff]alse)
UPDATA_SOFTWARE="${2,,}"
UPGRADE_SOFTWARE="${2,,}"
shift
;;
*)
Expand Down Expand Up @@ -5216,7 +5216,7 @@ function Combin_Function() {
BackupOriginalMirrors
RemoveOriginMirrors
ChangeMirrors
UpdateSoftware
UpgradeSoftware
RunEnd
}
Expand Down
4 changes: 2 additions & 2 deletions docs/use/command-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
| `--close-firewall` | 关闭防火墙 | `true``false` |
| `--backup` | 备份原有软件源 | `true``false` |
| `--ignore-backup-tips` | 忽略覆盖备份提示(即不覆盖备份) ||
| `--updata-software` | 更新软件包 | `true``false` |
| `--upgrade-software` | 更新软件包 | `true``false` |
| `--clean-cache` | 清理下载缓存 | `true``false` |
| `--print-diff` | 打印源文件修改前后差异 | `true``false` |
| `--help` | 查看帮助菜单 ||
Expand Down Expand Up @@ -160,7 +160,7 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \
--install-epel true \
--close-firewall true \
--backup true \
--updata-software false \
--upgrade-software false \
--clean-cache false \
--ignore-backup-tips
```

0 comments on commit d4e0cb3

Please sign in to comment.