2000-dinstall 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #! /bin/bash
  2. #
  3. # © 2019 Niels Thykier <niels@thykier.net>
  4. # License: GPL-2+
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. set -e
  19. set -u
  20. . ${DAK_ROOT:?}/integration-tests/common
  21. . ${DAK_ROOT:?}/integration-tests/setup
  22. . ${DAK_ROOT:?}/integration-tests/dinstall
  23. setup_debian_like_archive
  24. import-fixture-signing-key
  25. # Verify that our dinstall works with an empty archive
  26. dinstall
  27. (
  28. packages=$(fixture-package-dir)
  29. cp ${packages:?}/nonfree-package_* ${packages:?}/package_0.1* ${DAKBASE}/tmp
  30. dak process-upload -d ${DAKBASE}/tmp --automatic
  31. )
  32. echo "Verifying that packages in NEW are *not* published"
  33. if ls -l ${DAKBASE}/ftp-master/pool/main/p/package/package_*.dsc 2>/dev/null ; then
  34. # We never acepted it, so it should not be published!
  35. echo "package has been publish even though it is still in NEW!?" >&2
  36. dak ls package
  37. exit 1
  38. fi
  39. echo "OK; accepting the package and running dinstall to see it become published"
  40. # Accept the package from NEW
  41. (
  42. dak control-overrides -s unstable -t deb -a << EOF
  43. package required admin
  44. EOF
  45. dak control-overrides -s unstable -t dsc -a << EOF
  46. package admin
  47. EOF
  48. dak process-new --automatic
  49. dak process-policy new
  50. )
  51. # After running dinstall, the package should now be present in the pool
  52. dinstall
  53. ls -l ${DAKBASE}/ftp-master/pool/main/p/package/package_*.dsc
  54. echo "Published successfully"