all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: "yarl baudig" <yarl-baudig@mailoo.org>
Cc: Julien Lepiller <julien@lepiller.eu>, 59845@debbugs.gnu.org
Subject: [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System)
Date: Thu, 22 Dec 2022 23:40:52 +0100	[thread overview]
Message-ID: <87bknv12q3.fsf@gnu.org> (raw)
In-Reply-To: <ea-mime-63a49151-25d2-14de0e0e@www.mailo.com> (yarl baudig's message of "Thu, 22 Dec 2022 18:18:09 +0100 (CET)")

Hi,

(Cc: Julien who’s worked on PHP packaging before.)

"yarl baudig" <yarl-baudig@mailoo.org> skribis:

> I know there is a problem with this package/service. I feel I am sort of breaking the functional paradigm. I also feel the package is "leaking" into the service, because the package is completely useful by itself, I'm not even talking about web server, PHP or MYSQL. The package is only a 'source' for a service. If that makes sense.

Hmm, I see what you mean.  But maybe the same can be said of many
(most?) PHP packages?

>> > +        ;; Those are to hide installation files on a re-activation
>> > +        (if
>> > +         (file-exists? (string-append #$http-directory 
>> "/tables/noinstall.php"))
>> > +         (delete-file (string-append #$http-directory 
>> "/tables/install.php")))
>> > +        (if
>> > +         (file-exists? (string-append #$http-directory 
>> "/tables/noinstall_rep.php"))
>> > +         (delete-file (string-append #$http-directory 
>> "/tables/install_rep.php"))))))
>> 
>> Or just:
>> 
>>   (false-if-exception (delete-file …))
>> 
>
> That's not the same thing (check noinstall to remove install).

Oops, my bad, sorry.

> Indeed, after the first service installation, user interaction is
> required, as explained in the manual : set up of database password
> then (and that's the problematic part) initialization/configuration of
> pmb through a web browser by running "install.php".  So, you need
> install.php. One time. This initialization takes care of (at least)
> moving install.php to noinstall.php. Same logic for install_rep.php.
> This is also the why of the snippet below (the copy), because the
> application need to be in a read-write directory.  The purpose of the
> code above is only to differentiate between an installation and an
> upgrade.  The service keeps state of itself in http-directory, already
> installed or not, here I break the functional paradigm? Or that's not
> so bad as it's not a package but a service?

That’s quite unusual, it would be nice for the comment to explain this.

But it’s okay to do it this way; don’t fear the paradigm, it’s here to
serve us, not the other way around.  :-)

>> > +    #~(begin
>> > +        (use-modules (guix build utils))
>> > +        (use-modules (ice-9 ftw))
>> > +        (format #t "Copying pmb '~a' to http directory '~a'~%"
>> > +                (string-append #$pmb "/share/http/pmb")
>> > +                #$http-directory)
>> > +        (mkdir-p #$http-directory)
>> > +        ;; Please be quiet
>> > +        (call-with-output-file "/dev/null"
>> > +          (lambda (port)
>> > +            (with-output-to-port port
>> > +              (lambda ()
>> > +                (copy-recursively (string-append #$pmb 
>> "/share/http/pmb")
>> > +                                  #$http-directory)))))
>> 
>> Do we really need to copy these files?
>> 
>> Keep in mind that activation snippets run each time you boot the system,
>> and each time you reconfigure.  It’s best to avoid doing too much work
>> there.
>>
>
> Now, I see one solution to avoid the copy (and the chown), apart from the very first activation. That's keeping even more state into http-directory : for example a file ".version" with the hash of the pmb package used inside. That way we know if there's really an upgrade. What do you think?

It sounds like it’s going a bit far in terms of complexity.

Why do we need to copy these files every time?  Do they actually have to
be writable?  If not, whatever this copying step is doing could be done
in a ‘computed-file’.

Does that make sense?

Thanks,
Ludo’.




  reply	other threads:[~2022-12-22 22:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 21:48 [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Yarl Baudig
2022-12-05 21:52 ` [bug#59845] [PATCH 1/4] gnu: php: Add '--enable-soap' configure option Yarl Baudig
2022-12-05 21:52   ` [bug#59845] [PATCH 2/4] gnu: Add PMB Yarl Baudig
2022-12-05 21:52   ` [bug#59845] [PATCH 3/4] gnu: Add PMB service Yarl Baudig
2022-12-05 21:52   ` [bug#59845] [PATCH 4/4] doc: Add Integrated Library System section Yarl Baudig
2022-12-09 11:52 ` [bug#59845] V2 yarl baudig
2022-12-09 11:53 ` [bug#59845] [PATCH v2 1/4] gnu: php: Add '--enable-soap' configure option Yarl Baudig
2022-12-09 11:53   ` [bug#59845] [PATCH v2 2/4] gnu: Add PMB Yarl Baudig
2022-12-20 14:56     ` [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Ludovic Courtès
2022-12-09 11:53   ` [bug#59845] [PATCH v2 3/4] gnu: Add PMB service Yarl Baudig
2022-12-20 15:03     ` [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Ludovic Courtès
2022-12-09 11:53   ` [bug#59845] [PATCH v2 4/4] doc: Add Integrated Library System section Yarl Baudig
2022-12-20 15:13     ` [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Ludovic Courtès
2022-12-22 17:18 ` yarl baudig
2022-12-22 22:40   ` Ludovic Courtès [this message]
2022-12-23  8:17     ` yarl baudig
2022-12-25 17:26       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bknv12q3.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=59845@debbugs.gnu.org \
    --cc=julien@lepiller.eu \
    --cc=yarl-baudig@mailoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.