From: Christian Franke <Christian.Franke@t-online.de>
To: "cygwin-apps@cygwin.com" <cygwin-apps@cygwin.com>
Subject: Re: [PATCH setup] Add perpetual support for preremove scripts
Date: Wed, 29 Jun 2022 17:09:24 +0200 [thread overview]
Message-ID: <e57111bb-6521-5804-f9f0-76eec7e0a179@t-online.de> (raw)
In-Reply-To: <f4221887-7f14-e869-dcc2-6b443fb4585b@dronecode.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1856 bytes --]
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
[-- Attachment #2: 0001-Clear-filename-on-GUI-after-running-perpetual-prerem.patch --]
[-- Type: text/plain, Size: 575 bytes --]
From dd31653b99c3a970fd145d2ffbad5809de7e0273 Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.franke@t-online.de>
Date: Wed, 29 Jun 2022 16:51:47 +0200
Subject: [PATCH] Clear filename on GUI after running perpetual preremove
scripts
---
install.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/install.cc b/install.cc
index 6689a08..0ceb05f 100644
--- a/install.cc
+++ b/install.cc
@@ -192,6 +192,7 @@ Installer::preremovePerpetual0 ()
Progress.SetText3 (i->fullName ().c_str());
i->run();
}
+ Progress.SetText3 ("");
}
void
--
2.36.1
next prev parent reply other threads:[~2022-06-29 15:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-26 16:33 Christian Franke
2022-06-29 13:13 ` Jon Turney
2022-06-29 15:09 ` Christian Franke [this message]
2022-06-29 18:35 ` Christian Franke
2022-07-02 12:35 ` Jon Turney
2022-07-01 17:03 ` Christian Franke
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=e57111bb-6521-5804-f9f0-76eec7e0a179@t-online.de \
--to=christian.franke@t-online.de \
--cc=cygwin-apps@cygwin.com \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).