[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pre-release [PATCH] git-service
From: |
ng0 |
Subject: |
Re: pre-release [PATCH] git-service |
Date: |
Sat, 09 Jul 2016 01:08:38 +0000 |
Ricardo Wurmus <address@hidden> writes:
> Thompson, David <address@hidden> writes:
>
>> On Fri, Jul 8, 2016 at 11:53 AM, ng0 <address@hidden> wrote:
>>> I need some feedback on the git-service.
>>> The inserted patch gives me this output:
>>>
>>>
>>> +(define-record-type* <git-configuration>
>>> + git-configuration make-git-configuration
>>> + git-configuration?
>>> + (git git-configuration-git ; <package>
>>> + (default git))
>>> + (base-path git-configuration-base-path) ; string
>>> + (port git-configuration-port)) ; string
>>
>> So, this is a record type...
>>
>>> +
>>> +(define git-shepherd-service
>>> + (match-lambda
>>> + (($ <git-configuration> git base-path port)
>>> + (let ((conf (string-append
>>> + "--base-path="base-path
>>> + "--port="(number->string port))))
>>> + (list (shepherd-service
>>> + (provision '(git))
>>> + (requirement '(networking loopback syslogd))
>>> + (documentation "Run the git-daemon server for git
>>> repositories")
>>> + (start #~(make-forkexec-constructor
>>> + (list (string-append #$git "/bin/git")
>>> + "daemon" "--syslog" "--informative-errors"
>>> + #$conf)))
>>
>> ...and you (ungexp conf), where conf is an instance of that record
>> type, into what is supposed to be a list of strings that form command
>> line arguments for git. See the issue?
>
> I might be misreading this, but “conf” here is literally the string
>
> “--base-path=something--port=1234”
>
> when “base-path” is the string “something” and “port” is the number
> “1234”.
>
> The let binding for “conf” is incorrect.
>
> First, you say earlier that “port” is a string:
>
>> + (port git-configuration-port)) ; string
>
> but then you pass it to “number->string”, so it’s actually expected to
> be a number.
>
> Second, the argument to “make-forkexec-constructor” is supposed to be a
> list of strings, each representing one argument. So defining “conf” as
> a concatenation is not okay. You don’t need a let-binding for “conf” at
> all. Just use “base-path” and “port” directly. (I haven’t tested
> this.)
>
> (list (string-append #$git "/bin/git")
> "daemon" "--syslog" "--informative-errors"
> (string-append "--base-path=" $#base-path)
> (string-append "--port=" $#port))
>
> But the error you get stems from passing a value of
> “<git-configuration>” to something that expects a package. I don’t see
> where this happens. Since I cannot see “~/testvm.scm” I cannot tell you
> anything more.
>
> ~~ Ricardo
>
I just came back, I'll look at everything else tomorrow. Thanks
for the replies so far!
This is the testvm.scm:
(use-modules (gnu) (gnu system nss))
(use-service-modules desktop networking ssh version-control dbus avahi xorg)
(use-package-modules certs)
(use-package-modules tor emacs xorg version-control avahi xorg ssh)
(operating-system
(host-name "testvm")
(timezone "UTC")
(locale "en_US.UTF-8")
(bootloader (grub-configuration (device "/dev/sda")))
(file-systems
(list (file-system
(mount-point "/")
(device "dummy")
(type "dummy"))
%binary-format-file-system))
(users (list (user-account
(name "ng0")
(comment "")
(group "users")
(supplementary-groups '("wheel" "netdev"
"audio" "video"))
(home-directory "/home/ng0")
(password ""))))
(services (cons* (slim-service #:auto-login? #t
#:default-user "ng0")
(console-keymap-service "de-latin1")
(static-networking-service "eth0" "10.0.2.10"
#:name-servers '("10.0.2.3")
#:gateway "10.0.2.2")
;;(avahi-service)
;;(dbus-service (list avahi))
(git-service)
%base-services))
(pam-services
(base-pam-services #:allow-empty-passwords? #t))
(packages (cons* emacs openssh git xterm
avahi findutils grep which xmodmap
%base-packages)))
--
♥Ⓐ ng0
For non-prism friendly talk find me on http://www.psyced.org
SecuShare – http://secushare.org