From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout09.t-online.de (mailout09.t-online.de [194.25.134.84]) by sourceware.org (Postfix) with ESMTPS id E64C43858D3C for ; Wed, 29 Jun 2022 15:09:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E64C43858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=t-online.de Received: from fwd78.dcpf.telekom.de (fwd78.aul.t-online.de [10.223.144.104]) by mailout09.t-online.de (Postfix) with SMTP id 9998F16F17 for ; Wed, 29 Jun 2022 17:09:25 +0200 (CEST) Received: from [192.168.2.102] ([87.187.34.65]) by fwd78.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1o6ZJk-1Ykjui0; Wed, 29 Jun 2022 17:09:24 +0200 Subject: Re: [PATCH setup] Add perpetual support for preremove scripts To: "cygwin-apps@cygwin.com" References: From: Christian Franke Message-ID: Date: Wed, 29 Jun 2022 17:09:24 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 SeaMonkey/2.53.12 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------44E3DA2FCF95910F3E906820" X-TOI-EXPURGATEID: 150726::1656515364-0143C329-03EA4E04/0/0 CLEAN NORMAL X-TOI-MSGID: 1122bcc8-8b96-41e4-8186-b806b28cbdee X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin-apps@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin package maintainer discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2022 15:09:47 -0000 This is a multi-part message in MIME format. --------------44E3DA2FCF95910F3E906820 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Jon Turney wrote: > On 26/06/2022 17:33, Christian Franke wrote: >> Use case: I ITP etckeeper (https://etckeeper.branchable.com/) which I >> frequently use on Debian. For fully automatic operation, it requires >> pre-install and post-install hooks, e.g: >> >> /etc/preremove/0p_000_etckeeper_pre-install.sh >> /etc/postinstall/zp_zzz_etckeeper_post-install.sh >> >> This patch adds the missing functionality to run the pre-install >> hook. It is limited to /etc/preremove/0p_* because there is possibly >> no use case for /etc/preremove/zp_*. > > Thanks. > > I'm not sure what you mean by 'there is possibly no use case': That > you don't have one currently, or that you've reasoned that there can't > be one? > I don't have one currently and found none which is useful in practice, but cannot prove that there is none. If desired, I could provide a patch which adds 'zp_*' support. >> 'class Perpetual0RemoveFindVisitor' is borrowed from postinstall.cc >> and modified. It still uses the ugly pre-C++11 hack to disable >> copy-ctor and operator=. Possible refactoring like merging all 3 >> mostly similar visitors into one (or if C++11 is now allowed, use >> lambda functions instead) are left for later. > > Yeah, some refactoring would make this simpler and easier to > understand. :) > > I applied this patch. > Thanks. I found a minor GUI issue during testing: Script filename display persists during package remove phase. Fixed with attached patch. > Can you please also write a patch for [1] (source in [2]) to document > this? > > [1] https://cygwin.com/packaging-package-files.html#postinstall > [2] > https://cygwin.com/git/?p=cygwin-htdocs.git;a=blob;f=packaging-package-files.html > Of course. I will possibly wait until my ITP of etckeeper is accepted to have a real world example for the doc. -- Regards, Christian --------------44E3DA2FCF95910F3E906820 Content-Type: text/plain; charset=UTF-8; name="0001-Clear-filename-on-GUI-after-running-perpetual-prerem.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0001-Clear-filename-on-GUI-after-running-perpetual-prerem.pa"; filename*1="tch" RnJvbSBkZDMxNjUzYjk5YzNhOTcwZmQxNDVkMmZmYmFkNTgwOWRlN2UwMjczIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBDaHJpc3RpYW4gRnJhbmtlIDxjaHJpc3RpYW4uZnJh bmtlQHQtb25saW5lLmRlPgpEYXRlOiBXZWQsIDI5IEp1biAyMDIyIDE2OjUxOjQ3ICswMjAw ClN1YmplY3Q6IFtQQVRDSF0gQ2xlYXIgZmlsZW5hbWUgb24gR1VJIGFmdGVyIHJ1bm5pbmcg cGVycGV0dWFsIHByZXJlbW92ZQogc2NyaXB0cwoKLS0tCiBpbnN0YWxsLmNjIHwgMSArCiAx IGZpbGUgY2hhbmdlZCwgMSBpbnNlcnRpb24oKykKCmRpZmYgLS1naXQgYS9pbnN0YWxsLmNj IGIvaW5zdGFsbC5jYwppbmRleCA2Njg5YTA4Li4wY2ViMDVmIDEwMDY0NAotLS0gYS9pbnN0 YWxsLmNjCisrKyBiL2luc3RhbGwuY2MKQEAgLTE5Miw2ICsxOTIsNyBAQCBJbnN0YWxsZXI6 OnByZXJlbW92ZVBlcnBldHVhbDAgKCkKICAgICBQcm9ncmVzcy5TZXRUZXh0MyAoaS0+ZnVs bE5hbWUgKCkuY19zdHIoKSk7CiAgICAgaS0+cnVuKCk7CiAgIH0KKyAgUHJvZ3Jlc3MuU2V0 VGV4dDMgKCIiKTsKIH0KIAogdm9pZAotLSAKMi4zNi4xCgo= --------------44E3DA2FCF95910F3E906820--