From a02d12ff15e2c50c98d939d6a9e31bdf37b32297 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Sat, 16 Aug 2008 22:03:21 +0000 Subject: [PATCH] sde-reschedule-new: Introduced tool to reschedule modified packages from the builds - WIP --- bin/sde-reschedule-new | 96 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100755 bin/sde-reschedule-new diff --git a/bin/sde-reschedule-new b/bin/sde-reschedule-new new file mode 100755 index 0000000..c2f9c01 --- /dev/null +++ b/bin/sde-reschedule-new @@ -0,0 +1,96 @@ +#!/bin/sh +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: bin/sde-reschedule-new +# Copyright (C) 2008 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +#Description: Reschedule updated packages from the builds + +[ -n "$SDEROOT" ] || + export SDEROOT=$( cd "${0%/*}/.."; pwd -P ) + +. "$SDEROOT/lib/libsde.in" + +reschedule_usage() { + local progname=${0##*/} + cat <] ... + +Supported Options: + --deps|-D every package depending on the others + + --any|-A process any available config + + --dry-run|-n don't really reschedule + --soft|-s don't remove the packages when rescheduling +EOT +} + +shortopts='DAns' +longopts='help,deps,any,soft,dry-run' +options=$( getopt -o "$shortopts" -l "$longopts" -- "$@" ) +if [ $? -ne 0 ]; then + reschedule_usage + exit -1 +fi + +# load new arguments list +eval set -- "$options" + +reschedule_dependers= +reschedule_any= +reschedule_soft= +reschedule_dry= + +reschedule_configs= + +while [ $# -gt 0 ]; do + case "$1" in + --help) + reschedule_usage + exit 0 ;; + + --deps|-D) reschedule_dependers=yes ;; + --any|-A) reschedule_any=yes ;; + --soft|-s) reschedule_soft=yes ;; + --dry-run|-n) reschedule_dry=yes ;; + + --) shift; break ;; + *) echo_abort 1 "$1: Unknown argument, aborting." + esac + shift +done + +. "$SDEROOT/lib/sde-config.in" + +# which configs? +# +if [ -n "$reschedule_any" ]; then + reschedule_configs=$( config_list ) + + [ -n "$reschedule_configs" ] || echo_abort 1 "No config found." +elif [ $# -eq 0 ]; then + # try default + set -- 'default' +fi + +if [ -z "$reschedule_configs" ]; then + for x; do + if config_exists "$x"; then + reschedule_configs="$reschedule_configs $x" + else + echo_warning "$x: Invalid config." + fi + done +fi + +echo_abort 2 'Not Implemented'