1. #!/bin/sh
  2. # /etc/schroot/setup.d/60add-local-repository
  3. set -e
  4. . "$SETUP_DATA_DIR/common-data"
  5. . "$SETUP_DATA_DIR/common-functions"
  6. . "$SETUP_DATA_DIR/common-config"
  7. if [ $1 = "setup-start" ] || [ $1 = "setup-recover" ]; then
  8. if [ "x$LOCAL_REPOSITORY" != "x" ] ; then
  9. info "Adding local packages in ${LOCAL_REPOSITORY} to apt sources"
  10. (cd ${CHROOT_PATH}${LOCAL_REPOSITORY} \
  11. && apt-ftparchive packages . > Packages \
  12. && apt-ftparchive release . > Release \
  13. && rm Release.gpg \
  14. && gpg --homedir /var/lib/sbuild/apt-keys --batch --output Release.gpg -ba Release)
  15. echo "deb file://${LOCAL_REPOSITORY} ./" > ${CHROOT_PATH}/etc/apt/sources.list.d/local-packages.list
  16. fi
  17. fi