diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-07-29 07:31:39 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-07-29 07:33:23 +0000 |
commit | c07db665ec5d4f37dded17091a65ade56f689b11 (patch) | |
tree | 87680bd9f13e4a09e38ce8fe75a45fbce4bb91e3 /abuild.in | |
parent | 8f93ada4aca100b20d2ba3534b7c45119521db08 (diff) | |
download | abuild-c07db665ec5d4f37dded17091a65ade56f689b11.tar.gz abuild-c07db665ec5d4f37dded17091a65ade56f689b11.tar.bz2 abuild-c07db665ec5d4f37dded17091a65ade56f689b11.tar.xz abuild-c07db665ec5d4f37dded17091a65ade56f689b11.zip |
abuild: only update config.sub if our version is newer
and exit with error if not
Diffstat (limited to 'abuild.in')
-rwxr-xr-x | abuild.in | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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() { |