[ http://jira.codehaus.org/browse/CONTINUUM-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_106308 ]
Matthias Wurm edited comment on CONTINUUM-1402 at 9/3/07 1:05 PM: ------------------------------------------------------------------ I guess there is a problem with backslashes in the command: After setting loglevel to debug I've seen that maven-scm wants to do the following: {noformat} 2007-09-03 19:55:35,908 [pool-1-thread-1] DEBUG ScmManager:default - Executing: /bin/bash -c "p4 -d /data/local/continuum-1.1-beta-2/apps/continuum/webapp/WEB-INF/working-directory/3 -p perforce.e.secunet.de:1666 -chostname-MavenSCM-\data\local\continuum-1.1-beta-2\apps\continuum\webapp\WEB-INF\working-directory\3 sync -f"{noformat} Executing the command manually on my console removes the backslashes, hence the command fails {noformat}Client 'hostname-MavenSCM-datalocalcontinuum-1.1-beta-2appscontinuumwebappWEB-INFworking-directory2' unknown - use 'client' command to create it.{noformat} Setting the clientspec inside single quotes like this works on the console: {noformat}/bin/bash -c "p4 -d /data/local/continuum-1.1-beta-2/apps/continuum/webapp/WEB-INF/working-directory/3 -p perforce.e.secunet.de:1666 -c'hostname-MavenSCM-\data\local\continuum-1.1-beta-2\apps\continuum\webapp\WEB-INF\working-directory\3' sync -f"{noformat} Maybe changing the maven-scm-provider to add single quotes around the clientspec name might fix this issue. was: I guess there is a problem with backslashes in the command: After setting loglevel to debug I've seen that maven-scm wants to do the following: 2007-09-03 19:55:35,908 [pool-1-thread-1] DEBUG ScmManager:default - Executing: /bin/bash --c "p4 -d /data/local/continuum-1.1-beta-2/apps/continuum/webapp/WEB-INF/working-directory/3 -p perforce.e.secunet.de:1666 -chostname-MavenSCM-\data\local\continuum-1.1-beta-2\apps\continuum\webapp\WEB-INF\working-directory\3 sync -f" Executing the command manually on my console removes the backslashes, hence the command fails Client 'hostname-MavenSCM-datalocalcontinuum-1.1-beta-2appscontinuumwebappWEB-INFworking-directory2' unknown - use 'client' command to create it. Setting the clientspec inside single quotes like this works on the console: /bin/bash -c "p4 -d /data/local/continuum-1.1-beta-2/apps/continuum/webapp/WEB-INF/working-directory/3 -p perforce.e.secunet.de:1666 -c'hostname-MavenSCM-\data\local\continuum-1.1-beta-2\apps\continuum\webapp\WEB-INF\working-directory\3' sync -f" Maybe changing the maven-scm-provider to add single quotes around the clientspec name might fix this issue. > Syncing with Perforce on Linux/Unix/Bash fails > ---------------------------------------------- > > Key: CONTINUUM-1402 > URL: http://jira.codehaus.org/browse/CONTINUUM-1402 > Project: Continuum > Issue Type: Bug > Components: Integration - Maven 2, SCM > Affects Versions: 1.1-beta-2 > Environment: Bash > Reporter: Sebastian Annies > Priority: Critical > > When a client is created it is named: > E.g.{{monospaced}} > sannies-sojus-MavenSCM-\opt\continuum-1.1-beta-3-SNAPSHOT\apps\continuum\webapp\WEB-INF\working-directory\6{{monospaced}} > that is ok, but now comes the sync command and uses following commandline > {{monospaced}} > /bin/bash -c "p4 -d > /opt/continuum-1.1-beta-3-SNAPSHOT/apps/continuum/webapp/WEB-INF/working-directory/1 > > -cbackground-sojus-MavenSCM-\opt\continuum-1.1-beta-3-SNAPSHOT\apps\continuum\webapp\WEB-INF\working-directory\1 > sync" > {{monospaced}} > The Bash now removes the backslashes in the client name! The result is that > the client is not existent and perforce returns with an error. > I think continuum does everything allright but we need the ticket here to be > reminded to switch to a new plexus-utils or maven-scm if it is fixed there. > The Problem starts in 'PerforceCheckOutCommand': > {{monospaced}} > public static Commandline createCommandLine( > PerforceScmProviderRepository repo, File workingDirectory, > ScmVersion version, String > specname ) > { > Commandline command = PerforceScmProvider.createP4Command( repo, > workingDirectory ); > {color:red} > command.createArgument().setValue( "-c" + specname ); > {color} > command.createArgument().setValue( "sync" ); > // Use a simple heuristic to determine if we should use the Force flag > // on sync. Forcing sync is a HUGE performance hit but is required in > // rare instances where source is somehow deleted. If the target > // directory is completely empty, assume a force is required. If > // not empty, we assume a previous checkout was already done and a > normal > // sync will suffice. > // SCM-110 > String[] files = workingDirectory.list(); > if ( files == null || files.length == 0 ) > { > // We need to force so checkout to an empty directory will work. > command.createArgument().setValue( "-f" ); > } > // Not sure what to do here. I'm unclear whether we should be > // sync'ing each file individually to the label or just sync the > // entire contents of the workingDir. I'm going to assume the > // latter until the exact semantics are clearer. > if ( version != null && StringUtils.isNotEmpty( version.getName() ) ) > { > command.createArgument().setValue( "@" + version.getName() ); > } > return command; > {{monospaced}} > The {{monospaced}}specname {{monospaced}} contains the backslashes and is > these are neither escaped nor quoted! Hmm ... Is that a job that the > CommandLine should handle? I think so! > The next thing I will do is to file an issue at plexus-utils and link the > issues. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira