This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: [RFC] incremental rebase
- From: Ken Brown <kbrown at cornell dot edu>
- To: cygwin-apps at cygwin dot com
- Date: Mon, 24 Nov 2014 15:19:05 -0500
- Subject: Re: [RFC] incremental rebase
- Authentication-results: sourceware.org; auth=none
- References: <87k32vjm3i dot fsf at Rainer dot invalid> <87y4r1r7rd dot fsf at Gertrud dot fritz dot box>
On 11/23/2014 3:17 PM, Achim Gratz wrote:
In my attempt to implement post-postinstall scripts for Ken to use for
TeXlive it turned out that the same hack I used for the pre-postinstall
perpetual scripts wouldn't really work. So I've implemented the
stratified postinstall already, at the moment limited to three strata:
0, default and z; as well as perpetual and runonce scripts (on each
stratum). No provisions for query and trigger scripts is made at the
moment, as these can be implemented with some manual effort with the two
script types that are already provided. This is extensible, although at
the moment I have to configure the available strata twice, so there
needs to be some more refactoring in that area.
Since I've coded this up on my new Linux box which already uses gcc-4.9
I had to do some preparatory fixes (the log macro clashing with the log
function) leading up to the meat of the implementation. The patch
implementing the stratified postinstall is here:
http://repo.or.cz/w/cygwin-setup.git/commitdiff/d1df7acc1dce40c97ddfaa2de38542a3a269004e
Thanks for doing this! A couple of comments:
bool
Script::isAScript (const std::string& file)
{
- /* file may be /etc/postinstall or etc/postinstall */
- if (casecompare(file, ETCPostinstall, sizeof(ETCPostinstall)-1) &&
- casecompare(file, ETCPostinstall+1, sizeof(ETCPostinstall)-2))
- return false;
- if (file.c_str()[file.size() - 1] == '/')
+ // is a directory path
+ if (file.size() == file.rfind('/'))
^^^^^^^^^^^^^^^
Shouldn't this be file.size() - 1?
+bool
+Script::match (const std::string& stratum, const std::string& type)
{
-
+ if ("done" == scriptExtension)
+ return false;
+ bool matchedStratum = false;
+ if (stratum.size())
+ {
+ std::size_t found = stratum.find(scriptStratum);
+ matchedStratum = ((std::string::npos != found) &&
+ (std::string::npos != stratum.substr(found,1).find_first_of(allowedStrata)));
Is this last test necessary? The Script constructor guarantees that the
stratum is allowable.
+ }
+ else
+ matchedStratum = true;
+ bool matchedType = true;
+ if (type.size())
+ {
+ std::size_t found = type.find(scriptType);
+ matchedType = ((std::string::npos != found) &&
+ (std::string::npos != type.substr(found,1).find_first_of(allowedTypes)));
Ditto.
[...]
The changed incremental autorebase package has been tested both as a new
install and subsequent perpetual run on both architectures. The
pre-compiled binaries identify themselves as version "2.854-spi".
And I'll make some TeX Live postinstall scripts to test it with.
Ken