Try to migrate git.eclass checkouts to the new eclass.
authorMichał Górny <mgorny@gentoo.org>
Fri, 23 Sep 2011 13:58:58 +0000 (13:58 +0000)
committerMichał Górny <mgorny@gentoo.org>
Fri, 23 Sep 2011 13:58:58 +0000 (13:58 +0000)
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=383761

eclass/git-2.eclass

index d2a8a2e3a73ecd43dd46cf63c2129bd0c623c59e..59db57eaa2c30c43f935df5b56b7e4aadc73f3db 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.23 2011/09/23 13:58:35 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.24 2011/09/23 13:58:58 mgorny Exp $
 
 # @ECLASS: git-2.eclass
 # @MAINTAINER:
@@ -264,6 +264,18 @@ git-2_prepare_storedir() {
                        clone_dir=${EGIT_REPO_URI##*/}
                fi
                EGIT_DIR=${EGIT_STORE_DIR}/${clone_dir}
+
+               # Try to migrate from git.eclass git-src/
+               if [[ ! -d ${EGIT_DIR} && ${EGIT_STORE_DIR} == */egit-src ]]; then
+                       local old_store_dir=${EGIT_STORE_DIR/%egit-src/git-src}
+                       local old_location=${old_store_dir}/${EGIT_PROJECT:-${PN}}
+
+                       if [[ -d ${old_location} ]]; then
+                               elog "${FUNCNAME}: ${CATEGORY}/${PF} will be cloned from old location."
+                               elog "It will be necessary to rebuild the package to fetch updates."
+                               EGIT_REPO_URI="${old_location} ${EGIT_REPO_URI}"
+                       fi
+               fi
        fi
        export EGIT_DIR=${EGIT_DIR}
        debug-print "${FUNCNAME}: Storing the repo into \"${EGIT_DIR}\"."