[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: minor bug in "du" size calculator in build_all.sh



On Sat, May 27, 2000 at 06:30:44PM -0400, Mike Bilow wrote:
> On 2000-05-27 at 13:33 -0400, Ben Collins wrote:
> 
> > On Sat, May 27, 2000 at 09:54:02AM +0100, Philip Hands wrote:
> > > Hi,
> > > 
> > > du doesn't follow symbolic links, so the size of "current" is reported
> > > as 0
> > > 
> > > This will work:
> > > 
> > >   disks=`cd ${MIRROR}/dists/${CODENAME}/main/disks-${ARCH}/current ;\ 
> > >          du -sm | cut -f1'`
> > 
> > Umm, it should work since I used .../current/. which completely ignores
> > the symlink. I used it to build quite a few CD's, are you sure something
> > else isn't wrong?
> 
> I tested this on the local mirror (which is actually an i386 machine
> running Potato), and Phil is right.  If you want du to follow symlinks in
> the tree, you need the '-l' switch; if you want du to follow symlinks
> specified on the command line as their real locations, you need the '-D'
> switch.  So I got this to work very easily just by using

# ls -l /archive/debian/dists/potato/main/disks-sparc/current
lrwxrwxrwx    2 bmc      bmc            17 May 21 22:30 /archive/debian/dists/potato/main/disks-sparc/current -> 2.2.15-2000-05-21/
# du -s /archive/debian/dists/potato/main/disks-sparc/current
0       /archive/debian/dists/potato/main/disks-sparc/current

# du -s /archive/debian/dists/potato/main/disks-sparc/current/
0       /archive/debian/dists/potato/main/disks-sparc/current

# du -s /archive/debian/dists/potato/main/disks-sparc/current/.
65128   /archive/debian/dists/potato/main/disks-sparc/current/.

This third way is what I had setup in debian-cd. I don't see why it didn't
work for Philip (tested in tcsh and bash).

-- 
 -----------=======-=-======-=========-----------=====------------=-=------
/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'



Reply to: