From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4EBKCFzdpGNR9AAAbAwnHQ (envelope-from ) for ; Thu, 22 Dec 2022 23:42:36 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id IL9PCFzdpGO0DgEAauVa8A (envelope-from ) for ; Thu, 22 Dec 2022 23:42:36 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4DD9A1B9E6 for ; Thu, 22 Dec 2022 23:42:35 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8UGX-0003Ds-Ow; Thu, 22 Dec 2022 17:42:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8UGI-0003Cc-To for guix-patches@gnu.org; Thu, 22 Dec 2022 17:42:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p8UGI-0006Uv-Hv for guix-patches@gnu.org; Thu, 22 Dec 2022 17:42:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p8UGI-0006hl-10 for guix-patches@gnu.org; Thu, 22 Dec 2022 17:42:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 22 Dec 2022 22:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59845 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "yarl baudig" Cc: Julien Lepiller , 59845@debbugs.gnu.org Received: via spool by 59845-submit@debbugs.gnu.org id=B59845.167174886425740 (code B ref 59845); Thu, 22 Dec 2022 22:42:01 +0000 Received: (at 59845) by debbugs.gnu.org; 22 Dec 2022 22:41:04 +0000 Received: from localhost ([127.0.0.1]:36398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8UFL-0006h6-F2 for submit@debbugs.gnu.org; Thu, 22 Dec 2022 17:41:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8UFJ-0006gV-8H for 59845@debbugs.gnu.org; Thu, 22 Dec 2022 17:41:01 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8UFC-0006AM-Ap; Thu, 22 Dec 2022 17:40:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=cX6n84p8zWkjFTXMeXhf8dZg0hpvnBhFKu5otgASlEc=; b=FknUiNWRqnvHmuJFCyRr PV5KhApsT2RnGupnbNBE7abeolrneRlIx0pV4/QC0VGBshwk0SuDWGPUddbYoKtJGfO28Tf/QvEgo 3h7/GksSVxtmEfNWe4MsOKTMCrAC1FHwzb25OBkvKzgQuERY3fpJGoLV1Dpe4fRkiY86EW7Z9/7YI KEDVwqtOJrlnhyleok7/IpsPD97lNdA5tUXj/82qajBtAWsSJdRGYFwgdNZoW/Jam/yihhSrIYpde QVpIMnwTDY7d41jMnWDoAk6D1nC75BFoJ/bEgTPoXFDTxTqFd5IE3ruTeU6/T5dKWUu1QwhjnUBwL mqebdTRy4I0/bw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8UFB-0000VS-Or; Thu, 22 Dec 2022 17:40:54 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Duodi 2 =?UTF-8?Q?Niv=C3=B4se?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour de la Houille X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 22 Dec 2022 23:40:52 +0100 In-Reply-To: (yarl baudig's message of "Thu, 22 Dec 2022 18:18:09 +0100 (CET)") Message-ID: <87bknv12q3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671748955; a=rsa-sha256; cv=none; b=IQfdATsT+mwKLKmXOvQvi+bnnsmdckITnK2cySEDgeVwK06QdXDgVelx9njnG/6kN847Ws r0aX1RkEjohDkn1zfMn7zjXv1IvleU7y+EdZ6K+kJFRlR/E2Nje/ZJl7EFFMNY7QIbi2Zz Tt8tO1Yn2KvFQGJbO5fbDHVdRI5eeUmRNddJRgxnYDZRLARcN2A6iNK7hK7kxM9cm6NQK2 znYS3i+e+J6rtThuY56JyPIxtojUxAp9HIjXHXppAezrN80g3ArB6eN+Dpt+xxq4c5Vpme PhlhC1U1tAztTJlA2GCSq1djbE4tCKPLnFKlYxLi4ZVTZ8zmUElhDPrWAoKr7w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=FknUiNWR; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671748955; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=cX6n84p8zWkjFTXMeXhf8dZg0hpvnBhFKu5otgASlEc=; b=EX47KLqC8/DZVSzIdA9/nGuDHq+t5cUa9Na2Ghqijmwl4Oo2wmS85ixiiUvROOeTIPxJVj vztFglv0rFIuiYzwB8z6L4wBt/q+unvTf9N7oDTS9csU6pWQzl1MjKdBIpBs25RmHEoqPq W5+VRNtXhJL3TGuWAUoig0kRddYUHQgxAKEQy4JCXDRJGb8emcQcM9f7noZyYXZ9s2F1Hp Ifa5HlnA8wCh3xgJOBWY2gjldpUo7nLWcIHp2RlLUgOEPq5rngYQGPql7c77uQNU1YmDLW Rhup/PriXLh0dPUIOgHD5M0aY33e1kPCMU3KyCLb5eIXJrThRlmiXRGRSLY2Gg== X-Spam-Score: -4.21 X-Migadu-Queue-Id: 4DD9A1B9E6 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=FknUiNWR; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -4.21 X-TUID: g4jrw4Lw+Afz Hi, (Cc: Julien who=E2=80=99s worked on PHP packaging before.) "yarl baudig" 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 e= ven 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=20 >> "/tables/noinstall.php")) >> > + (delete-file (string-append #$http-directory=20 >> "/tables/install.php"))) >> > + (if >> > + (file-exists? (string-append #$http-directory=20 >> "/tables/noinstall_rep.php")) >> > + (delete-file (string-append #$http-directory=20 >> "/tables/install_rep.php")))))) >>=20 >> Or just: >>=20 >> (false-if-exception (delete-file =E2=80=A6)) >>=20 > > 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=E2=80=99s quite unusual, it would be nice for the comment to explain t= his. But it=E2=80=99s okay to do it this way; don=E2=80=99t fear the paradigm, i= t=E2=80=99s 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=20 >> "/share/http/pmb") >> > + #$http-directory))))) >>=20 >> Do we really need to copy these files? >>=20 >> Keep in mind that activation snippets run each time you boot the system, >> and each time you reconfigure. It=E2=80=99s best to avoid doing too muc= h 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 insid= e. That way we know if there's really an upgrade. What do you think? It sounds like it=E2=80=99s 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 =E2=80=98computed-file=E2=80=99. Does that make sense? Thanks, Ludo=E2=80=99.