X-Spam-Check-By: sourceware.org Date: Wed, 26 Jul 2006 12:51:05 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Why are Windows paths broken in make 3.81? Message-ID: <20060726165105.GA25656@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <9c2aabaf0607211629u4e29ffa1w5f09b3d8e5a923fc AT mail DOT gmail DOT com> <9c2aabaf0607260912n4d17a340j533a049565234c00 AT mail DOT gmail DOT com> <20060726162609 DOT GA24491 AT trixie DOT casa DOT cgf DOT cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060726162609.GA24491@trixie.casa.cgf.cx> User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: 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 On Wed, Jul 26, 2006 at 12:26:09PM -0400, Christopher Faylor wrote: >Maybe someone here would be willing to post a sed transformation which >would change c:\some\dos\path to /cygdrive/c/some/dos/path. Here are two simple, imperfect proof-of-concept perl scripts. The first one just translates everything to /cygdrive/X/foo. The second one uses cygpath to get mount-table-aware paths. And, to reiterate: I know that these aren't perfect and miss some cases (like when part of a filename is located in a variable). I merely offer them as is as an example of what could be done. cgf #!/usr/bin/perl while (<>) { s!\b([a-z]):((?:[/\\][^/\\\s]+)+)!"/cygdrive/$1" . &fixslash($2)!eg; print; } sub fixslash { my $x = shift; $x =~ s%\\%/%g; return $x; } #!/usr/bin/perl while (<>) { s!\b([a-z]:(?:[/\\][^/\\\s]+)+)!&fix($1)!eg; print; } sub fix { my $x = `cygpath -u '$_[0]'`; chomp $x; return $x; } -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/