From 28d424bdd838821c38170fe9120b9ceec809e8da Mon Sep 17 00:00:00 2001 From: Henrik Riomar Date: Fri, 19 May 2017 17:22:17 +0200 Subject: [PATCH] apk: handle packages installed with Repository_pinning If the package is pinned the last element of the version line will contain @, strip that before getting the version number. https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management#Repository_pinning --- apk/apt-dater-host | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apk/apt-dater-host b/apk/apt-dater-host index e0c9b65..cc0a1eb 100755 --- a/apk/apt-dater-host +++ b/apk/apt-dater-host @@ -10,7 +10,7 @@ # Henrik Riomar # # Copyright Holder: -# 2016,2017 (C) Henrik Riomar +# 2016, 2017 (C) Henrik Riomar # # License: # This program is free software; you can redistribute it and/or modify @@ -71,7 +71,7 @@ get_pkg_stat() $APK_CMD info | while read -r pkg do line=$(grep -E "^${pkg}-[0-9]" $tmp) - new_ver=$(echo $line | awk '{print $NF}') + new_ver=$(echo $line | sed 's/ @.\+$//' | awk '{print $NF}') cur_ver=$(echo $line | awk '{print $1}' | sed "s/$pkg-//") if [ x"$new_ver" = x"$cur_ver" ]; then echo "STATUS: $pkg|$cur_ver|i" -- 2.13.0