Browse Source

sde-config: enhanced hack_stages() to allow wildcards and offsets

user/amery/stages
Alejandro Mery 15 years ago
parent
commit
4f8ca71fdf
1 changed files with 11 additions and 9 deletions
  1. +11
    -9
      lib/sde-config/functions.in

+ 11
- 9
lib/sde-config/functions.in

@ -2,7 +2,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: lib/sde-config/functions.in
# Copyright (C) 2006 - 2008 The OpenSDE Project
# Copyright (C) 2006 - 2009 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
# Copyright (C) 1998 - 2003 Clifford Wolf
#
@ -84,17 +84,19 @@ create_dot_in_lists() {
hack_stages() {
local stage="$1----------"; shift
local pkgs="$*"
local pkgs= any='[^ ]\+'
if [ $# -gt 1 ]; then
pkgs="${pkgs// /\|}"
elif [ $# -eq 1 ]; then
true
fi
case "$stage" in
[0-9]*) stage=$(printf "%.*s$stage" "${stage:0:1}" "----------") ;;
esac
if [ "$pkgs" ]; then
pkgfilter sed -e "s,^\(.\) [^ ]* \([^ ]*\) \([^ ]*\) \($pkgs\) ,\1 ${stage:0:10} \2 \3 \4 ,"
if [ $# -gt 0 ]; then
pkgs=$(echo "$*" | sed -e 's, ,\\|,g' -e "s,\*,$any,g")
else
pkgs="$any"
fi
pkgfilter sed -e "s,^\(.\) $any \($any\) \($any\) \($pkgs\) ,\1 ${stage:0:10} \2 \3 \4 ,"
}
# Functions for working with config/$config/packages

Loading…
Cancel
Save