Skip to content

Commit 77772eb

Browse files
committed
guix: use a temporary file over sponge
Remove sponge (moreutils).
1 parent 5a8a427 commit 77772eb

File tree

3 files changed

+10
-37
lines changed

3 files changed

+10
-37
lines changed

contrib/guix/libexec/build.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,13 @@ mv --no-target-directory "$OUTDIR" "$ACTUAL_OUTDIR" \
401401

402402
(
403403
cd /outdir-base
404+
tmp="$(mktemp "${ACTUAL_OUTDIR}/tmp.XXX")"
404405
{
405406
echo "$GIT_ARCHIVE"
406-
find "$ACTUAL_OUTDIR" -type f
407+
find "$ACTUAL_OUTDIR" -type f -not -name "tmp.*"
407408
} | xargs realpath --relative-base="$PWD" \
408-
| xargs sha256sum \
409-
| sort -k2 \
410-
| sponge "$ACTUAL_OUTDIR"/SHA256SUMS.part
409+
| xargs sha256sum \
410+
| sort -k2 \
411+
> "$tmp";
412+
mv "$tmp" "$ACTUAL_OUTDIR"/SHA256SUMS.part
411413
)

contrib/guix/libexec/codesign.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,14 @@ mv --no-target-directory "$OUTDIR" "$ACTUAL_OUTDIR" \
142142

143143
(
144144
cd /outdir-base
145+
tmp="$(mktemp "${ACTUAL_OUTDIR}/tmp.XXX")"
145146
{
146147
echo "$CODESIGNING_TARBALL"
147148
echo "$CODESIGNATURE_GIT_ARCHIVE"
148-
find "$ACTUAL_OUTDIR" -type f
149+
find "$ACTUAL_OUTDIR" -type f -not -name "tmp.*"
149150
} | xargs realpath --relative-base="$PWD" \
150151
| xargs sha256sum \
151152
| sort -k2 \
152-
| sponge "$ACTUAL_OUTDIR"/SHA256SUMS.part
153+
> "$tmp";
154+
mv "$tmp" "$ACTUAL_OUTDIR"/SHA256SUMS.part
153155
)

contrib/guix/manifest.scm

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -521,36 +521,6 @@ inspecting signatures in Mach-O binaries.")
521521
(("^install-others =.*$")
522522
(string-append "install-others = " out "/etc/rpc\n")))))))))))))
523523

524-
;; The sponge tool from moreutils.
525-
(define-public sponge
526-
(package
527-
(name "sponge")
528-
(version "0.69")
529-
(source (origin
530-
(method url-fetch)
531-
(uri (string-append
532-
"https://git.joeyh.name/index.cgi/moreutils.git/snapshot/
533-
moreutils-" version ".tar.gz"))
534-
(file-name (string-append "moreutils-" version ".tar.gz"))
535-
(sha256
536-
(base32
537-
"1l859qnzccslvxlh5ghn863bkq2vgmqgnik6jr21b9kc6ljmsy8g"))))
538-
(build-system gnu-build-system)
539-
(arguments
540-
(list #:phases
541-
#~(modify-phases %standard-phases
542-
(delete 'configure)
543-
(replace 'install
544-
(lambda* (#:key outputs #:allow-other-keys)
545-
(let ((bin (string-append (assoc-ref outputs "out") "/bin")))
546-
(install-file "sponge" bin)))))
547-
#:make-flags
548-
#~(list "sponge" (string-append "CC=" #$(cc-for-target)))))
549-
(home-page "https://joeyh.name/code/moreutils/")
550-
(synopsis "Miscellaneous general-purpose command-line tools")
551-
(description "Just sponge")
552-
(license license:gpl2+)))
553-
554524
(packages->manifest
555525
(append
556526
(list ;; The Basics
@@ -565,7 +535,6 @@ inspecting signatures in Mach-O binaries.")
565535
patch
566536
gawk
567537
sed
568-
sponge
569538
;; Compression and archiving
570539
tar
571540
gzip

0 commit comments

Comments
 (0)