unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] Haunt resolves symlinks in the ‘static-directory’
@ 2018-02-12  8:32 Oleg Pykhalov
  0 siblings, 0 replies; only message in thread
From: Oleg Pykhalov @ 2018-02-12  8:32 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 2475 bytes --]

Hello,

Currently ‘haunt build’ doesn't resolves symlinks in the
‘static-directory’.

The following files layout was generated by ‘guix environment
--no-grafts --pure --root=guix-root-static --load=guix.scm’
--8<---------------cut here---------------start------------->8---
tree -L 1 guix-root-static/share/static/
guix-root-static/share/static/
├── css -> /gnu/store/…-twbs-3.3.5-dist/share/static/css
└── js

2 directories, 0 files
--8<---------------cut here---------------end--------------->8---

‘guix-root-static/share/static/js’ is a directory and it will be copied by
--8<---------------cut here---------------start------------->8---
(site #:builders (list (static-directory "guix-root-static/share/static"
                                         "static"))
      …)
--8<---------------cut here---------------end--------------->8---

but ‘guix-root-static/share/static/css’ is a symlink.  It will be copied
as an empty file pointing to no where (will not point to
‘/gnu/store/…-twbs-3.3.5-dist/share/static/css’).

More problems if exist another directory with a ‘css’ directory inside
--8<---------------cut here---------------start------------->8---
(site #:builders (list (static-directory "static" "static"))
      …)
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
$ haunt build
building pages in 'site'...
copying asset 'guix-root-static/share/static/js/jquery.min.js' → '/static/js/jquery.min.js'
copying asset 'guix-root-static/share/static/js/bootstrap.min.js' → '/static/js/bootstrap.min.js'
copying asset 'guix-root-static/share/static/css' → '/static/css'
copying asset 'static/js/disqus.js' → '/static/js/disqus.js'
copying asset 'static/css/wigust.css' → '/static/css/wigust.css'
Backtrace: 
           4 (primitive-load "/gnu/store/h0f4p5bbmg08pij804sg02l8n7h…")
In ice-9/boot-9.scm:
    152:2  3 (with-fluid* _ _ _)
In ice-9/eval.scm:
    619:8  2 (_ #(#(#(#(#<directory (haunt ui build) 291d1…>) …) …) …))
In srfi/srfi-1.scm:
    640:9  1 (for-each #<procedure 8ea9000 at ice-9/eval.scm:333:13…> …)
In unknown file:
           0 (copy-file "static/css/wigust.css" "/home/natsu/src/hau…")

ERROR: In procedure copy-file:
ERROR: In procedure copy-file: Not a directory
--8<---------------cut here---------------end--------------->8---


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] haunt: asset: Follow symlinks. --]
[-- Type: text/x-patch, Size: 812 bytes --]

From 80f8825b029f7ff7b6dc0c4d5e9056a035f8ee71 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <go.wigust@gmail.com>
Date: Mon, 12 Feb 2018 10:56:05 +0300
Subject: [PATCH] haunt: asset: Follow symlinks.

* haunt/asset.scm (directory-assets)[file-system-fold]: Add 'stat'
  argument.
---
 haunt/asset.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/haunt/asset.scm b/haunt/asset.scm
index 2d9e27b..a4c60cd 100644
--- a/haunt/asset.scm
+++ b/haunt/asset.scm
@@ -79,4 +79,4 @@ files in DIRECTORY that match KEEP?, recursively."
   (define (err file-name stat errno memo)
     (error "asset processing failed with errno: " file-name errno))
 
-  (file-system-fold enter? leaf noop noop noop err '() directory))
+  (file-system-fold enter? leaf noop noop noop err '() directory stat))
-- 
2.15.1


[-- Attachment #3: Type: text/plain, Size: 7 bytes --]


Oleg.

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-12  8:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-12  8:32 [PATCH] Haunt resolves symlinks in the ‘static-directory’ Oleg Pykhalov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).