Previously, the sources in $srcdir were always removed prior building. After this change the sources are only updated. This makes incremental builds possible. Also this goes in line with the current behaviour for other types of sources, where the sources are just being overwritten without being removed first. --- scripts/makepkg.sh.in | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 67ec240..bb4297c 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -516,9 +516,11 @@ extract_bzr() { msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "bzr" pushd "$srcdir" &>/dev/null - rm -rf "${dir##*/}" - if ! { bzr checkout "$dir" "${revision[@]}" --lightweight && + if [[ -d "${dir##*/}" ]]; then + cd_safe "${dir##*/}" + bzr update + elif ! { bzr checkout "$dir" "${revision[@]}" --lightweight && ( cd "$repo" && bzr pull "$dir" -q --overwrite "${revision[@]}" ); }; then error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "bzr" plain "$(gettext "Aborting...")" @@ -580,9 +582,11 @@ extract_git() { msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "git" pushd "$srcdir" &>/dev/null - rm -rf "${dir##*/}" - - if ! git clone "$dir"; then + if [[ -d "${dir##*/}" ]]; then + cd_safe "${dir##*/}" + git pull + cd_safe "$srcdir" + elif ! git clone "$dir"; then error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "git" plain "$(gettext "Aborting...")" exit 1 @@ -607,7 +611,7 @@ extract_git() { fi if [[ -n $ref ]]; then - if ! git checkout -b makepkg $ref; then + if ! git checkout -B makepkg $ref; then error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "git" plain "$(gettext "Aborting...")" exit 1 @@ -662,7 +666,6 @@ extract_hg() { msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "hg" pushd "$srcdir" &>/dev/null - rm -rf "${dir##*/}" local ref if [[ -n $fragment ]]; then @@ -677,7 +680,10 @@ extract_hg() { esac fi - if ! hg clone "${ref[@]}" "$dir" "${dir##*/}"; then + if [[ -d "${dir##*/}" ]]; then + cd_safe "${dir##*/}" + hg pull -u + elif ! hg clone "${ref[@]}" "$dir" "${dir##*/}"; then error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "hg" plain "$(gettext "Aborting...")" exit 1 @@ -739,7 +745,6 @@ extract_svn() { msg2 "$(gettext "Creating working copy of %s %s repo...")" "${repo}" "svn" pushd "$srcdir" &>/dev/null - rm -rf "${dir##*/}" local ref if [[ -n $fragment ]]; then @@ -754,16 +759,20 @@ extract_svn() { esac fi - cp -a "$dir" . - if [[ -n ${ref} ]]; then - cd_safe "$(get_filename "$netfile")" + cd_safe "$dir" if ! svn update -r ${ref}; then error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "svn" plain "$(gettext "Aborting...")" fi fi + if [[ -d "${dir##*/}" ]]; then + cp -au "$dir" "$srcdir" + else + cp -a "$dir" . + fi + popd &>/dev/null } -- 1.8.4