instow

:)
git clone https://git.sr.ht/~ashymad/instow
Log | Files | Refs | LICENSE

commit b5f5945af83a3276374673f9eb5ef2f45ac5834d
parent 624ca8681b89d2aaf7cd913da29704f90027ba5b
Author: Szymon Mikulicz <szymon.mikulicz@posteo.net>
Date:   Wed, 18 Mar 2026 13:20:33 +0100

Fixed the upstream issue, workaround not needed

Diffstat:
Mbootstrap.sh | 2--
Msrc/file.janet | 1-
Msrc/main.janet | 23++++++++++++++---------
3 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/bootstrap.sh b/bootstrap.sh @@ -44,8 +44,6 @@ popd pushd "$SRCDIR/jpm" echo "[7/9] Instowling jpm" -mkdir -p "$PKGDIR/jpm/lib/janet/jpm" -stow -d "$PKGDIR" jpm JPM="$ROOTDIR/bin/jpm" "$BOOTDIR/instowl.local" popd diff --git a/src/file.janet b/src/file.janet @@ -12,7 +12,6 @@ (defn copy-file [src dst] (def src_fd (libc/ctry (nftw/open src :r))) - (if (file-exists? dst) (os/rm dst)) (def dst_fd (libc/ctry (nftw/open dst :wxc (nftw/fstat src_fd :int-permissions)))) (libc/sendfile dst_fd src_fd) (nftw/close src_fd) diff --git a/src/main.janet b/src/main.janet @@ -196,7 +196,7 @@ :jpm (stropt "--dest-dir" destdir) (stropt "--binpath" (path/join prefix "bin")) - (stropt "--manpath" (path/join prefix "man")) + (stropt "--manpath" (path/join prefix "share" "man" "man1")) (stropt "--modpath" (path/join prefix "lib" "janet")) (stropt "--libpath" (path/join prefix "lib")) "install") @@ -225,16 +225,21 @@ :move (let [log_file (file/open "./instowl.log" :a) installdir (path/join destdir prefix)] + (set state :stow) (if (file/dir-exists? installdir) (do - (nftw/nftw installdir - (fn [file stat ftype info] - (if (= ftype :f) - (do - (def dst (path/join pkgdir (string/slice file (length installdir)))) - (message state (string/format "MV: %s => %s" file dst) log_file) - (file/move-file file dst))) 0) 1024 :phys) - (set state :stow)) + (if (file/dir-exists? pkgdir) + (do + (checkrun :stow :stow "-v" "-d" stowdir "-t" target "-D" pkg) + (file/rmrf pkgdir))) + (if (not= state :error) + (nftw/nftw installdir + (fn [file stat ftype info] + (if (= ftype :f) + (do + (def dst (path/join pkgdir (string/slice file (length installdir)))) + (message state (string/format "MV: %s => %s" file dst) log_file) + (file/move-file file dst))) 0) 1024 :phys))) (errexit "The destination directory doesn't contain the prefix")) (file/close log_file))