[arkdep] Code cleanup
This commit is contained in:
parent
5582a68a22
commit
30ed9a2b90
1 changed files with 6 additions and 3 deletions
9
arkdep
9
arkdep
|
@ -724,11 +724,13 @@ diff () {
|
||||||
declare removed=()
|
declare removed=()
|
||||||
declare new=()
|
declare new=()
|
||||||
|
|
||||||
# Process new_pkgs list to generate update diff
|
# Find updated packages
|
||||||
for pkg in "${new_pkgs[@]}"; do
|
for pkg in "${new_pkgs[@]}"; do
|
||||||
# Split package name and package versions in to list
|
# Split package name and package versions in to list
|
||||||
declare spaced=($pkg)
|
declare spaced=($pkg)
|
||||||
|
|
||||||
|
# Find new packages, if a package from the new image is not in the
|
||||||
|
# package list of the current version it is new
|
||||||
if [[ ! "${old_pkgs[@]}" =~ "${spaced[0]}" ]]; then
|
if [[ ! "${old_pkgs[@]}" =~ "${spaced[0]}" ]]; then
|
||||||
new+=("${spaced[0]}")
|
new+=("${spaced[0]}")
|
||||||
continue
|
continue
|
||||||
|
@ -740,13 +742,12 @@ diff () {
|
||||||
declare old_spaced=($old_pkg)
|
declare old_spaced=($old_pkg)
|
||||||
|
|
||||||
# Find matchings packages, compare versions
|
# Find matchings packages, compare versions
|
||||||
|
# If versions do not match they have been updated/changed/downgraded
|
||||||
if [[ ${spaced[0]} == ${old_spaced[0]} ]]; then
|
if [[ ${spaced[0]} == ${old_spaced[0]} ]]; then
|
||||||
if [[ ${spaced[1]} != ${old_spaced[1]} ]]; then
|
if [[ ${spaced[1]} != ${old_spaced[1]} ]]; then
|
||||||
#printf "DIFF ${spaced[1]} >> ${old_spaced[1]}\n"
|
|
||||||
changed+=("${spaced[0]}")
|
changed+=("${spaced[0]}")
|
||||||
old_ver+=("${old_spaced[1]}")
|
old_ver+=("${old_spaced[1]}")
|
||||||
new_ver+=("${spaced[1]}")
|
new_ver+=("${spaced[1]}")
|
||||||
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -757,6 +758,8 @@ diff () {
|
||||||
for old_pkg in "${old_pkgs[@]}"; do
|
for old_pkg in "${old_pkgs[@]}"; do
|
||||||
declare old_spaced=($old_pkg)
|
declare old_spaced=($old_pkg)
|
||||||
|
|
||||||
|
# Compare all packages from new image to current package version,
|
||||||
|
# current package is not in the new_pkgs list it has been removed
|
||||||
if [[ ! "${new_pkgs[@]}" =~ "${old_spaced[0]}" ]]; then
|
if [[ ! "${new_pkgs[@]}" =~ "${old_spaced[0]}" ]]; then
|
||||||
removed+=("${old_spaced[0]}")
|
removed+=("${old_spaced[0]}")
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue