This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Anecdotal: Rebase and Visual Studio 2015 and /etc


Hi.

One more sugestion: use -e test instead of -r, because Perl -r is not allways reliable in mixed Cygwin/Windows environment.

(Cygwin terminal)
$ perl -e "if( -r 'Cygwin/http%3A%2F%2Fgd.tuwien.ac.at%2Fgnu%2Fcygwin%2F/x86/setup.ini'){print 'readable'}else{print 'cant read'}"
cant read

$ head 'Cygwin/http%3A%2F%2Fgd.tuwien.ac.at%2Fgnu%2Fcygwin%2F/x86/setup.ini'
# This file is automatically generated.  If you edit it, your
# edits will be discarded next time the file is generated.
# See http://cygwin.com/setup.html for details.
#
release: cygwin
arch: x86
setup-timestamp: 1466876494
setup-version: 2.874

$ getfacl 'Cygwin/http%3A%2F%2Fgd.tuwien.ac.at%2Fgnu%2Fcygwin%2F/x86/setup.ini'
# file: Cygwin/http%3A%2F%2Fgd.tuwien.ac.at%2Fgnu%2Fcygwin%2F/x86/setup.ini
# owner: POVB+User(1124)
# group: POVB+Group(513)
user::---
group::---
group:SYSTEM:rwx
group:Administrators:rwx
group:VLADOB+Own:rwx
mask:rwx
other:---

$ perl -e "if( -e 'Cygwin/http%3A%2F%2Fgd.tuwien.ac.at%2Fgnu%2Fcygwin%2F/x86/setup.ini'){print 'exists'}else{print 'doesnt exists'}"
exists

(Windows Command prompt)
Cygwin\http%3a%2f%2fgd.tuwien.ac.at%2fgnu%2fcygwin%2f> icacls x86\setup.ini
x86\setup.ini NT AUTHORITY\SYSTEM:(I)(F)
              BUILTIN\Administrators:(I)(F)
              VLADOB\Own:(I)(F)

Tail of sub find_setup_ini_file will be:
	open my $uname, '-|', 'uname -m' or die "uname -m failed: $!\n";
	my $plat = <$uname>;
	chomp $plat;
	close $uname;

	my $setup_path = "$path/$mirror/$plat/setup.ini";
	return $setup_path if -e $setup_path;
	
	# If 32-bit Cygwin on 64-bit OS, the above doesn't works
	$setup_path = "$path/$mirror/x86/setup.ini";
	return $setup_path if -e $setup_path;
	
	# Definitely not found
	usage("could not find setup.ini");
}

This works for me.

Vlado

--
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]