Skip to content

Commit

Permalink
Merge pull request #31 from Antiz96/fixes
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
Antiz96 authored Jun 13, 2023
2 parents 998e3d3 + d0fecfe commit 83e5677
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
4 changes: 1 addition & 3 deletions doc/man/arch-update.1
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ See https://www.freedesktop.org/software/systemd/man/systemd.time.html
.B Show packages version changes
.RB "If you want Arch-Update to show the packages version changes in the main " "update " "function, launch the following command:"
.br
.B sudo sed -i "s/ | awk '{print \$1}'//g" /usr/bin/arch-update /usr/local/bin/arch-update 2>/dev/null || true
sudo sed -i "s/ | awk '{print $1}'//g" /usr/bin/arch-update /usr/local/bin/arch-update 2>/dev/null || true
.br
.B Be aware that you'll have to relaunch that command at each arch-update's new release.

Expand All @@ -133,8 +133,6 @@ See https://www.freedesktop.org/software/systemd/man/systemd.time.html
.BR yay (8),
.BR paru (8),
.BR notify-send (1)
.br
The documentation is also available on the GitHub page https://github.com/Antiz96/arch-update

.SH BUGS
Please report bugs to the GitHub page https://github.com/Antiz96/arch-update/issues
Expand Down
31 changes: 16 additions & 15 deletions src/script/arch-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,24 @@ list_packages() {

if [ -z "${packages}" ] && [ -z "${aur_packages}" ]; then
icon_up_to_date
echo -e "No update available\n" && read -n 1 -r -s -p $'Press \"enter\" to quit\n'
echo -e "No update available\n"
orphan_packages
pacnew_files
exit 0
else
icon_updates_available
fi
read -rp $'Proceed with update? [Y/n] ' answer

read -rp $'Proceed with update? [Y/n] ' answer

case "${answer}" in
[Yy]|"")
icon_installing
;;
*)
echo -e >&2 "The update has been aborted\n" && read -n 1 -r -s -p $'Press \"enter\" to quit\n'
exit 4
;;
esac
case "${answer}" in
[Yy]|"")
icon_installing
;;
*)
echo -e >&2 "The update has been aborted\n" && read -n 1 -r -s -p $'Press \"enter\" to quit\n'
exit 4
;;
esac
fi
}

# Definition of the list_news function: Print the latest Arch news and offers to read them (used in the "update" function)
Expand Down Expand Up @@ -176,7 +177,7 @@ update() {
pacnew_files
}

# Definition of the orphan_packages function: Print orphan packages and offer to remove them if there are
# Definition of the orphan_packages function: Print orphan packages and offer to remove them if there are (used in the "list_packages" and "update" functions)
orphan_packages() {
orphan_packages=$(pacman -Qtdq)

Expand All @@ -203,7 +204,7 @@ orphan_packages() {
fi
}

# Definition of the pacnew_files function: Print pacnew files and offer to process them if there are
# Definition of the pacnew_files function: Print pacnew files and offer to process them if there are (used in the "list_packages" and "update" functions)
pacnew_files() {
pacnew_files=$(pacdiff -o)

Expand Down

0 comments on commit 83e5677

Please sign in to comment.