Fix compatibility with OpenBSD #79

Merged
jdubois merged 3 commits from openbsd-compatibility into master 2025-01-07 14:38:45 +01:00
Member
  • readlink : option "-m" does not exist on OpenBSD, option "-f" exists on both Debian and OpenBSD
  • SERVER_IP : no reason not to first use curl on OpenBSD too
  • date : option "--iso-8601=seconds" does not exist on OpenBSD (and "%:z" neither) ; "+%FT%T%z" works on both Debian and OpenBSD but we loose the ":" in "+01:00" for the time zone
- `readlink` : option "-m" does not exist on OpenBSD, option "-f" exists on both Debian and OpenBSD - `SERVER_IP` : no reason not to first use curl on OpenBSD too - `date` : option "--iso-8601=seconds" does not exist on OpenBSD (and "%:z" neither) ; "+%FT%T%z" works on both Debian and OpenBSD but we loose the ":" in "+01:00" for the time zone
jdubois added 1 commit 2025-01-07 11:13:13 +01:00
Fix compatibility with OpenBSD
All checks were successful
gitea/evobackup/pipeline/head This commit looks good
c1da9d7034
mtrossevin approved these changes 2025-01-07 11:59:58 +01:00
mtrossevin left a comment
Owner

Seems good to me.

Seems good to me.
@ -2,3 +2,3 @@
# shellcheck disable=SC2155
readonly PROGPATH=$(readlink -m "${0}")
readonly PROGPATH=$(readlink -f "${0}")
Owner

While there is a difference in behavior between readlink -f and readlink -m that doesn't matter here (if ${0} is a path (which isn't really guaranteed) it has to point to this file so every component of the path exist).

While there *is* a difference in behavior between `readlink -f` and `readlink -m` that doesn't matter here (if `${0}` is a path (which isn't really guaranteed) it has to point to this file so every component of the path exist).
@ -80,3 +80,3 @@
# Insert metadata about the template
sed -i "s|@COMMAND@|${PROGPATH} ${ARGS}|" "${dest_path}"
sed -i "s|@DATE@|$(date --iso-8601=seconds)|" "${dest_path}"
sed -i "s|@DATE@|$(date +%FT%T%z)|" "${dest_path}" # option "--iso-8601=seconds" does not exist on OpenBSD (and "%:z" neither)
Owner

Seems good. I'm not certain the comment is really needed though.

Seems good. I'm not certain the comment is really needed though.
jlecour added 2 commits 2025-01-07 12:23:54 +01:00
Owner

I have just extracted two methods for the server IP.

Otherwise, it's good for me. OK to merge

I have just extracted two methods for the server IP. Otherwise, it's good for me. OK to merge
jdubois merged commit ead8c7b48a into master 2025-01-07 14:38:45 +01:00
jdubois referenced this pull request from a commit 2025-01-07 14:38:46 +01:00
jdubois deleted branch openbsd-compatibility 2025-01-07 14:38:47 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: evolix/evobackup#79
No description provided.