Newer
Older
dub_jkp / test / test-upgrade-subpackages.sh
  1. #!/usr/bin/env bash
  2.  
  3. . $(dirname ${BASH_SOURCE[0]})/common.sh
  4.  
  5. PACK_PATH="$CURR_DIR"/path-subpackage-ref
  6.  
  7. # make sure that there are no left-over selections files
  8. rm -f $PACK_PATH/dub.selections.json $PACK_PATH/subpack/dub.selections.json
  9.  
  10. # first upgrade only the root package
  11. if ! ${DUB} upgrade --root $PACK_PATH; then
  12. die $LINENO 'The upgrade command failed.'
  13. fi
  14. if [ ! -f $PACK_PATH/dub.selections.json ] || [ -f $PACK_PATH/subpack/dub.selections.json ]; then
  15. die $LINENO 'The upgrade command did not generate the right set of dub.selections.json files.'
  16. fi
  17.  
  18. rm -f $PACK_PATH/dub.selections.json
  19.  
  20. # now upgrade with all sub packages
  21. if ! ${DUB} upgrade -s --root $PACK_PATH; then
  22. die $LINENO 'The upgrade command failed with -s.'
  23. fi
  24. if [ ! -f $PACK_PATH/dub.selections.json ] || [ ! -f $PACK_PATH/subpack/dub.selections.json ]; then
  25. die $LINENO 'The upgrade command did not generate all dub.selections.json files.'
  26. fi
  27.  
  28. # clean up
  29. rm -f $PACK_PATH/dub.selections.json $PACK_PATH/subpack/dub.selections.json