Commit f6be4b74 authored by Ram-Z's avatar Ram-Z

Sort repeated pkgs by version

parent 326895c3
......@@ -166,7 +166,7 @@ rm_old_pkgs() {
local -a duplicates
local -a repeated=( $(printf "%s\n" "${pkgnames[@]}" | sort | uniq --repeated) )
for p in ${repeated[@]}; do
local -a pkg=( $(ls /chakra/_repo/$CHROOT/$p*z) )
local -a pkg=( $(ls -v /chakra/_repo/$CHROOT/$p*z) )
# drop last element
unset pkg[${#pkg[@]}-1]
......@@ -179,7 +179,7 @@ rm_old_pkgs() {
local -a pkgname_sigs=( ${filename_sigs[@]%-*-*-*} )
local -a repeated_sigs=( $(printf "%s\n" "${pkgname_sigs[@]}" | sort | uniq --repeated) )
for p in ${repeated_sigs[@]}; do
local -a sign=( $(ls /chakra/_repo/$CHROOT/$p*sig) )
local -a sign=( $(ls -v /chakra/_repo/$CHROOT/$p*sig) )
# drop last element
unset sign[${#sign[@]}-1]
......@@ -193,7 +193,7 @@ rm_old_pkgs() {
newline
warning "There are old version of the following package(s) in the local repository:"
(cd /chakra/_repo/$CHROOT/ && ls ${repeated[@]/%/*.xz})
(cd /chakra/_repo/$CHROOT/ && ls -v ${repeated[@]/%/*.xz})
newline
rm -i ${duplicates[@]}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment