OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.3 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: bin/sde-reschedule-package
  6. # Copyright (C) 2008 The OpenSDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- SDE-COPYRIGHT-NOTE-END ---
  15. #Description: Reschedule packages from the builds
  16. [ -n "$SDEROOT" ] ||
  17. export SDEROOT=$( cd "${0%/*}/.."; pwd -P )
  18. . "$SDEROOT/lib/libsde.in"
  19. reschedule_usage() {
  20. local progname=${0##*/}
  21. cat <<EOT
  22. Usage: ${progname//-/ } [<options>] <package_1> ...
  23. Supported Options:
  24. --all|-a every package
  25. --new|-N every package updated since it was built
  26. --deps|-D every package depending on the others
  27. --cfg|-c <config> process a given config (multiple supported)
  28. --any|-A process any available config
  29. --dry-run|-n don't really reschedule
  30. --soft|-s don't remove the packages when rescheduling
  31. EOT
  32. }
  33. shortopts='aNDc:Ans'
  34. longopts='help,all,new,deps,cfg:,any,soft,dry-run'
  35. options=$( getopt -o "$shortopts" -l "$longopts" -- "$@" )
  36. if [ $? -ne 0 ]; then
  37. reschedule_usage
  38. exit -1
  39. fi
  40. # load new arguments list
  41. eval set -- "$options"
  42. reschedule_all=
  43. reschedule_new=
  44. reschedule_dependers=
  45. reschedule_any=
  46. reschedule_soft=
  47. reschedule_dry=
  48. reschedule_configs=
  49. while [ $# -gt 0 ]; do
  50. case "$1" in
  51. --help)
  52. reschedule_usage
  53. exit 0 ;;
  54. --all|-a) reschedule_all=yes ;;
  55. --new|-N) reschedule_new=yes ;;
  56. --deps|-D) reschedule_dependers=yes ;;
  57. --any|-A) reschedule_any=yes ;;
  58. --soft|-s) reschedule_soft=yes ;;
  59. --dry-run|-n) reschedule_dry=yes ;;
  60. --cfg|-c) reschedule_configs="$reschedule_configs $2"
  61. shift ;;
  62. --) shift; break ;;
  63. *) echo_abort 1 "$1: Unknown argument, aborting."
  64. esac
  65. shift
  66. done
  67. . "$SDEROOT/lib/sde-config.in"
  68. # which configs?
  69. #
  70. if [ -n "$reschedule_any" ]; then
  71. reschedule_configs=$( config_list )
  72. [ -n "$reschedule_configs" ] || echo_abort 1 "No config found."
  73. elif [ -z "$reschedule_configs" ]; then
  74. # try default
  75. reschedule_configs=default
  76. fi
  77. echo_abort 2 'Not Implemented'