Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314587 - Add support for Cygwin in getPathString()
Summary: Add support for Cygwin in getPathString()
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Autotools (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Jeff Johnston CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-26 19:14 EDT by Jon Beniston CLA
Modified: 2010-05-27 14:20 EDT (History)
0 users

See Also:


Attachments
Add support for cygwin paths (1.99 KB, patch)
2010-05-26 19:16 EDT, Jon Beniston CLA
jjohnstn: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Beniston CLA 2010-05-26 19:14:18 EDT
Build Identifier: M20090917-0800

getPathString() currently only handles Ming paths. The attached patch adds support for Cygwin.

Reproducible: Always
Comment 1 Jon Beniston CLA 2010-05-26 19:16:08 EDT
Created attachment 170123 [details]
Add support for cygwin paths
Comment 2 Andrew Overholt CLA 2010-05-27 09:16:30 EDT
Today is the last day we can accept patches for Helios.  Jeff, please look at this today.  Thanks.
Comment 3 Jeff Johnston CLA 2010-05-27 12:15:17 EDT
Patch modified and applied.  The launcher method chosen is deprecated.  As well, it makes sense to stash the value for repeated calls so a private String variable was created.  The following is the modified version.  The variable winOSType is a private variable initialized to "".

	// Method to get the Win OS Type to distinguish between Cygwin and MingW
	private String getWinOSType() {
		if (winOSType.equals("")) {
			try {
				CommandLauncher launcher = new CommandLauncher();
				ByteArrayOutputStream out = new ByteArrayOutputStream();
				launcher.execute(
						new Path(SHELL_COMMAND), //$NON-NLS-1$
						new String[] { "-c", "echo $OSTYPE" }, //$NON-NLS-1$ //$NON-NLS-2$
						new String[0],
						new Path("."), //$NON-NLS-1$
						new NullProgressMonitor());
				if (launcher.waitAndRead(out, out) == CommandLauncher.OK)
					winOSType = out.toString().trim();
			} catch (CoreException e) {
				// do nothing
			}
		}
		return winOSType;
	}
Comment 4 Jeff Johnston CLA 2010-05-27 14:20:50 EDT
Comment on attachment 170123 [details]
Add support for cygwin paths

Setting iplog flag.