From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95078 invoked by alias); 19 Sep 2016 15:37:00 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 95059 invoked by uid 89); 19 Sep 2016 15:37:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=employ, distinguished, U*kbrown, D*cornell.edu X-HELO: limerock01.mail.cornell.edu Received: from limerock01.mail.cornell.edu (HELO limerock01.mail.cornell.edu) (128.84.13.241) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Sep 2016 15:36:50 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock01.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id u8JFalNj008070 for ; Mon, 19 Sep 2016 11:36:48 -0400 Received: from [192.168.1.9] (mta-68-175-148-36.twcny.rr.com [68.175.148.36] (may be forged)) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id u8JFaklf026470 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Mon, 19 Sep 2016 11:36:47 -0400 Subject: Re: per-version hints proposal To: cygwin-apps@cygwin.com References: <8b4723b2-1bd5-3604-1deb-cfd0a1c7b9d9@dronecode.org.uk> <87intvaw8c.fsf@Rainer.invalid> <7be1e9ea-651f-877b-eef4-7754ce05e588@gmail.com> <12929b59-b42b-beef-b4e9-f10cd828030f@dronecode.org.uk> <87y42pb323.fsf@Rainer.invalid> <87poo1b29n.fsf@Rainer.invalid> From: Ken Brown Message-ID: <083d57ad-bbd8-7988-7016-a0e2e3f2522b@cornell.edu> Date: Mon, 19 Sep 2016 15:37:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <87poo1b29n.fsf@Rainer.invalid> Content-Type: multipart/mixed; boundary="------------946A28C7127DB260EF98E705" X-PMX-Cornell-Gauge: Gauge=XXXXX X-PMX-CORNELL-AUTH-RESULTS: dkim-out=none; X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg00047.txt.bz2 This is a multi-part message in MIME format. --------------946A28C7127DB260EF98E705 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-length: 535 On 9/18/2016 12:28 PM, Achim Gratz wrote: > Achim Gratz writes: >> Jon Turney writes: >>> I notice the section about postinstall scripts doesn't mention >>> permanent postinsall scripts at all. >>> >>> Could you possibly provide a couple of paragraphs? >> >> I had sent them to this very list at the time. I need to dig them out >> of the archive unless you're faster. > > There it is: > https://cygwin.com/ml/cygwin-apps/2014-12/msg00148.html The attached patch attempts to extract two paragraphs from this for the web page. Ken --------------946A28C7127DB260EF98E705 Content-Type: text/plain; charset=UTF-8; name="0001-Add-information-about-perpetual-postinstall-scripts.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Add-information-about-perpetual-postinstall-scripts.pat"; filename*1="ch" Content-length: 3094 >From 5950633d23c69cf84200409f2f5354901ecb7933 Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Mon, 19 Sep 2016 11:30:34 -0400 Subject: [PATCH] Add information about perpetual postinstall scripts Also mention ".dash" and ".cmd" suffixes. --- packaging-package-files.html | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/packaging-package-files.html b/packaging-package-files.html index fdf7fdc..e5db8c5 100755 --- a/packaging-package-files.html +++ b/packaging-package-files.html @@ -160,13 +160,17 @@ etc...

If your package requires certain commands to be executed after the files in the package are installed, include them in a file in the package called - /etc/postinstall/package.sh or - /etc/postinstall/package.bat. + /etc/postinstall/package.sh, + /etc/postinstall/package.dash, + /etc/postinstall/package.bat, or + /etc/postinstall/package.cmd.

- If the file's name ends in ".sh", it is executed with the Cygwin shell; if it - ends in ".bat", it is executed with the DOS command interpreter. If it doesn't - end with either of these suffixes, it is ignored. + If the file's name ends in ".sh", it is executed with the Cygwin + bash shell; if it ends in ".dash", it is executed with the Cygwin + dash shell; if it ends in ".bat" or ".cmd", it is executed with the + Windows command interpreter. If it doesn't end with any of these + suffixes, it is ignored.

After the script has been successfully run it is renamed by appending the @@ -183,6 +187,31 @@ etc... scripts have already been run.

+

Perpetual postinstall scripts

+

+ In addition to the ordinary ("run-once") postinstall scripts + described above, the setup program supports "perpetual" postinstall + scripts. These are run on every invocation of setup and do not have + ".done" appended to their names after they are run. Perpetual + postinstall 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 + 0p_000_autorebase.dash (provided by the _autorebase package) and + 0p_update-info-dir.dash (provided by the info package). +

+

+ 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 postinstall scripts + not yet executed; in practical terms that rules out using bash + scripts. This limitation does not apply to scripts of type "zp_". +

+ -- 2.8.3 --------------946A28C7127DB260EF98E705--