From 9850e9eeaa650051e5671150734ecb3b4606873a Mon Sep 17 00:00:00 2001 From: Vicente Bergas Date: Thu, 12 Jun 2014 21:20:56 +0100 Subject: [PATCH] FS-39718 Signed-off-by: Vicente Bergas --- scripts/makepkg.sh.in | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 96e5349..62cde29 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -493,12 +493,10 @@ download_bzr() { extract_bzr() { local netfile=$1 - local repo=$(get_filename "$netfile") local fragment=${netfile#*#} if [[ $fragment = "$netfile" ]]; then unset fragment fi - if [[ -n $fragment ]]; then case ${fragment%%=*} in revision) @@ -512,11 +510,15 @@ extract_bzr() { esac fi + local repo=$(get_filename "$netfile") local dir=$(get_filepath "$netfile") - [[ -z "$dir" ]] && dir="$SRCDEST/$(get_filename "$netfile")" + [[ -z "$dir" ]] && dir="$SRCDEST/$repo" + local rel_dir=$(dirname "$repo") + repo=$(basename "$repo") msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "bzr" - pushd "$srcdir" &>/dev/null + mkdir -p "$srcdir/$rel_dir" + pushd "$srcdir/$rel_dir" &>/dev/null rm -rf "${dir##*/}" if ! { bzr checkout "$dir" "${revision[@]}" --lightweight && @@ -572,15 +574,15 @@ extract_git() { unset fragment fi - local repo=${netfile##*/} - repo=${repo%%#*} - repo=${repo%%.git*} - + local repo=$(get_filename "$netfile") local dir=$(get_filepath "$netfile") - [[ -z "$dir" ]] && dir="$SRCDEST/$(get_filename "$netfile")" + [[ -z "$dir" ]] && dir="$SRCDEST/$repo" + local rel_dir=$(dirname "$repo") + repo=$(basename "$repo") msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "git" - pushd "$srcdir" &>/dev/null + mkdir -p "$srcdir/$rel_dir" + pushd "$srcdir/$rel_dir" &>/dev/null rm -rf "${dir##*/}" if ! git clone "$dir"; then @@ -621,10 +623,9 @@ extract_git() { download_hg() { local netfile=$1 - local dir=$(get_filepath "$netfile") - [[ -z "$dir" ]] && dir="$SRCDEST/$(get_filename "$netfile")" - local repo=$(get_filename "$netfile") + local dir=$(get_filepath "$netfile") + [[ -z "$dir" ]] && dir="$SRCDEST/$repo" local url=$(get_url "$netfile") url=${url##*hg+} @@ -655,14 +656,15 @@ extract_hg() { unset fragment fi + local repo=$(get_filename "$netfile") local dir=$(get_filepath "$netfile") - [[ -z "$dir" ]] && dir="$SRCDEST/$(get_filename "$netfile")" - - local repo=${netfile##*/} - repo=${repo%%#*} + [[ -z "$dir" ]] && dir="$SRCDEST/$repo" + local rel_dir=$(dirname "$repo") + repo=$(basename "$repo") msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "hg" - pushd "$srcdir" &>/dev/null + mkdir -p "$srcdir/$rel_dir" + pushd "$srcdir/$rel_dir" &>/dev/null rm -rf "${dir##*/}" local ref @@ -732,14 +734,15 @@ extract_svn() { unset fragment fi + local repo=$(get_filename "$netfile") local dir=$(get_filepath "$netfile") - [[ -z "$dir" ]] && dir="$SRCDEST/$(get_filename "$netfile")" - - local repo=${netfile##*/} - repo=${repo%%#*} + [[ -z "$dir" ]] && dir="$SRCDEST/$repo" + local rel_dir=$(dirname "$repo") + repo=$(basename "$repo") msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "svn" - pushd "$srcdir" &>/dev/null + mkdir -p "$srcdir/$rel_dir" + pushd "$srcdir/$rel_dir" &>/dev/null rm -rf "${dir##*/}" local ref -- 2.0.0