Browse Source

sde-create-manifest: cleanup

user/amery/wip/manifest
Alejandro Mery 15 years ago
parent
commit
84aafb36de
1 changed files with 26 additions and 23 deletions
  1. +26
    -23
      bin/sde-create-manifest

+ 26
- 23
bin/sde-create-manifest

@ -13,14 +13,13 @@
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
[ -n "$SDEROOT" ] ||
export SDEROOT="$(cd "${0%/*}/.."; pwd -P)"
. "$SDEROOT/lib/libsde.in"
manifest_svn() {
local dir="${1%/*}" url= url0= dirname=
manifest_scan_svn() {
local dir="${1%/*}" url= url0=
url="$(cd "$dir"; LANG=C svn info | grep ^URL: | cut -d' ' -f2-)"
if [ "$dir" != '.' -a -d "$dir/../.svn" ]; then
@ -33,34 +32,38 @@ manifest_svn() {
echo "$dir $url"
}
manifest_git() {
local dir="${1%/*}" branch=
local repo= proto=
repo=$(GIT_DIR="$1" git config --get remote.origin.url)
proto=${repo%%://*}
manifest_scan_git() {
local dir="${1%/*}" repo=$(GIT_DIR="$1" git config --get remote.origin.url)
local proto="${repo%%://*}"
case "$proto" in
ssh) proto="git+ssh"
repo=$proto://${repo#*://}
;;
esac
echo "$dir $repo"
}
cd "$SDEROOT" || exit 1
# root
if [ -d ".git" ]; then
manifest_git ./.git
elif [ -f ".svn" ]; then
manifest_svn ./.svn
else
echo_error ".: unknown vcs"
fi
manifest_scan() {
cd "$SDEROOT" || return
# root
if [ -d ".git" ]; then
manifest_scan_git ./.git
elif [ -f ".svn" ]; then
manifest_scan_svn ./.svn
else
echo_error ".: unknown vcs"
fi
for d in $(find target src package -type d -name '.git'); do
manifest_scan_git $d
done
for d in $(find target src package -type d -name '.git'); do
manifest_git $d
done
for d in $(find target src package -type d -name '.svn'); do
manifest_scan_svn $d
done
}
for d in $(find target src package -type d -name '.svn'); do
manifest_svn $d
done
manifest_scan

Loading…
Cancel
Save