Debian Codegraph @

utils/mkdebmirror

raw
1 #! /bin/sh
2
3 # Thomas Lange, [email protected], (c) 2001-2018
4
5 # - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6 update_from() {
7
8 # update local mirror from a host
9 host=$1
10 shift
11 defopt="--keyring /usr/share/keyrings/debian-archive-keyring.gpg --method=http --rsync-extra=none --diff=none $allopt --host=$host --dist=$dist $sect"
12
13 echo "------------------ create mirror for debian ------------------"
14 debmirror $excl $destdir/debian $defopt $*
15 }
16 # - - - - - - - - - - - - - - - - - - - - - - - - - - - -
17 # main program
18 #
19 # here you have to adjust the hostnames of the mirror and the names of the distributions
20
21 # excluding dbg_ packages saves a lot of disk space. About 33G for squeeze,wheezy in amd64,i386
22 excl="--exclude=-dbg_ --exclude=debian-installer-netboot-images --include=libc6-dbg"
23
24 debug="$@"
25 arch=amd64
26 dist=trixie,trixie-backports
27
28 destdir=/files/scratch/debmirror
29 sect="--section main,contrib,non-free,non-free-firmware"
30 allopt="$debug --state-cache-days=100 --ignore-missing-release --ignore-release-gpg --passive --nosource --arch=$arch"
31
32 # first sync from a mirror near to you
33 #update_from ftp.uni-koeln.de $*
34 # If this mirror isn't always up to date, sync again from an official mirror
35
36 # sync from an official mirror
37 update_from deb.debian.org --getcontents $*
38
39 # even one should not mirror the security site, but I will do it.
40 echo "------------------ create mirror for debian-security ------------------"
41 debmirror --keyring /usr/share/keyrings/debian-archive-keyring.gpg --method=http $excl $destdir/debian-security $allopt --host=deb.debian.org -r debian-security $sect -d trixie-security $*