From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85445 invoked by alias); 9 May 2017 21:50:08 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 85384 invoked by uid 89); 9 May 2017 21:50:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=H*UA:Bat!, H*x:Bat!, H*r:ip*192.168.1.10, H*M:yandex X-HELO: forward2p.cmail.yandex.net Received: from forward2p.cmail.yandex.net (HELO forward2p.cmail.yandex.net) (77.88.31.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 May 2017 21:50:04 +0000 Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [37.140.190.27]) by forward2p.cmail.yandex.net (Yandex) with ESMTP id B468B20D1B; Wed, 10 May 2017 00:50:03 +0300 (MSK) Received: from smtp2o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2o.mail.yandex.net (Yandex) with ESMTP id 058C45080F72; Wed, 10 May 2017 00:50:02 +0300 (MSK) Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Kwh2IPDMwC-o26OdBSm; Wed, 10 May 2017 00:50:02 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) Authentication-Results: smtp2o.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Tue, 09 May 2017 21:48:07 -0000 Date: Tue, 09 May 2017 23:02:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <17641936.20170510004807@yandex.ru> To: Joni Eskelinen , cygwin@cygwin.com Subject: Re: [ANNOUNCEMENT] New: cygextreg-1.2.0-1 In-Reply-To: References: <1351717921.20170505141750@yandex.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----------0260C3180389E1EAC" X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00138.txt.bz2 ------------0260C3180389E1EAC Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 2857 Greetings, Joni Eskelinen! > On 5.5.2017 14.17, Andrey Repin wrote: >> Greetings, Joni Eskelinen! >> >>> The following package has been added to the Cygwin distribution: >> >>> * cygextreg-1.2.0-1 >> >> >>> Scripts are executed with bash >> >> This must not be the case, unless explicitly requested. Enough that >> all Windows associations are executed with cmd if you try to >> CreateProcess blindly. Don't copy this mistake. >> > Bash is used as an intermediary shell that executes the script. > Generally a shebang line denotes the actual interpreter. > Bash was chosen because it's bundled with a default Cygwin installation. /usr/bin/env is also in the default install. And I'm using it to run scripts now. See attached TCC wrapper. >> If you want to make it useful, write a thin wrapper over exec() that >> finds out and runs proper interpreter, and support it with options to >> make interpreters happy. F.e. convert $0 to Cygwin path, if >> interpreter don't understand native paths (i.e. dash cringe over >> non-latin1 native paths and I yet to find out why). >> > All native paths are converted to Cygwin equivalents before invoking > bash, That's not the right thing to do. You can't know if a "path" you convert is an actual local filesystem path (except for $0, but even then, it is not always necessary). > ie. $0 as in the path of the file that was clicked from Windows, > and consecutive arguments if some files were dragged and dropped to > registered file icon. > That is, the script shall always receive only Posix style paths, by design. You have a strangely limited perception on the usability of your tool. How about console invocation? >>> in an interactive login shell. >> >> This should be optional. Login shell may cause $(pwd) to change, not >> to mention, it alters environment. >> >>> If the executed script exits with a non-zero code, MinTTY window >> >> This should be optional. >> >>> shall be kept open >> >> This should be optional. >> > Nice suggestions. I've thought to implement per extension options > especially for keeping the window open after completion. > Script is actually invoked roughly as follows: > /bin/bash -il -c 'cd && ./' So, you're intentionally changing execution environment? > with proper escaping applied. So even though user's personal init script > changes the working directory, the script will be invoked in its > containing directory. Which is not necessarily the place where user had it invoked. > I think it's a reasonable default to have bash run this way, since > there's a fair chance that scripts require environmental variables set > in .bashrc or like (eg. $PATH to ruby gems). I'm not in the favor of chances when I'm doing my work. -- With best regards, Andrey Repin Tuesday, May 9, 2017 17:15:35 Sorry for my terrible english... ------------0260C3180389E1EAC Content-Type: application/octet-stream; name="cygwrap.btm" Content-transfer-encoding: base64 Content-Disposition: attachment; filename="cygwrap.btm" Content-length: 1001 QFNFVCBQUk9NUFQ9QCRTJFAkXw0KQEVDSE8gT0ZGDQpPTiBCUkVBSyBSRU0N Cg0KSUYgIiV+MSIgPT0gIi0taW5zdGFsbCIgR09UTyA6U0VUVVANCklGICIl fjEiID09ICIiIEdPVE8gOkJBTk5FUg0KDQpTRVQgUEFUSD0lQFJUUklNW1ws JUBQQVRIWyVARlVMTFsiJX4wIl1dXTslW1BBVEhdDQpTRVQgRU5WPSVAUEFU SFslQEZVTExbIiV+MCJdXWVudi5leGUNClNFVCBDTUROQU1FPSVARVhFQ1NU UltjeWdwYXRoLmV4ZSAtdSAiJX4xIl0NClNISUZUDQoNCiIlW0VOVl0iIC0t ICIlW0NNRE5BTUVdIiAlJA0KUkVNIEVDSE8gUmV0dXJuICU/DQpRVUlUICU/ DQoNCjpCQU5ORVINCkVDSE8gQ3lnd2luIHNjcmlwdCB3cmFwcGVyLg0KRUNI TyBVc2FnZToNCkVDSE8uDQpFQ0hPICAgJUBGSUxFTkFNRVsiJX4wIl0gc2Ny aXB0IFtwYXJhbWV0ZXJzXQ0KRUNITyAgICVARklMRU5BTUVbIiV+MCJdIC0t aW5zdGFsbCBbLmV4dCAuLi5dDQpFQ0hPLg0KRUNITyBUaGUgIi5zaCIgZXh0 ZW5zaW9uIGlzIGFsd2F5cyByZWdpc3RlcmVkIG9uIGluc3RhbGwuDQpRVUlU DQoNCjpTRVRVUA0KDQpGVFlQRSB1bml4c2hlbGwuc2NyaXB0PSIlW0NvbVNw ZWNdIiAvQyAiJUBGVUxMWyIlfjAiXSIgIiUlMSIgJSUqDQpTSElGVA0KRE8g RVhUIElOIC9MIC5zaCAlJA0KICBJRkYgIiVATEVGVFsxLCVbRVhUXV0iID09 ICIuIiBUSEVODQogICAgQVNTT0MgJVtFWFRdPXVuaXhzaGVsbC5zY3JpcHQN CiAgRU5ESUZGDQpFTkRETw0K ------------0260C3180389E1EAC Content-Type: text/plain; charset=us-ascii Content-length: 219 -- 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 ------------0260C3180389E1EAC--