mgirod / clearcase-cpan

Automatically exported from code.google.com/p/clearcase-cpan
0 stars 0 forks source link

ClearCase::Argv 1.44 doesn't quote anymore #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reported as rt.cpan.org #44522

after upgrade to version 1.44, ClearCase::Argv doesn't quote anymore. This
leads to problems when attaching attributes, because the value needs to be
quoted like this: '"value"'. This fails with version 1.44 because of the
missing single quotes. Here's a small example output of a script started on
a machine with version 1.44 (dbglevel set to 2):

=> pwv -short
+ <=vobroot_default
+ ($? == 0)
=> ls -s /vob/itrBuild
+ <=/vob/itrBuild/lost+found@@/main/0
/vob/itrBuild/lost+found@@/main/0
+ ($? == 0)

And this is how the same script looks like when using an older version of
the module (notice the single quotes):

+ starting child cleartool (pid=19648) ...
+ -->> 'setview' 'vobroot_default'
+ -->> 'pwv' '-short'
+ <<-- vobroot_default
+ -->> 'ls' '-s' '/vob/itrBuild'
+ <<-- /vob/itrBuild/lost+found@@/main/0
/vob/itrBuild/lost+found@@/main/0
+ ($? == 0)
+ ending child cleartool (pid=19648) ...

With the old version, mkattr works just fine, while with 1.44 it doesn't.

Original issue reported on code.google.com by marc.girod on 25 Mar 2009 at 12:02

GoogleCodeExporter commented 9 years ago
Reproduced.

foo> perl -e 'use
ClearCase::Argv;ClearCase::Argv->ipc(1);ClearCase::Argv->dbglevel(2);$ct=ClearCa
se::Argv->new({autochomp=>1});$ct->argv(qw(setview
emagiro))->system;$ct->argv(qw(pwv -s))->system;$ct->argv(qw(ls -s -d
.))->system;$ct->argv(qw(mkattr -rep),q(TR_INFO),q("foo"),q(.))->system'
=> pwv -s
+ <=emagiro
emagiro
+ ($? == 0)
=> ls -s -d .
+ <=.@@/main/2
.@@/main/2
+ ($? == 0)
=> mkattr -rep TR_INFO "foo" .
+ <=cleartool: Error: Invalid string value: "foo".
cleartool: Error: Invalid string value: "foo".
+ ($? == 0)

Original comment by marc.girod on 25 Mar 2009 at 12:04

GoogleCodeExporter commented 9 years ago
Intentions:
- create a test case under the r (regression) directory
- find precisely what change introduced the error, by running the test against 
past
versions
- refine the behaviour to be restored:
  - it feels right to quote string attribute values, but not other tokens...
  - one ought o take care of tokens already containing a single quote
  - conjecture for now: the fix could be to change line 578 only

Original comment by marc.girod on 26 Mar 2009 at 10:38

GoogleCodeExporter commented 9 years ago
Done what was intended (r246)
However:
- the test case concerns precisely mkattr
- it fails on all past versions I had in my tree (starting from 1.38), so that 
I am
not sure what was the reference in the repotrer environment...
- I offered a fix which passes the test, as well as all the existing tests on 3
platforms (Solaris/CCv6, Windows/CtCmd/CCv7, cygwin/CCv7)
- The fix only adds quotes to tokens containing double quotes
- An extension of the fix may still be needed for tokens containing single 
quotes
(e.g. comment such as: "John's idea"), at least if they contain other chars 
requiring
quoting.

Original comment by marc.girod on 27 Mar 2009 at 9:42

GoogleCodeExporter commented 9 years ago
Fixed in r248, 1.45a CPAN candidate.
Still need to check that the regression was in fact introduced in Argv 1.23

Original comment by marc.girod on 28 Mar 2009 at 9:19