Commit 96634338 authored by PoroCYon's avatar PoroCYon
Browse files

only update installed packages

parent a498244c
......@@ -13,14 +13,15 @@ EOF
)
}
# TODO: src-db getver $pkg?
read_pkg_version() {
local EPKG=$(escape_string "$1")
< "$SSPT_SRC_DB_FILE" grep -E "^$EPKG " | grep -E -v -o "^$EPKG "
}
update_package() {
local PKG="$1"
local BEFORE="$2"
if [ -z "$BEFORE" ]; then
# TODO: src-db getver $pkg?
local EPKG=$(escape_string "$PKG")
BEFORE=$(< "$SSPT_SRC_DB_FILE" grep -E "^$EPKG " | grep -E -v -o "^$EPKG ")
fi
local BEFORE="$(read_pkg_version)"
exec_subcommand pkgcmd pull "$PKG"
local AFTER=$(exec_subcommand pkgcmd version "$PKG")
......@@ -50,7 +51,7 @@ update_selection() {
local ALLARGS=("$@")
for PKG in "${ALLARGS[@]}"; do
if ! update_package "$PKG" ""; then
if ! update_package "$PKG"; then
echo "$PKG" >> /tmp/upgrade_list
fi
done
......@@ -61,14 +62,11 @@ update_selection() {
update_all() {
touch /tmp/upgrade_list
while read -r PKG_AND_VER; do
local PKG=$(echo "$PKG_AND_VER" | grep -E -o "^[A-Za-z0-9_\.\-]*")
local BEFORE=$(echo "$PKG_AND_VER" | grep -E -o "[A-Za-z0-9_\.\-]*$")
if ! update_package "$PKG" "$BEFORE"; then
while read -r PKG; do
if ! update_package "$PKG"; then
echo "$PKG" >> /tmp/upgrade_list
fi
done < "$SSPT_SRC_DB_FILE"
done < "$SSPT_BIN_DB_FILE"
upgrade_pkgs
}
......
Supports Markdown
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