summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-07-29 07:31:39 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-07-29 07:33:23 +0000
commitc07db665ec5d4f37dded17091a65ade56f689b11 (patch)
tree87680bd9f13e4a09e38ce8fe75a45fbce4bb91e3
parent8f93ada4aca100b20d2ba3534b7c45119521db08 (diff)
downloadabuild-c07db665ec5d4f37dded17091a65ade56f689b11.tar.bz2
abuild-c07db665ec5d4f37dded17091a65ade56f689b11.tar.xz
abuild: only update config.sub if our version is newer
and exit with error if not
-rwxr-xr-xabuild.in15
1 files 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() {