From c07db665ec5d4f37dded17091a65ade56f689b11 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Mon, 29 Jul 2013 07:31:39 +0000 Subject: abuild: only update config.sub if our version is newer and exit with error if not --- abuild.in | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/abuild.in b/abuild.in index 8c628e2..0807e41 100755 --- a/abuild.in +++ b/abuild.in @@ -573,10 +573,21 @@ mkusers() { # helper to update config.sub to a recent version update_config_sub() { + local myver=$("$datadir"/config.sub -t | tr -d '-') + local changed=false find . -name config.sub | while read f; do - msg "Replacing ${f##*/}" - cp "$datadir"/${f##*/} "$f" || return 1 + local ver=$(./"$f" -t | tr -d '-') + if [ "$myver" -gt "$ver" ]; then + msg "Updating $f ($myver > $ver)" + cp "$datadir"/${f##*/} "$f" || return 1 + changed=true + else + msg "Not updating newer $f" + fi + # pipe subshell will return status of last command + $changed done + return $? } runpart() { -- cgit v1.2.3-60-g2f50