From d3d1c8d1e5631be066a8925b9742b4278cef492e Mon Sep 17 00:00:00 2001 From: xonixx Date: Sun, 22 Dec 2024 01:23:52 +0200 Subject: [PATCH] selfupdate is broken #174 : switch to increment strategy --- Makesurefile | 2 +- makesure.awk | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makesurefile b/Makesurefile index 255eb14..865592a 100644 --- a/Makesurefile +++ b/Makesurefile @@ -4,7 +4,7 @@ @define NEXT_VERSION '0.9.23' @define GOAWK_VERSION '1.29.1' # https://github.com/benhoyt/goawk/releases @define JUST_VERSION '1.3.0' # https://github.com/casey/just/releases -@define FHTAGN_VERSION 'v0.2.0' # https://github.com/xonixx/fhtagn/releases +@define FHTAGN_VERSION 'v0.2.1' # https://github.com/xonixx/fhtagn/releases @define MDBOOK_VERSION 'v0.4.37' # https://github.com/rust-lang/mdBook/releases @define MDBOOK_LINKCHECK_VERSION 'v0.7.7' # https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases @define MDBOOKER_VERSION '11572b1' # https://github.com/xonixx/mdbooker/releases diff --git a/makesure.awk b/makesure.awk index 146ee32..521670a 100755 --- a/makesure.awk +++ b/makesure.awk @@ -742,11 +742,16 @@ function selfUpdate( tmp, err, newVer,line,good,i,found) { err = "can't check the dl result" break } - print "LINE: " line if (line ~ /^404/) { if (found) { if (!err && !ok("chmod +x " good)) err = "can't chmod +x " good - if (!err) print "updated " Version " -> " executeGetLine(good " -v") + if (!err) { + newVer = executeGetLine(good " -v") + if (!ok("cp " good " " quoteArg(Prog))) + err = "can't overwrite " Prog + else + print "updated " Version " -> " newVer + } } else print "you have latest version " Version " installed" break }