From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63801 invoked by alias); 18 Oct 2015 19:39:58 -0000 Mailing-List: contact cygwin-apps-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-apps-cvs-owner@sourceware.org Received: (qmail 63781 invoked by uid 9642); 18 Oct 2015 19:39:57 -0000 Date: Sun, 18 Oct 2015 19:39:00 -0000 Message-ID: <20151018193957.63755.qmail@sourceware.org> From: yselkowitz@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [setup] branch master, updated. release_2.872-1-g679f6a2 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 5c3a215ed5aa345485d3ddae38c86b01fc59b091 X-Git-Newrev: 679f6a2e3a4d62391e31abc1e880273becbd3dcb X-SW-Source: 2015-q4/txt/msg00002.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-setup.git;h=679f6a2e3a4d62391e31abc1e880273becbd3dcb commit 679f6a2e3a4d62391e31abc1e880273becbd3dcb Author: Achim Gratz Date: Sun Oct 18 19:27:42 2015 +0200 Fix signature check for local directory installation and record names of local mirror directories * ini.cc (check_ini_sig): Do not complain about a missing signature file when installing from localdir. If it is present it still must be checked, however. The "download only" mode should pull down both the (compressed) setup file and the corresponding signature (not yet implemented). (do_local_ini): The builder needs to know the (unescaped) mirror name it's associated with in order for the file validation to work. The found_ini_list should directly provide the constituent parts so that we don't need to extract them (not yet implemented). * fromcwd.cc (FindVisitor): Remove superfluous path separator and simply use SetupArch (which has previously compared equal to aDir->cFileName) when constructing the setup file name. * Makefile.am (GITVER): Do not use an explicit HEAD parameter and add the "--dirty" option so that builds with uncommitted changes get marked appropriately. Diff: --- ChangeLog | 24 ++++++++++++++++++++++-- Makefile.am | 2 +- fromcwd.cc | 2 +- ini.cc | 24 ++++++++++++++++-------- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0117c42..9aa79d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2015-10-18 Achim Gratz + + * ini.cc (check_ini_sig): Do not complain about a missing + signature file when installing from localdir. If it is present it + still must be checked, however. The "download only" mode should + pull down both the (compressed) setup file and the corresponding + signature (not yet implemented). + (do_local_ini): The builder needs to know the (unescaped) mirror + name it's associated with in order for the file validation to + work. The found_ini_list should directly provide the constituent + parts so that we don't need to extract them (not yet implemented). + + * fromcwd.cc (FindVisitor): Remove superfluous path separator and + simply use SetupArch (which has previously compared equal to + aDir->cFileName) when constructing the setup file name. + + * Makefile.am (GITVER): Do not use an explicit HEAD parameter and + add the "--dirty" option so that builds with uncommitted changes + get marked appropriately. + 2015-10-12 Ken Brown * mkdir.cc (mkdir_p): Remove special treatment of colon in path @@ -106,7 +126,7 @@ to record the search result. (SetupFindVisitor): Make setup.{ini,bz2,xz} known and provide bool private variables to record whether we found them. Another bool - inidir to indicate whether we are currently inside a drectory + inidir to indicate whether we are currently inside a directory where setup.ini files should exist. (SetupFindVisitor::visitFile): When inidir is true, check if a setup file with one of the known extensions was found and set the @@ -119,7 +139,7 @@ (SetupFindVisitor::operator bool): Return true when found_ini_list is non-empty. (do_from_local_dir): Restrict search to either a single mirror - hierarchy or multiple mirror hierarchy; setup files directly in + hierarchy or multiple mirrors hierarchy; setup files directly in local directory or mixed hierarchies are no longer recognized. The setup files must be present in an architecture dependent directory of "x86/" or "x86_64/", either in the local directory diff --git a/Makefile.am b/Makefile.am index e9263cc..248db8d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -274,7 +274,7 @@ inilint_SOURCES = \ csu_util/version_compare.h \ regex/regex.c -GITVER := $(shell cd $(srcdir) && git describe --match release_\* --abbrev=6 HEAD || "N/A") +GITVER := $(shell cd $(srcdir) && git describe --match release_\* --abbrev=6 --dirty || "N/A") VER := $(subst release_,,$(GITVER)) setup_version.c : $(srcdir)/ChangeLog Makefile diff --git a/fromcwd.cc b/fromcwd.cc index d571b02..c5f2b79 100644 --- a/fromcwd.cc +++ b/fromcwd.cc @@ -74,7 +74,7 @@ public: ext++, fi++) { if (*fi) - found_ini_list.push_back (basePath + "/" + aDir->cFileName + "/" + found_ini_list.push_back (basePath + SetupArch + "/" + SetupBaseName + "." + *ext); } found_ini.assign (setup_ext_list.size (), false); diff --git a/ini.cc b/ini.cc index f933c5b..456eb6e 100644 --- a/ini.cc +++ b/ini.cc @@ -179,13 +179,18 @@ check_ini_sig (io_stream* ini_file, io_stream* ini_sig_file, setup anyway there's be nothing to parse. */ if (!NoVerifyOption && ini_file) { - if (!ini_sig_file) - { - note (owner, IDS_SETUPINI_MISSING, sig_name, site); - delete ini_file; - ini_file = NULL; - sig_fail = true; - } + if (!ini_sig_file) { + // don't complain if the user installs from localdir and no + // signature file is present + // TODO: download the ini + signature file instead + if (casecompare (site, "localdir")) + { + note (owner, IDS_SETUPINI_MISSING, sig_name, site); + delete ini_file; + ini_file = NULL; + sig_fail = true; + } + } else if (!verify_ini_file_sig (ini_file, ini_sig_file, owner)) { note (owner, IDS_SIG_INVALID, sig_name, site); @@ -233,7 +238,10 @@ do_local_ini (HWND owner) // grok information from setup myFeedback.babble ("Found ini file - " + current_ini_name); myFeedback.iniName (current_ini_name); - aBuilder.parse_mirror = ""; + int ldl = local_dir.length () + 1; + int cap = current_ini_name.rfind ("/" + SetupArch); + aBuilder.parse_mirror = + rfc1738_unescape (current_ini_name.substr (ldl, cap - ldl)); ini_init (ini_file, &aBuilder, myFeedback); /*yydebug = 1; */