Browse Source

Introduced package_confdir() in lib/sde-package.in and changed `sde up pkg` to use it

karasz/new-early
Alejandro Mery 17 years ago
parent
commit
e89c5618e9
2 changed files with 9 additions and 5 deletions
  1. +2
    -2
      bin/sde-update-package
  2. +7
    -3
      lib/sde-package.in

+ 2
- 2
bin/sde-update-package

@ -95,7 +95,7 @@ update_patch_package() {
update_package() {
local pkg="$1" ver="$2" location="$3"
local confdir=$( ls -1d "$SDEROOT/package/"*"/$pkg" 2> /dev/null )
local confdir=$( package_confdir "$pkg" )
local descfile="${confdir}/${pkg}.desc"
local oldver=
@ -144,7 +144,7 @@ elif [ $# -eq 2 ]; then
elif [ $# -eq 1 ]; then
# package or version?
pkg="$( echo "$1" | tr A-Z a-z)"
if [ ! -d "$( echo "$SDEROOT/package/"*"/$pkg/" )" ]; then
if [ ! -d "$( package_confdir "$pkg" )" ]; then
pkg="$( package_autodetect )"
ver="$1"
fi

+ 7
- 3
lib/sde-package.in

@ -2,7 +2,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: lib/sde-package.in
# Copyright (C) 2006 - 2007 The OpenSDE Project
# Copyright (C) 2006 - 2008 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
@ -16,9 +16,13 @@
#Description: Package related tasks
package_autodetect() {
echo $( pwd -P | sed -n -e "s,^$SDEROOT/package/[^/]*/\([^/]*\)\(/.*\)\?$,\1,p" )
pwd -P | sed -n -e "s,^$SDEROOT/package/[^/]*/\([^/]*\)\(/.*\)\?$,\1,p"
}
package_autodetect_repo() {
echo $( pwd -P | sed -n -e "s,^$SDEROOT/package/\([^/]*\)\(/.*\)\?,\1,p" )
pwd -P | sed -n -e "s,^$SDEROOT/package/\([^/]*\)\(/.*\)\?,\1,p"
}
package_confdir() {
ls -1d "$SDEROOT/package"/*/"$1" 2> /dev/null | head -n 1
}

Loading…
Cancel
Save