X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type:date:from:to:subject :message-id; q=dns; s=default; b=mHa+QvuYX7PvEjHdrgYYp9iZmW3Wcer fBVp1ZwVRmwadcegIw4+eWvQnRF/2RdrhUyUJw76JRah2XQ4x9pOCGowtFxZ0iQy UQ/G/6cC1y1lIxOCX7Q/uCavmvi9DpiundjXPwqa5XpTNiMlmgCLGCkBASfKnTnV Kb7p4oh8pU+c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type:date:from:to:subject :message-id; s=default; bh=LoS0te+RSbnac72Wt/lgehZbRo0=; b=y4E+F jJHNZZqtLFrWvddsWcZr4+Ak01wOrHJx3GafAwlbODKv8CN/aOLUMlnsA67WxkXL xYbDspx0oiW98yErgiVgnzeI7PW2+basQxXOjNMAqnLhaw8hElNKPhLJebYqhxiC uKUwEvTWQKWcqTo0JeLUKpU6mRQXjGlmsA6Bn4= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=c, C, luck, reminder X-HELO: lb2-smtp-cloud7.xs4all.net MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_6ba21be8da3f81451330b773a991cb0c" Date: Tue, 16 Apr 2019 09:19:07 +0200 From: Houder To: cygwin AT cygwin DOT com Subject: Setup.exe: solution to misbehaviour Message-ID: <550c60bc7704a5955804e38504cbc4f1@xs4all.nl> X-Sender: houder AT xs4all DOT nl User-Agent: XS4ALL Webmail X-IsSubscribed: yes --=_6ba21be8da3f81451330b773a991cb0c Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed L.S., Setup.exe writes "user defaults" to /etc/setup/setup.rc in the root directory. Among these user defaults (which should override program defaults) are "last-action" and "last-cache". last-cache is an alias for the Local Package Directory (abbreviated to local directory), the directory where the tarballs (or packages) will be stored. When setup.exe starts, one has to choose between "Download to local directory", "Install fr. local directory" or "Download end Install". As a reminder, setup.exe will show you the "last-action", i.e. what action was chosen by you when you last invoked setup.exe. However "all of the above" is in vain, if setup.exe fails to select the correct root directory. Currently, setup.exe fails to honour the -R option, which one uses to specify a different location for the root directory. setup.exe also fails to look for /etc/setup/setup.rc in the current directory when setup.exe is started from the root directory. I have written about this misbehaviour of setup.exe here: https://cygwin.com/ml/cygwin/2019-04/msg00032.html ( Setup: why consult registry (rootdir) if -R has been specified? ) Attached (I hope) to this post you will find a corrected version of the UserSettings::open_settings() method; it determines the location of the root directory as follows: - read /etc/setup/setup.rc from the specified root directory (-R) and if file exists - insert root directory in mount_table - else read /etc/setup/setup.rc from the current directory and if file exist - insert root directory in mount_table - else fall back to the whacky default (rootdir from registry) (root directory inserted in mount_table) Good luck. Henri --=_6ba21be8da3f81451330b773a991cb0c Content-Transfer-Encoding: base64 Content-Type: text/x-c; name=open_settings.txt Content-Disposition: attachment; filename=open_settings.txt; size=5896 Li4uCgovLyBIZW5yaTogcmVxdWlyZWQKI2luY2x1ZGUgIm1vdW50LmgiIC8v IHNldF9yb290X2RpcigpCiNpbmNsdWRlICJnZXRvcHQrKy9TdHJpbmdPcHRp b24uaCIgLy8gUm9vdE9wdGlvbgpleHRlcm4gU3RyaW5nT3B0aW9uIFJvb3RP cHRpb247CgouLi4KCi8vIEhlbnJpOiBvcmlnaW5hbCBmdW5jdGlvbiByZXBs YWNlZCBieSB0aGlzIG9uZSAobW9yZSBjbGVhciB0aGFuIG1vZGlmeWlu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UgbWVtYmVyIHZhcmlhYmxlIC4uLiBUYWRhIQouLi4KCj09PT09 Cg== --=_6ba21be8da3f81451330b773a991cb0c Content-Type: text/plain; charset=us-ascii -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple --=_6ba21be8da3f81451330b773a991cb0c--