Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 314587

Summary: Add support for Cygwin in getPathString()
Product: z_Archived Reporter: Jon Beniston <jon>
Component: AutotoolsAssignee: Jeff Johnston <jjohnstn>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Add support for cygwin paths jjohnstn: iplog+

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.