Fossil SCM
(cherry-pick): Correct handling of mtime updates for UV push. (cherry-pick): Moved the check for iconv(3) in -liconv up within auto.def. If it happens after the checks for OpenSSL on certain macOS configurations, autosetup can be fooled into believing it doesn't need -liconv on that platform. This checkin splits up the group of cc-check-functions calls, so the moved call is now documented as to why its segregated.
Commit
746668d58b1878ddbfa4a1b031c52f2045b6db1a869e2fe651be19c9dc1ec4b5
Parent
ae8709e2fcde39b…
4 files changed
+3
-1
+3
-1
+1
-1
+1
-1
M
auto.def
+3
-1
| --- auto.def | ||
| +++ auto.def | ||
| @@ -190,10 +190,13 @@ | ||
| 190 | 190 | } else { |
| 191 | 191 | define-append EXTRA_CFLAGS -DFOSSIL_DYNAMIC_BUILD=1 |
| 192 | 192 | define FOSSIL_DYNAMIC_BUILD |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | +# Check for libraries that need to be sorted out early | |
| 196 | +cc-check-function-in-lib iconv iconv | |
| 197 | + | |
| 195 | 198 | # Helper for OpenSSL checking |
| 196 | 199 | proc check-for-openssl {msg {cflags {}} {libs {-lssl -lcrypto}}} { |
| 197 | 200 | msg-checking "Checking for $msg..." |
| 198 | 201 | set rc 0 |
| 199 | 202 | if {[is_mingw]} { |
| @@ -458,11 +461,10 @@ | ||
| 458 | 461 | # Last resort, may be Windows |
| 459 | 462 | if {[is_mingw]} { |
| 460 | 463 | define-append LIBS -lwsock32 |
| 461 | 464 | } |
| 462 | 465 | } |
| 463 | -cc-check-function-in-lib iconv iconv | |
| 464 | 466 | cc-check-functions utime |
| 465 | 467 | cc-check-functions usleep |
| 466 | 468 | cc-check-functions strchrnul |
| 467 | 469 | |
| 468 | 470 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 469 | 471 |
| --- auto.def | |
| +++ auto.def | |
| @@ -190,10 +190,13 @@ | |
| 190 | } else { |
| 191 | define-append EXTRA_CFLAGS -DFOSSIL_DYNAMIC_BUILD=1 |
| 192 | define FOSSIL_DYNAMIC_BUILD |
| 193 | } |
| 194 | |
| 195 | # Helper for OpenSSL checking |
| 196 | proc check-for-openssl {msg {cflags {}} {libs {-lssl -lcrypto}}} { |
| 197 | msg-checking "Checking for $msg..." |
| 198 | set rc 0 |
| 199 | if {[is_mingw]} { |
| @@ -458,11 +461,10 @@ | |
| 458 | # Last resort, may be Windows |
| 459 | if {[is_mingw]} { |
| 460 | define-append LIBS -lwsock32 |
| 461 | } |
| 462 | } |
| 463 | cc-check-function-in-lib iconv iconv |
| 464 | cc-check-functions utime |
| 465 | cc-check-functions usleep |
| 466 | cc-check-functions strchrnul |
| 467 | |
| 468 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 469 |
| --- auto.def | |
| +++ auto.def | |
| @@ -190,10 +190,13 @@ | |
| 190 | } else { |
| 191 | define-append EXTRA_CFLAGS -DFOSSIL_DYNAMIC_BUILD=1 |
| 192 | define FOSSIL_DYNAMIC_BUILD |
| 193 | } |
| 194 | |
| 195 | # Check for libraries that need to be sorted out early |
| 196 | cc-check-function-in-lib iconv iconv |
| 197 | |
| 198 | # Helper for OpenSSL checking |
| 199 | proc check-for-openssl {msg {cflags {}} {libs {-lssl -lcrypto}}} { |
| 200 | msg-checking "Checking for $msg..." |
| 201 | set rc 0 |
| 202 | if {[is_mingw]} { |
| @@ -458,11 +461,10 @@ | |
| 461 | # Last resort, may be Windows |
| 462 | if {[is_mingw]} { |
| 463 | define-append LIBS -lwsock32 |
| 464 | } |
| 465 | } |
| 466 | cc-check-functions utime |
| 467 | cc-check-functions usleep |
| 468 | cc-check-functions strchrnul |
| 469 | |
| 470 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 471 |
M
auto.def
+3
-1
| --- auto.def | ||
| +++ auto.def | ||
| @@ -190,10 +190,13 @@ | ||
| 190 | 190 | } else { |
| 191 | 191 | define-append EXTRA_CFLAGS -DFOSSIL_DYNAMIC_BUILD=1 |
| 192 | 192 | define FOSSIL_DYNAMIC_BUILD |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | +# Check for libraries that need to be sorted out early | |
| 196 | +cc-check-function-in-lib iconv iconv | |
| 197 | + | |
| 195 | 198 | # Helper for OpenSSL checking |
| 196 | 199 | proc check-for-openssl {msg {cflags {}} {libs {-lssl -lcrypto}}} { |
| 197 | 200 | msg-checking "Checking for $msg..." |
| 198 | 201 | set rc 0 |
| 199 | 202 | if {[is_mingw]} { |
| @@ -458,11 +461,10 @@ | ||
| 458 | 461 | # Last resort, may be Windows |
| 459 | 462 | if {[is_mingw]} { |
| 460 | 463 | define-append LIBS -lwsock32 |
| 461 | 464 | } |
| 462 | 465 | } |
| 463 | -cc-check-function-in-lib iconv iconv | |
| 464 | 466 | cc-check-functions utime |
| 465 | 467 | cc-check-functions usleep |
| 466 | 468 | cc-check-functions strchrnul |
| 467 | 469 | |
| 468 | 470 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 469 | 471 |
| --- auto.def | |
| +++ auto.def | |
| @@ -190,10 +190,13 @@ | |
| 190 | } else { |
| 191 | define-append EXTRA_CFLAGS -DFOSSIL_DYNAMIC_BUILD=1 |
| 192 | define FOSSIL_DYNAMIC_BUILD |
| 193 | } |
| 194 | |
| 195 | # Helper for OpenSSL checking |
| 196 | proc check-for-openssl {msg {cflags {}} {libs {-lssl -lcrypto}}} { |
| 197 | msg-checking "Checking for $msg..." |
| 198 | set rc 0 |
| 199 | if {[is_mingw]} { |
| @@ -458,11 +461,10 @@ | |
| 458 | # Last resort, may be Windows |
| 459 | if {[is_mingw]} { |
| 460 | define-append LIBS -lwsock32 |
| 461 | } |
| 462 | } |
| 463 | cc-check-function-in-lib iconv iconv |
| 464 | cc-check-functions utime |
| 465 | cc-check-functions usleep |
| 466 | cc-check-functions strchrnul |
| 467 | |
| 468 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 469 |
| --- auto.def | |
| +++ auto.def | |
| @@ -190,10 +190,13 @@ | |
| 190 | } else { |
| 191 | define-append EXTRA_CFLAGS -DFOSSIL_DYNAMIC_BUILD=1 |
| 192 | define FOSSIL_DYNAMIC_BUILD |
| 193 | } |
| 194 | |
| 195 | # Check for libraries that need to be sorted out early |
| 196 | cc-check-function-in-lib iconv iconv |
| 197 | |
| 198 | # Helper for OpenSSL checking |
| 199 | proc check-for-openssl {msg {cflags {}} {libs {-lssl -lcrypto}}} { |
| 200 | msg-checking "Checking for $msg..." |
| 201 | set rc 0 |
| 202 | if {[is_mingw]} { |
| @@ -458,11 +461,10 @@ | |
| 461 | # Last resort, may be Windows |
| 462 | if {[is_mingw]} { |
| 463 | define-append LIBS -lwsock32 |
| 464 | } |
| 465 | } |
| 466 | cc-check-functions utime |
| 467 | cc-check-functions usleep |
| 468 | cc-check-functions strchrnul |
| 469 | |
| 470 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 471 |
+1
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -362,11 +362,11 @@ | ||
| 362 | 362 | " SET rcvid=:rcvid, mtime=:mtime, hash=NULL," |
| 363 | 363 | " sz=0, encoding=0, content=NULL" |
| 364 | 364 | " WHERE name=:name" |
| 365 | 365 | ); |
| 366 | 366 | db_bind_int(&q, ":rcvid", g.rcvid); |
| 367 | - }else if( iStatus==4 ){ | |
| 367 | + }else if( iStatus==2 ){ | |
| 368 | 368 | db_prepare(&q, "UPDATE unversioned SET mtime=:mtime WHERE name=:name"); |
| 369 | 369 | }else{ |
| 370 | 370 | db_prepare(&q, |
| 371 | 371 | "REPLACE INTO unversioned(name,rcvid,mtime,hash,sz,encoding,content)" |
| 372 | 372 | " VALUES(:name,:rcvid,:mtime,:hash,:sz,:encoding,:content)" |
| 373 | 373 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -362,11 +362,11 @@ | |
| 362 | " SET rcvid=:rcvid, mtime=:mtime, hash=NULL," |
| 363 | " sz=0, encoding=0, content=NULL" |
| 364 | " WHERE name=:name" |
| 365 | ); |
| 366 | db_bind_int(&q, ":rcvid", g.rcvid); |
| 367 | }else if( iStatus==4 ){ |
| 368 | db_prepare(&q, "UPDATE unversioned SET mtime=:mtime WHERE name=:name"); |
| 369 | }else{ |
| 370 | db_prepare(&q, |
| 371 | "REPLACE INTO unversioned(name,rcvid,mtime,hash,sz,encoding,content)" |
| 372 | " VALUES(:name,:rcvid,:mtime,:hash,:sz,:encoding,:content)" |
| 373 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -362,11 +362,11 @@ | |
| 362 | " SET rcvid=:rcvid, mtime=:mtime, hash=NULL," |
| 363 | " sz=0, encoding=0, content=NULL" |
| 364 | " WHERE name=:name" |
| 365 | ); |
| 366 | db_bind_int(&q, ":rcvid", g.rcvid); |
| 367 | }else if( iStatus==2 ){ |
| 368 | db_prepare(&q, "UPDATE unversioned SET mtime=:mtime WHERE name=:name"); |
| 369 | }else{ |
| 370 | db_prepare(&q, |
| 371 | "REPLACE INTO unversioned(name,rcvid,mtime,hash,sz,encoding,content)" |
| 372 | " VALUES(:name,:rcvid,:mtime,:hash,:sz,:encoding,:content)" |
| 373 |
+1
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -362,11 +362,11 @@ | ||
| 362 | 362 | " SET rcvid=:rcvid, mtime=:mtime, hash=NULL," |
| 363 | 363 | " sz=0, encoding=0, content=NULL" |
| 364 | 364 | " WHERE name=:name" |
| 365 | 365 | ); |
| 366 | 366 | db_bind_int(&q, ":rcvid", g.rcvid); |
| 367 | - }else if( iStatus==4 ){ | |
| 367 | + }else if( iStatus==2 ){ | |
| 368 | 368 | db_prepare(&q, "UPDATE unversioned SET mtime=:mtime WHERE name=:name"); |
| 369 | 369 | }else{ |
| 370 | 370 | db_prepare(&q, |
| 371 | 371 | "REPLACE INTO unversioned(name,rcvid,mtime,hash,sz,encoding,content)" |
| 372 | 372 | " VALUES(:name,:rcvid,:mtime,:hash,:sz,:encoding,:content)" |
| 373 | 373 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -362,11 +362,11 @@ | |
| 362 | " SET rcvid=:rcvid, mtime=:mtime, hash=NULL," |
| 363 | " sz=0, encoding=0, content=NULL" |
| 364 | " WHERE name=:name" |
| 365 | ); |
| 366 | db_bind_int(&q, ":rcvid", g.rcvid); |
| 367 | }else if( iStatus==4 ){ |
| 368 | db_prepare(&q, "UPDATE unversioned SET mtime=:mtime WHERE name=:name"); |
| 369 | }else{ |
| 370 | db_prepare(&q, |
| 371 | "REPLACE INTO unversioned(name,rcvid,mtime,hash,sz,encoding,content)" |
| 372 | " VALUES(:name,:rcvid,:mtime,:hash,:sz,:encoding,:content)" |
| 373 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -362,11 +362,11 @@ | |
| 362 | " SET rcvid=:rcvid, mtime=:mtime, hash=NULL," |
| 363 | " sz=0, encoding=0, content=NULL" |
| 364 | " WHERE name=:name" |
| 365 | ); |
| 366 | db_bind_int(&q, ":rcvid", g.rcvid); |
| 367 | }else if( iStatus==2 ){ |
| 368 | db_prepare(&q, "UPDATE unversioned SET mtime=:mtime WHERE name=:name"); |
| 369 | }else{ |
| 370 | db_prepare(&q, |
| 371 | "REPLACE INTO unversioned(name,rcvid,mtime,hash,sz,encoding,content)" |
| 372 | " VALUES(:name,:rcvid,:mtime,:hash,:sz,:encoding,:content)" |
| 373 |