From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id eBKeMZiRpGPZgAEAbAwnHQ (envelope-from ) for ; Thu, 22 Dec 2022 18:19:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CBDZMZiRpGOpawAA9RJhRA (envelope-from ) for ; Thu, 22 Dec 2022 18:19:20 +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 946D415E4B for ; Thu, 22 Dec 2022 18:19:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8PDk-0001KH-Ba; Thu, 22 Dec 2022 12:19:04 -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 1p8PDi-0001Jo-QX for guix-patches@gnu.org; Thu, 22 Dec 2022 12:19:03 -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 1p8PDi-0004CA-Iy for guix-patches@gnu.org; Thu, 22 Dec 2022 12:19:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p8PDi-00018D-3t for guix-patches@gnu.org; Thu, 22 Dec 2022 12:19:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) References: <20221205214838.27594-1-yarl-baudig@mailoo.org> In-Reply-To: <20221205214838.27594-1-yarl-baudig@mailoo.org> Resent-From: "yarl baudig" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 22 Dec 2022 17:19:02 +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: ludo@gnu.org Cc: 59845@debbugs.gnu.org Received: via spool by 59845-submit@debbugs.gnu.org id=B59845.16717295094336 (code B ref 59845); Thu, 22 Dec 2022 17:19:02 +0000 Received: (at 59845) by debbugs.gnu.org; 22 Dec 2022 17:18:29 +0000 Received: from localhost ([127.0.0.1]:36114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8PDA-00017s-TO for submit@debbugs.gnu.org; Thu, 22 Dec 2022 12:18:29 -0500 Received: from msg-4.mailo.com ([213.182.54.15]:47152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8PD9-00017k-Hj for 59845@debbugs.gnu.org; Thu, 22 Dec 2022 12:18:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailoo.org; s=mailo; t=1671729489; bh=0T9/XCF5sPpIJV41EyZz0s3yd14uPYYTBm/NKsb0VMw=; h=X-EA-Auth:From:To:Cc:Date:Subject:MIME-Version:X-Mailer: Message-ID:Content-Type:Content-Transfer-Encoding; b=TU41Pn06Yy4C9T7UqL4CZxL9GSfxHapxa1RNYoh8XfHa5aAkeC6TjbSwX5MX8rK3r YIpcDXVYNWfqAx/n6VwNNfmP1lW4ijhg/UkrSEIDyP9FXR92LgBs5fNh8M2bGra91t eVi5ghE0qyOmOVXXQqp8jz5t+0zP5wnRUE5ri+oo= Received: by www.mailo.com with http webmail; Thu, 22 Dec 2022 18:18:09 +0100 (CET) X-EA-Auth: dXYAp+wsFxnD6V+mKfDThiY6vvLQ/AQnZ5cVHLJBXi90oZEDqKrYjZevhLp0RNA/aS9DM6QiKRCwBYcrwYOwsB+XsEvL8oDH From: "yarl baudig" Date: Thu, 22 Dec 2022 18:18:09 +0100 (CET) X-Priority: 3 MIME-Version: 1.0 X-Mailer: COMS/EA22.05/r20221103 Message-ID: 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=1671729560; a=rsa-sha256; cv=none; b=CDozI4ctSA/lAagmv5sx3tNo0c/IFcgfnmt9PglYrdJS06sc99+LwC5DdbQTo2CNl6MaOj 9og14k4Q/dptls1KiFBaFQNS4PBI8XsZSnjJQ1KxLd+QPYwwxv7+atHIEQFj2jxNDTxwtQ hG+a5SPyM4qpuXtQUQ3Gs9aylkgsVA0eQWkefWxzVyhc+jkuuoCO0rV/9/NinX8LfbmfmY yFxDXpwJhpLh3jjvZJ4U8HI5seWwv+a1BUX+Ee57gtXmIFGvrYH1pTesQcirkwsD3xg/WS 1CAUCFECr6bIgyxJvSS4IIMwOAVmwGrJpsPSE+RXc9AqcGKDFh/9P23PWg/ing== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mailoo.org header.s=mailo header.b=TU41Pn06; 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=fail reason="SPF not aligned (relaxed)" header.from=mailoo.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671729560; 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=eiXFAd+whZ6QJUkOHryGivkZC9R4McKa/BkqPKOiiiU=; b=r1XD+JXFhLwZgWsoxQ+8zYowFa9AFuXA6BAR+VkGizfZUqzD34Wm9L+8fDT0qlnmPSK8/k ipsWnhZspu7YIi3KPI8SgowtC/2Jhs3/6+cjjpYJq6D/gwpXqD86CGDD2p5YY9myFEQEXf 07k20OuZgUyWS1x1Tr1AYuuvkNkcBDS/4LAZN7mlszJbfiuv72SA/rwbsyxyyGSmUDYwZY 9LQdyIuo+K3nsY5QhHx635rB1SWCOpMawcgeRaOV1XS1Nop4+C22dEt2LUkurywdWQ423a aAxQaC5DWI/Is3uvM7SnT0wxOwDd9c92Fbti97qM3kWc/DpDn8bJwyXYSk/2Tw== X-Spam-Score: -1.70 X-Migadu-Queue-Id: 946D415E4B Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mailoo.org header.s=mailo header.b=TU41Pn06; 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=fail reason="SPF not aligned (relaxed)" header.from=mailoo.org (policy=none) X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -1.70 X-TUID: 80EkOCVFwbEF Thank you for all your comments. I will rework this. I have some questions = if you will. I know there is a problem with this package/service. I feel I am sort of b= reaking the functional paradigm. I also feel the package is "leaking" into = the service, because the package is completely useful by itself, I'm not ev= en talking about web server, PHP or MYSQL. The package is only a 'source' f= or a service. If that makes sense. >=20 > > + ;; 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). Indeed, aft= er the first service installation, user interaction is required, as explain= ed in the manual : set up of database password then (and that's the problem= atic part) initialization/configuration of pmb through a web browser by run= ning "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 applicat= ion need to be in a read-write directory. The purpose of the code above is only to differentiate between an installa= tion 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? > > + #~(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 inside= . That way we know if there's really an upgrade. What do you think?