Author: cdouglas
Date: Wed Oct 15 20:08:11 2008
New Revision: 705125
URL: http://svn.apache.org/viewvc?rev=705125&view=rev
Log:
HADOOP-4335. Fix FsShell -ls for filesystems without owners/groups. Contributed
by David Phillips.
Modified:
hadoop/core/branches/branch-0.19/CHANGES.txt
hadoop/core/branches/branch-0.19/src/core/org/apache/hadoop/fs/FsShell.java
Modified: hadoop/core/branches/branch-0.19/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/CHANGES.txt?rev=705125&r1=705124&r2=705125&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.19/CHANGES.txt Wed Oct 15 20:08:11 2008
@@ -875,6 +875,9 @@
HADOOP-4053. Schedulers must be notified when jobs complete. (Amar Kamat
via omalley)
+ HADOOP-4335. Fix FsShell -ls for filesystems without owners/groups. (David
+ Phillips via cdouglas)
+
Release 0.18.2 - Unreleased
BUG FIXES
Modified:
hadoop/core/branches/branch-0.19/src/core/org/apache/hadoop/fs/FsShell.java
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/core/org/apache/hadoop/fs/FsShell.java?rev=705125&r1=705124&r2=705125&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/src/core/org/apache/hadoop/fs/FsShell.java
(original)
+++ hadoop/core/branches/branch-0.19/src/core/org/apache/hadoop/fs/FsShell.java
Wed Oct 15 20:08:11 2008
@@ -623,9 +623,10 @@
stat.getPermission() + " ");
System.out.printf("%"+ maxReplication +
"s ", (!stat.isDir() ? stat.getReplication() : "-"));
- System.out.printf("%-"+ maxOwner +
- "s ", stat.getOwner());
- System.out.printf("%-"+ maxGroup +"s ", stat.getGroup());
+ if (maxOwner > 0)
+ System.out.printf("%-"+ maxOwner + "s ", stat.getOwner());
+ if (maxGroup > 0)
+ System.out.printf("%-"+ maxGroup + "s ", stat.getGroup());
System.out.printf("%"+ maxLen + "d ", stat.getLen());
System.out.print(mdate + " ");
System.out.println(cur.toUri().getPath());