mirror of
https://github.com/edu4rdshl/archlinux-pkgrecover.git
synced 2026-07-17 23:24:46 +00:00
Final fixes
This commit is contained in:
parent
ad7f1f70a9
commit
fea9035a11
1 changed files with 15 additions and 1 deletions
|
|
@ -45,6 +45,8 @@ using_pacman_db() {
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
mapfile -t matching_packages < <(echo "${matching_packages[@]}" | tr ' ' '\n' | sort -u)
|
||||||
|
|
||||||
# $2 is the dry-run flag, if set, just print the packages, else reinstall them piped to pacman
|
# $2 is the dry-run flag, if set, just print the packages, else reinstall them piped to pacman
|
||||||
if [[ $2 == "--dry-run" ]]; then
|
if [[ $2 == "--dry-run" ]]; then
|
||||||
echo "The following packages will be reinstalled:"
|
echo "The following packages will be reinstalled:"
|
||||||
|
|
@ -67,7 +69,19 @@ using_paclog() {
|
||||||
check_date_format "$1"
|
check_date_format "$1"
|
||||||
|
|
||||||
# Get the list of packages upgraded after the given date
|
# Get the list of packages upgraded after the given date
|
||||||
mapfile -t matching_packages < <(paclog --after "$1" | grep -oE "upgraded (\S+)" | cut -d ' ' -f 2)
|
mapfile -t paclog_matching_packages < <(paclog --after "$1" | grep -oE "(upgraded|installed) (\S+)" | cut -d ' ' -f 2 | sort -u)
|
||||||
|
mapfile -t installed_packages < <(pacman -Qq)
|
||||||
|
|
||||||
|
matching_packages=()
|
||||||
|
|
||||||
|
# Find the common elements between the two arrays
|
||||||
|
for pkg in "${paclog_matching_packages[@]}"; do
|
||||||
|
for installed_pkg in "${installed_packages[@]}"; do
|
||||||
|
if [[ "$pkg" == "$installed_pkg" ]]; then
|
||||||
|
matching_packages+=("$pkg")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
# $2 is the dry-run flag, if set, just print the packages, else reinstall them piped to pacman
|
# $2 is the dry-run flag, if set, just print the packages, else reinstall them piped to pacman
|
||||||
if [[ $2 == "--dry-run" ]]; then
|
if [[ $2 == "--dry-run" ]]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue