[tech] Possibly a stupid question...

David Luyer luyer at zip.com.au
Thu Nov 11 13:38:22 WST 1999


> On Thu, Nov 11, 1999 at 09:29:08AM +0800, Nick Bannon wrote:
> > 
> > There's also Debian tools for making the ISO images, but I haven't looked
> > into them. cp, dereferencing symlinks, may do just fine.
> 
> How about a "tar (magic options to derefernce symlinks) cf - | tar xf -"?

Or do something based on this script, with hamm and slink changed to slink and
potato and with the commented out bits uncommented:

#!/usr/bin/rc
# 1: mirror slink
if (!~ `whoami luyer) {
        echo 'Must run as luyer!'
        exit 1
}
cd /home/luyer
echo 'package=Debian
        comment=Mirror of parts of ftp.uwa.edu.au/mirrors/linux/debian
        site=ftp.uwa.edu.au
        recurse_hard=true
        remote_dir=/mirrors/linux/debian
        local_dir=/debian
        # exclude starting with...
        exclude_patt=((^(README.*
        exclude_patt+|Archive_Maintenance_In_Progress
        exclude_patt+|dists/(indices|stable|frozen|potato|hamm|sid|unstable|prop
osed-updates|Debian2.*)
        exclude_patt+|dists/slink-proposed-updates/.*(\.gz|_(alpha|sparc|m68k|po
werpc|arm|hurd-i386)\.deb|\.dsc|\.changes)
        exclude_patt+|hamm|project|doc|indices|build|ls-lR.*|tools))
        # exclude path segments...
        exclude_patt+|(/(source|\..*|MIRROR\.LOG|md5sums|Maintainers|Packages|Co
ntents-(m68k|alpha|sparc)\.gz|\.notar
        exclude_patt+|lost+found|other_kernels
        exclude_patt+|(binary|disks)-(alpha|sparc|m68k|powerpc|arm|hurd-i386)|ms
dos-i386
        exclude_patt+|disks-i386|README.*|timestamp\.txt
        # exclude packages...
        exclude_patt+|xserver-(8514|agx|i128|mach(8|32|64)|mono|p9000|s3|s3v|vga
16|w32)_.*
        exclude_patt+|kernel-source-.*
        exclude_patt+|.*dmotif.*|netscape.*|communicator.*|navigator.*
        exclude_patt+|cmucl.*|iraf-.*|.*emacs.*|abuse.*|picon.*|xbooks_.*|timidi
ty.*|quake.*
        exclude_patt+|i(german|danish|swedish|norwegian|spanish|french|dutch).*
        exclude_patt+|bible-kjv.*|lg-.*|tetex-src.*|wine-.*|libwine-.*|
        exclude_patt+|doc/(installmanual|doc-(debian|linux)|manpages)-(zh|sv|pl|
de|es|fr|it|ja|ko)[\-_].*\.deb)))$
        delete_excl=^(hamm-tmp|non-US)
        max_delete_files=30%
' > tmp/mirror-debian:debian-i386
#mv /debian/hamm /debian/hamm-tmp
mirror tmp/mirror-debian:debian-i386 >[2=1] #| tee tmp/mirror-debian:out1 | grep
 'Not symlinking' > tmp/mirror-debian:extraget
#mv /debian/hamm-tmp /debian/hamm
## 2: get required hamm, delete any no longer required
#grep 'Not symlinking.*->.*hamm/.*$' tmp/mirror-debian:extraget | sed 's/^.*Not 
symlinking.*->.*hamm\///' | sort -u > tmp/mirror-debian:extraget.new
#patt=`{cat tmp/mirror-debian:extraget.new | sed -e 's/^\(.*\)$/\^\1\$/' -e 'sx\
([+./]\)x\\\1xg'}
#{ echo -n 'package=Debian
#       comment=Mirror of parts of ftp.uwa.edu.au/mirrors/linux/debian
#       site=ftp.uwa.edu.au
#       recurse_hard=true
#       remote_dir=/mirrors/linux/debian/hamm
#        local_dir=/debian/hamm
#        do_deletes=false
#       exclude_patt=\/((binary|disks)-m68k|source)$
#        get_patt=\/binary-(i386|all)(dummy-begin'
#  echo -n '
#        get_patt+|'^$patt | sed -e 's/\$ $//' -e 'sx|.*binary-\(i386\|all\)x|x'
#  echo '
#        get_patt+|^dummy-end)$' } > tmp/mirror-debian:debian-extras-i386
#
#patt=()
#mirror tmp/mirror-debian:debian-extras-i386 >[2=1] | tee tmp/mirror-debian:out2
 | grep 'Not symlinking' > tmp/mirror-debian:extralink
## 3: make symlinks from [1]
#cd /debian
#rm -f dists/hamm
#ln -s ../hamm dists/hamm
#rm -f hamm/main
#ln -s hamm hamm/main
#for(line in ``('
#') {cat /home/luyer/tmp/mirror-debian:extraget}) {
#  linesplit=`` (' ') {echo $line}
#  from=$linesplit(3)
#  to=`{perl -e '$_=<>;chomp;print $_;' <<<$linesplit(5)}
#  fromdir=`{echo $from | sed 's/[^/]*$//'}
#  if ([ ! -f $fromdir$to ]) {
#    echo Does not exist: $fromdir$to
#  } else {
#    if ([ ! -f $from ]) {
#      ln -s $to $from
#    }
#  }
#}
## 4: make symlinks from [2]
#cd hamm
#if ([ -s /home/luyer/tmp/mirror-debian:extralink ]) {
#  echo extralink section of this needs uncommenting
##  for(line in ``('
##' {cat /home/luyer/tmp/mirror-debian:extralink}) {
##    linesplit=`` (' ') {echo $line}
##    from=$linesplit(3)
##    to=`{perl -e '$_=<>;chomp;print $_;' <<<$linesplit(5)}
##    fromdir=`{echo $from | sed 's/[^/]*$//'}
##    if ([ ! -f $fromdir$to ]) {
##      echo Does not exist: $fromdir$to
##    } else {
##      if ([ ! -f $from ]) {
##        ln -s $to $from
##      }
##    }
##  }
#}
# 5: get non-US slink
cd /home/luyer
echo 'package=Debian
        comment=Mirror of parts of ftp.uwa.edu.au/mirrors/linux/debian
        site=ftp.uwa.edu.au
        recurse_hard=true
        remote_dir=/mirrors/linux/debian-non-US
        local_dir=/debian/non-US
        exclude_patt=(^(dists/)?(bo|obsolete|frozen|hamm|indici?es(-non-US)?|pot
ato|stable|unstable|README.*)|/(source|binary-(alpha|sparc|m68k|powerpc|arm|hurd
-i386)))$
        max_delete_files=30%
' > tmp/mirror-debian:non-US-i386
mirror tmp/mirror-debian:non-US-i386 >[2=1] #| tee tmp/mirror-debian:out3 | grep
 'Not symlinking'

====
David.
-- 
David Luyer                           . .           www.zipworld.net
Network Engineer                    .  zipworld         Zip World is
Phone: +61 2 9253 5755              .     .      proudly part of the
Fax:   +61 2 9247 5276                . .     Pacific Internet Group






More information about the tech mailing list