Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: plexus-io-2.0.2
-
Fix Version/s: None
-
Component/s: plexus-io
-
Labels:None
-
Environment:macosx 10.7.4
-
Number of attachments :
Description
this is a followup on tycho bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=368089 where a symptom of this bug is that all file permissions are lost in a .tar archive.
The bug is that the output of 'ls -1lna' is locale-specific and e.g. with a german locale, the month and day columns are inversed on MacOS X.
example with german locale ( LANG=de_DE.UTF-8 )
$ ls -1lna
total 24
drwxr-xr-x 5 501 20 170 1 Jun 11:02 .
drwxr-xr-x 12 501 20 408 1 Jun 10:39 ..
rw-rr- 1 501 20 206 31 Mai 19:53 .project
rw-rr- 1 501 20 5227 1 Jun 11:02 pom.xml
drwxr-xr-x 3 501 20 102 31 Mai 19:59 workspace
example with english locale ( LANG=en_US.UTF-8 )
$ ls -1lna
total 24
drwxr-xr-x 5 501 20 170 Jun 1 11:02 .
drwxr-xr-x 12 501 20 408 Jun 1 10:39 ..
rw-rr- 1 501 20 206 May 31 19:53 .project
rw-rr- 1 501 20 5227 Jun 1 11:02 pom.xml
drwxr-xr-x 3 501 20 102 May 31 19:59 workspace
The bug is in AttributeParser [1] where the expected date format is "MMM dd HH:mm" but with a german locale it should be "dd MMM HH:mm" instead.
Maybe insteead of adding yet another date format to try a better fix would be to make sure the forked 'ls' always uses the same hardcoded LANG=en_US.UTF-8 env variable.
e.g.
would give a non-locale specific ISO format which is less error prone to parse.
Unfortunately I just verified that --time-style=full-iso is not portable across other versions of ls.
Using stat instead of ls
stat -c "%A %u %g %n"would be safely parseable I think, but we would fork one stat process per file which I guess is not acceptable from a performance POV.
So the only options are either trying to set the LANG of the forked ls process to hardcoded "en_US.UTF-8" or to add yet another 2 date formats