Browse Source

* converted scripts/Create-PkgList into lib/sde-package/package-list.awk

* introduced `sde list pkg` to list the default package list for a given
	  architecture, used by Config and some toys.


git-svn-id: svn://svn.opensde.net/opensde/opensde/trunk@21082 10447126-35f2-4685-b0cf-6dd780d3921f
misl/sde-wrapper
Alejandro Mery 19 years ago
parent
commit
34b8b51e0d
6 changed files with 103 additions and 26 deletions
  1. +73
    -0
      bin/sde-list
  2. +15
    -0
      lib/sde-list.hlp
  3. +6
    -17
      lib/sde-package/package-list.awk
  4. +2
    -2
      scripts/Check-Deps-1
  5. +2
    -3
      scripts/Config
  6. +5
    -4
      scripts/Create-FlatPriPatch

+ 73
- 0
bin/sde-list

@ -0,0 +1,73 @@
#!/bin/sh
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: bin/sde-list
# Copyright (C) 2007 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: generate lists needed by other commands
set -e
[ -n "$SDEROOT" ] ||
export SDEROOT=$( cd "${0%/*}/.."; pwd -P )
. $SDEROOT/lib/libsde.in
sde_list_package() {
local repo=
if [ -n "$arch" -a ! -d $SDEROOT/architecture/$arch/ ]; then
echo_error "wrong architecture ($arch) specified, aborting."
sde_list_help
return 1
fi
# the .awk file needs complete $SDEROOT relative .desc locations
cd $SDEROOT
# NOTE: protection again command line overflow
for repo in package/*; do
[ ! -d "$repo/" ] ||
gawk -f ./lib/sde-package/package-list.awk -v "arch=$arch" $( ls -1d $repo/*/*.desc 2> /dev/null )
done | sort -k 3
}
sde_list_help() {
. $SDEROOT/lib/sde-help.in
help_command list
}
option=help
arch=
# discriminator
if [ $# -gt 0 ]; then
option="$1"; shift
fi
# arguments
while [ $# -gt 0 ]; do
case "$1" in
--arch) arch="$2"; shift ;;
*) echo_abort 1 "Unknown argument '$1', aborting."
esac
shift
done
# multiplex
case "$option" in
package|pkg) sde_list_package ;;
help) sde_list_help ;;
*) echo_error "Unknown discriminator '$option'."
sde_list_help
exit 1 ;;
esac

+ 15
- 0
lib/sde-list.hlp

@ -0,0 +1,15 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: lib/sde-list.hlp
# Copyright (C) 2007 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 ---
Usage: sde list [pkg|package] [--arch <arch>]

scripts/Create-PkgList → lib/sde-package/package-list.awk

@ -1,8 +1,8 @@
#!/bin/bash
# --- T2-COPYRIGHT-NOTE-BEGIN ---
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: scripts/Create-PkgList
# Filename: lib/sde-package/package-list.awk
# Copyright (C) 2007 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
# Copyright (C) 1998 - 2003 Clifford Wolf
#
@ -12,19 +12,10 @@
# 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.
# --- T2-COPYRIGHT-NOTE-END ---
# --- SDE-COPYRIGHT-NOTE-END ---
if [ $# -ne 1 -o ! -d architecture/"$1" ] ; then
echo "Usage: $0 [ <arch-name> ]"
[ $# -eq 0 ] ||
echo " '$1' is not a valid architecture"
exit 1
fi 1>&2
gawk '
BEGIN {
arch="'$1'";
}
# Usage: gawk -f lib/sde-package/package-list.awk -v arch=$arch <desc_files>
#
function print_package() {
print defset, stages, pri, pkgtree,
@ -94,5 +85,3 @@ FNR == 1 {
pkgtree="";
}
}
' package/*/*/*.desc | sort -k3

+ 2
- 2
scripts/Check-Deps-1

@ -3,7 +3,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: scripts/Check-Deps-1
# Copyright (C) 2006 The OpenSDE Project
# Copyright (C) 2006 - 2007 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
# Copyright (C) 1998 - 2003 Clifford Wolf
#
@ -55,7 +55,7 @@ BEGIN {
present="";
errors="";
system("mkdir -p tmp ; ./scripts/Create-PkgList > tmp/pkg_list");
system("mkdir -p tmp ; ./bin/sde-list package > tmp/pkg_list");
depfile_tpl = "package/<repository>/<package>/<package>.cache";
for (stagelevel=0; stagelevel<9; stagelevel++) {

+ 2
- 3
scripts/Config

@ -3,7 +3,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: scripts/Config
# Copyright (C) 2006 The OpenSDE Project
# Copyright (C) 2006 - 2007 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
# Copyright (C) 1998 - 2003 Clifford Wolf
#
@ -175,8 +175,7 @@ spacer="" ; expert=0 ; tabspace="5" ; tabspace_list=""
commentnr=0 ; editfilenr=0
bprof mkpkglist start
cmd="./scripts/Create-PkgList"
cmd="$cmd $SDECFG_ARCH"
cmd="./bin/sde-list package --arch '$SDECFG_ARCH'"
if [ "$cmd" != "`cat $cfgtmpdir/config.pcache.cmd 2> /dev/null`" ] ; then
eval "$cmd" | tee $cfgtmpdir/config.pcache.data > $cfgtmpdir/config/packages

+ 5
- 4
scripts/Create-FlatPriPatch

@ -1,8 +1,9 @@
#!/bin/bash
# --- T2-COPYRIGHT-NOTE-BEGIN ---
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: scripts/Create-FlatPriPatch
# Filename: scripts/Create-FlatPriPatch
# Copyright (C) 2007 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
@ -11,12 +12,12 @@
# 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.
# --- T2-COPYRIGHT-NOTE-END ---
# --- SDE-COPYRIGHT-NOTE-END ---
tempfile=`mktemp`
counter=1000
for pkg in $( ./scripts/Create-PkgList | cut -f4,5 -d' ' | tr ' ' / )
for pkg in $( ./bin/sde-list package | cut -f4,5 -d' ' | tr ' ' / )
do
xcounter="${counter%?}.${counter#???}00"
[ $pkg = base/t2-debug ] && xcounter=999.900

Loading…
Cancel
Save