public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
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: Fri, 1 Jul 2022 19:03:07 +0200	[thread overview]
Message-ID: <fd9a7814-1b21-a905-78d8-a3d6099f11c2@t-online.de> (raw)
In-Reply-To: <e57111bb-6521-5804-f9f0-76eec7e0a179@t-online.de>

[-- Attachment #1: Type: text/plain, Size: 597 bytes --]

Christian Franke wrote:
> Jon Turney wrote:
> ...
>> 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.
>

Patch attached. Written under the assumption that "[PATCH] Also run 
stratum 'z' perpetual preremove scripts" and "[ITP] etckeeper 1.18.17-1" 
will eventually be accepted :-)


[-- Attachment #2: 0001-Add-perpetual-pre-remove-scripts.patch --]
[-- Type: text/plain, Size: 3634 bytes --]

From b8225603a5d66760445c04ec14861764deb1489f Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.franke@t-online.de>
Date: Fri, 1 Jul 2022 18:52:17 +0200
Subject: [PATCH] Add perpetual pre-remove scripts

---
 packaging-package-files.html | 40 +++++++++++++++++++++---------------
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/packaging-package-files.html b/packaging-package-files.html
index 446e62db..5b214f53 100755
--- a/packaging-package-files.html
+++ b/packaging-package-files.html
@@ -223,27 +223,35 @@ etc...
   after it is installed.
 </p>
 
-<h3>Perpetual post-install scripts</h3>
+<h3>Perpetual post-install and pre-remove scripts</h3>
 <p>
-  In addition to the ordinary ("run-once") post-install scripts described above,
-  the setup program supports "perpetual" post-install scripts.  These are run on
-  every invocation of setup, as long as the package is still installed.
-  Perpetual post-install scripts are distinguished from run-once scripts by
+  In addition to the ordinary ("run-once") scripts described above,
+  the setup program supports "perpetual" post-install and pre-remove scripts.
+  These are run on every invocation of setup, as long as the package is still
+  installed.  Perpetual scripts are distinguished from run-once scripts by
   having names that start with "0p_" or "zp_".  Those that start with "0p_" are
-  run before the run-once scripts, and those that start with "zp_" are run after
-  the run-once scripts.  Examples include
-  <code>0p_000_autorebase.dash</code> (provided by the <code>_autorebase</code> package)
-  and <code>0p_update-info-dir.dash</code> (provided by the <code>info</code> package).
+  run before the run-once scripts, and those that start with "zp_" are run
+  after the run-once scripts.  Examples include
+  <code>postinstall/0p_000_autorebase.dash</code> (provided by the
+  <code>_autorebase</code> package),
+  <code>postinstall/0p_update-info-dir.dash</code> (provided by the
+  <code>info</code> package),
+  <code>postinstall/zp_zzz_etckeeper_post-install.sh</code> and
+  <code>preremove/0p_000_etckeeper_pre-install.sh</code> (provided by the
+  <code>etckeeper</code> package).
 </p>
 <p>
   For those package maintainers wanting to employ perpetual scripts, the first
-  thing to keep in mind is to only use this feature for things that really can't
-  be done with run-once scripting.  Any perpetual script should minimize the
-  resources used (use dash instead of bash for instance) and exit at the
-  earliest possible moment if no action is required.  Scripts of type "0p_" must
-  be able to run with the Base packages installed but the post-install scripts
-  not yet executed; in practical terms that rules out using bash scripts.  This
-  limitation does not apply to scripts of type "zp_".
+  thing to keep in mind is to only use this feature for things that really
+  can't be done with run-once scripting.  Any perpetual script should minimize
+  the resources used (use dash instead of bash for instance) and exit at the
+  earliest possible moment if no action is required.  Post-install scripts of
+  type "0p_" must be able to run with the Base packages installed but the
+  remaining post-install scripts not yet executed; in practical terms that
+  rules out using bash scripts.  Pre-remove scripts of type "zp_" must be able
+  to run with the other pre-remove scripts already executed.  These limitations
+  do not apply to post-install scripts of type "zp_" and pre-remove scripts of
+  type "0p_".
 </p>
 <p>
   See <a href="https://cygwin.com/ml/cygwin-apps/2014-12/msg00148.html">this
-- 
2.36.1


      parent reply	other threads:[~2022-07-01 17:03 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
2022-06-29 18:35     ` Christian Franke
2022-07-02 12:35       ` Jon Turney
2022-07-01 17:03     ` Christian Franke [this message]

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=fd9a7814-1b21-a905-78d8-a3d6099f11c2@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).