import-into-debian-archive.txt 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ROOT=/srv/archive.debian.org
  2. etcdir=${ROOT:?}/etc
  3. logdir=${ROOT:?}/log
  4. export PATH="${ROOT}/bin:$PATH"
  5. #export RSYNC_SSL_PORT=1873
  6. #export RSYNC_SSL_CA_CERT=/etc/ssl/ca-debian/ca-certificates.crt
  7. #export RSYNC_USER=...
  8. #export RSYNC_PASSWORD=...
  9. cd ${logdir}
  10. dry_run=1
  11. time debmirror \
  12. ${dry_run:+--dry-run} \
  13. --progress \
  14. --nocleanup \
  15. --method=rsync --user="${RSYNC_USER:?}" --host=security-master.debian.org --root=debian-security \
  16. --omit-suite-symlinks \
  17. --dist=buster/updates \
  18. --arch=amd64,arm64,armhf,i386 \
  19. --section=main,contrib,non-free,main/debian-installer,contrib/debian-installer,non-free/debian-installer \
  20. --i18n --getcontents \
  21. --checksums \
  22. --check-gpg --keyring=/usr/share/keyrings/debian-archive-buster-security-automatic.gpg \
  23. --diff=none --rsync-extra=none \
  24. --rsync-batch=1000 \
  25. ${ROOT:?}/debian-archive/debian-security \
  26. > ${logdir:?}/2025-06-25-debmirror-buster-security${dry_run:+-dry-run}.txt 2>&1
  27. (
  28. # sync dists/ stuff again to make sure by-hash/ gets imported too.
  29. set -e
  30. cd ${ROOT:?}/debian-archive/debian-security/dists/buster/updates
  31. rm -rf main contrib non-free non-free-firmware
  32. rsync -aL ${RSYNC_USER}@security-master.debian.org::debian-security/dists/buster/updates/{main,contrib,non-free,non-free-firmware} .
  33. )
  34. # For later:
  35. cd ${logdir}
  36. suite=bullseye keyring=/usr/share/keyrings/debian-archive-bullseye-automatic.gpg di_opts=(--di-dist=dists --di-arch=arches)
  37. suite=bullseye-proposed-updates keyring=/usr/share/keyrings/debian-archive-bullseye-automatic.gpg di_opts=()
  38. suite=bullseye-updates keyring=/usr/share/keyrings/debian-archive-bullseye-automatic.gpg di_opts=()
  39. suite=bullseye-backports keyring=/usr/share/keyrings/debian-archive-bullseye-automatic.gpg di_opts=()
  40. suite=bullseye-backports-sloppy keyring=/usr/share/keyrings/debian-archive-bullseye-automatic.gpg di_opts=()
  41. dry_run=1
  42. time debmirror \
  43. ${dry_run:+--dry-run} \
  44. --progress \
  45. --nocleanup \
  46. --method=rsync ${RSYNC_USER:+--user="${RSYNC_USER:?}"} --host=127.0.0.1 --root=debian \
  47. --omit-suite-symlinks \
  48. --dist=${suite:?} \
  49. --arch=amd64,arm64,armel,armhf,i386,mips64el,mipsel,ppc64el,s390x \
  50. "${di_opts[@]}" \
  51. --section=main,contrib,non-free,main/debian-installer,contrib/debian-installer,non-free/debian-installer \
  52. --i18n --getcontents \
  53. --checksums \
  54. --check-gpg --keyring=${keyring:?} \
  55. --diff=none --rsync-extra=none \
  56. --rsync-batch=1000 \
  57. ${ROOT:?}/debian-archive/debian \
  58. > ${logdir:?}/2025-06-16-debmirror-${suite:?}${dry_run:+-dry-run}.txt 2>&1
  59. # Copied dists/ tree as otherwise older installer versions and ChangeLog were missing.
  60. # Only difference after this: Release{,.gpg} are real files, not symlinks to zzz-dists
  61. for suite in bullseye{,-proposed-updates,-updates,-backports,-backports-sloppy}; do
  62. (
  63. set -e
  64. cd ${ROOT:?}/debian-archive/debian/dists/${suite:?}
  65. rm -rf main contrib non-free
  66. cp -a /srv/ftp-master.debian.org/ftp/dists/${suite:?}/{main,contrib,non-free} .
  67. if [ "$suite" = bullseye ]; then
  68. cp -a /srv/ftp-master.debian.org/ftp/dists/${suite:?}/ChangeLog .
  69. fi
  70. if [ "$suite" = bullseye-proposed-updates ]; then
  71. cp -a /srv/ftp-master.debian.org/ftp/dists/${suite:?}/*.changes .
  72. fi
  73. )
  74. done
  75. # jdupes if not importing other stuff; see below
  76. # check DEP11 data?
  77. # + stretch-debug
  78. cd ${logdir}
  79. suite=bullseye-debug keyring=/usr/share/keyrings/debian-archive-bullseye-automatic.gpg di_opts=()
  80. suite=bullseye-proposed-updates-debug keyring=/usr/share/keyrings/debian-archive-bullseye-automatic.gpg di_opts=()
  81. suite=bullseye-backports-debug keyring=/usr/share/keyrings/debian-archive-bullseye-automatic.gpg di_opts=()
  82. suite=bullseye-backports-sloppy-debug keyring=/usr/share/keyrings/debian-archive-bullseye-automatic.gpg di_opts=()
  83. dry_run=1
  84. time debmirror \
  85. ${dry_run:+--dry-run} \
  86. --progress \
  87. --nocleanup \
  88. --method=rsync ${RSYNC_USER:+--user="${RSYNC_USER:?}"} --host=127.0.0.1 --root=debian-debug \
  89. --omit-suite-symlinks \
  90. --dist=${suite:?} \
  91. --arch=amd64,arm64,armel,armhf,i386,mips64el,mipsel,ppc64el,s390x \
  92. "${di_opts[@]}" \
  93. --section=main,contrib,non-free,main/debian-installer,contrib/debian-installer,non-free/debian-installer \
  94. --i18n --getcontents \
  95. --checksums \
  96. --check-gpg --keyring=${keyring:?} \
  97. --diff=none --rsync-extra=none \
  98. --rsync-batch=1000 \
  99. ${ROOT:?}/debian-archive/debian-debug \
  100. > ${logdir:?}/2025-06-16-debmirror-${suite:?}${dry_run:+-dry-run}.txt 2>&1
  101. cd ${ROOT:?}/debian-archive/debian/dists
  102. for d in bullseye{,-updates,-proposed-updates,-backports,-backports-sloppy}; do
  103. (
  104. set -e
  105. cd ${d}
  106. rm -rf main contrib non-free non-free-firmware
  107. /usr/bin/rsync -a /srv/ftp-master.debian.org/ftp/dists/${d}/{main,contrib,non-free} .
  108. if [ -e /srv/ftp-master.debian.org/ftp/dists/${d}/non-free-firmware ]; then
  109. /usr/bin/rsync -a /srv/ftp-master.debian.org/ftp/dists/${d}/non-free-firmware .
  110. fi
  111. )
  112. done
  113. cd ${ROOT:?}/debian-archive/debian-debug/dists
  114. for d in bullseye{,-proposed-updates,-backports,-backports-sloppy}-debug; do
  115. (
  116. set -e
  117. cd ${d}
  118. rm -rf main contrib non-free non-free-firmware
  119. /usr/bin/rsync -a /srv/ftp-master.debian.org/archive/debian-debug/dists/${d}/{main,contrib,non-free} .
  120. if [ -e /srv/ftp-master.debian.org/archive/debian-debug/dists/${d}/non-free-firmware ]; then
  121. /usr/bin/rsync -a /srv/ftp-master.debian.org/archive/debian-debug/dists/${d}/non-free-firmware .
  122. fi
  123. )
  124. done
  125. # check that for each architecture at least one binary ended up in pool/.
  126. # debmirror 1:2.35+deb11u1 doesn't seem to complain if we specified the wrong architectures.
  127. # jdupes: --order=time to get timestamp of oldest file
  128. # Note: jdupes feels veeeery slow (hours): it reads beginning of all files
  129. # first, but then identifying potential copies is fast. There is no feedback
  130. # while it reads data.
  131. cd ${ROOT}
  132. time jdupes --order=time --printwithsummary --recurse debian-archive > ${logdir}/2025-06-25-archive-jdupes-test.txt 2>&1
  133. time jdupes --order=time --linkhard --recurse debian-archive > ${logdir}/2025-06-25-archive-jdupes.txt 2>&1
  134. date > ${ROOT:?}/debian-archive/project/trace/master
  135. # as dak:
  136. sudo -u dak sudo -u archvsync /home/archvsync/bin/runmirrors archive
  137. # Remind webmaster to update the corresponding pages in www.debian.org and remove stuff from packages.d.o