Skip to content

Commit

Permalink
sagemathgh-37785: sage-logger: Suppress "No such file or directory"…
Browse files Browse the repository at this point in the history
… messages

<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

A minor follow-up after sagemath#37391:

Seen for example in
https://github.com/sagemath/sage/actions/runs/8626379356/job/23644513913
?pr=37570#step:11:3227:
```
sagemath#24 4091.8 /sage/build/bin/sage-logger: line 66: /usr/bin/time: No such
file or directory
sagemath#24 4091.8 [sagemath_doc_html-none] installing. Log file:
/sage/logs/pkgs/sagemath_doc_html-none.log
sagemath#24 5807.5 cat: /sage/logs/pkgs/sagemath_doc_html-none.time: No such
file or directory
```
We suppress these (harmless) messages which show up when `/usr/bin/time`
is not available.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

URL: sagemath#37785
Reported by: Matthias Köppe
Reviewer(s): David Ayotte, Gonzalo Tornaría, Matthias Köppe
  • Loading branch information
Release Manager committed Apr 20, 2024
2 parents 6d2394f + ededb59 commit 75b34ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build/bin/sage-logger
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ fi

timefile="$logdir/$logname.time"
rm -f "$timefile"
if /usr/bin/time -h -o /dev/null true; then
if /usr/bin/time -h -o /dev/null true 2>/dev/null; then
TIME="/usr/bin/time -h -o $timefile"
else
TIME=""
fi

report_time ()
{
time=$(echo $(cat $timefile))
time=$(echo $(cat $timefile 2>/dev/null))
case "$time" in
*m*real*|*h*real*|*[1-9][0-9].*real*|*[1-9][0-9],*real*)
# at least 10 seconds wall time
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=b9d9a4bb2d949d8f6fffe63c77ff069d59ca6e8c
md5=95f8a1d22f684e3f61019ae82111e639
cksum=3352815196
sha1=690acbd8f7ee57f38cedf5234efbe9b1244c02e1
md5=2f52a2f05de9669ccb2028540e4fccf2
cksum=326483124
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4dd66116b58babf05bb8e4b30282638e2c0b82c3
5012947626d10bff0780a1aca9ce1e4461d9f30e

0 comments on commit 75b34ed

Please sign in to comment.