Browse Source

Improved bin/sde-create-package to handle $PWD relative "repositories"

karasz/new-early
Alejandro Mery 17 years ago
parent
commit
e7b13857d0
1 changed files with 23 additions and 2 deletions
  1. +23
    -2
      bin/sde-create-package

+ 23
- 2
bin/sde-create-package

@ -118,12 +118,33 @@ elif expr "$pkg" : ".*/.*" > /dev/null; then
# repository given
repo="${pkg%/*}"
pkg="${pkg##*/}"
# sanitize $repo if needed
if [ "$repo" = "." ]; then
# detect repo based on $PWD
repo=$( package_autodetect_repo )
elif expr "$repo" : ".*/.*" > /dev/null; then
# longer path
if [ -d "$repo" ]; then
# exists, go there and find out
repo=$( cd "$repo"; package_autodetect_repo )
else
# doesn't exist
repo="$PWD/$repo"
if [ -d "${repo%/*}" ]; then
repo=$( cd "$repo"; package_autodetect_repo )
else
echo_error "${repo#$PWD/}: Invalid repository"
repo=
fi
fi
fi
else
# detect repo based on $PWD
repo=$( package_autodetect_repo )
# base use wip/ if the detection failed
repo="${repo:-wip}"
fi
# base use wip/ if the detection failed
repo="${repo:-wip}"
# validate $pkg
#

Loading…
Cancel
Save