Compare commits

...

2 Commits

Author SHA1 Message Date
329c31da7d Repair any mis-directed android-1.0 annotated tags
The initial open source release of the Android 1.0 platform had
some problems with its Perforce->Git imports.  Google was forced
to rewrite some history to redirect users onto more stable upstream
sources and correct errors in the imports.

Not everyone has the correct android-1.0 tags, as some users did
manage to fetch the platform early, before the mirror sites crashed
and the history was rewritten.

This change is a band-aid to ensure any stale android-1.0 tags are
get updated to the corrected version.  It should be backed out at
some point in the near future, when we can be fairly certain that
everyone has the correct android-1.0 tags.

Signed-off-by: Shawn O. Pearce <sop@google.com>
2008-10-24 09:17:25 -07:00
5cc6679fb8 Support user supplied custom .repo/local_manifest.xml files
By creating a .repo/local_manifest.xml the user can add extra
projects into their client space, without touching the main
manifest script.

For example:

  $ cat .repo/local_manifest.xml
  <?xml version="1.0" encoding="UTF-8"?>
  <manifest>
   <project path="android-build"
            name="platform/build"
            remote="korg"
            revision="android-1.0" />
  </manifest>

Signed-off-by: Shawn O. Pearce <sop@google.com>
2008-10-23 16:20:14 -07:00
2 changed files with 42 additions and 5 deletions

View File

@ -26,6 +26,7 @@ from remote import Remote
from error import ManifestParseError from error import ManifestParseError
MANIFEST_FILE_NAME = 'manifest.xml' MANIFEST_FILE_NAME = 'manifest.xml'
LOCAL_MANIFEST_NAME = 'local_manifest.xml'
class _Default(object): class _Default(object):
"""Project defaults within the manifest.""" """Project defaults within the manifest."""
@ -108,10 +109,20 @@ class Manifest(object):
def _Load(self): def _Load(self):
if not self._loaded: if not self._loaded:
self._ParseManifest() self._ParseManifest(True)
local = os.path.join(self.repodir, LOCAL_MANIFEST_NAME)
if os.path.exists(local):
try:
real = self.manifestFile
self.manifestFile = local
self._ParseManifest(False)
finally:
self.manifestFile = real
self._loaded = True self._loaded = True
def _ParseManifest(self): def _ParseManifest(self, is_root_file):
root = xml.dom.minidom.parse(self.manifestFile) root = xml.dom.minidom.parse(self.manifestFile)
if not root or not root.childNodes: if not root or not root.childNodes:
raise ManifestParseError, \ raise ManifestParseError, \
@ -124,9 +135,10 @@ class Manifest(object):
"no <manifest> in %s" % \ "no <manifest> in %s" % \
self.manifestFile self.manifestFile
self.branch = config.getAttribute('branch') if is_root_file:
if not self.branch: self.branch = config.getAttribute('branch')
self.branch = 'default' if not self.branch:
self.branch = 'default'
for node in config.childNodes: for node in config.childNodes:
if node.nodeName == 'remote': if node.nodeName == 'remote':

View File

@ -470,6 +470,7 @@ class Project(object):
return False return False
if not self._RemoteFetch(): if not self._RemoteFetch():
return False return False
self._RepairAndroidImportErrors()
self._InitMRef() self._InitMRef()
return True return True
@ -477,6 +478,30 @@ class Project(object):
for file in self.copyfiles: for file in self.copyfiles:
file._Copy() file._Copy()
def _RepairAndroidImportErrors(self):
if self.name in ['platform/external/iptables',
'platform/external/libpcap',
'platform/external/tcpdump',
'platform/external/webkit',
'platform/system/wlan/ti']:
# I hate myself for doing this...
#
# In the initial Android 1.0 release these projects were
# shipped, some users got them, and then the history had
# to be rewritten to correct problems with their imports.
# The 'android-1.0' tag may still be pointing at the old
# history, so we need to drop the tag and fetch it again.
#
try:
remote = self.GetRemote(self.remote.name)
relname = remote.ToLocal(R_HEADS + 'release-1.0')
tagname = R_TAGS + 'android-1.0'
if self._revlist(not_rev(relname), tagname):
cmd = ['fetch', remote.name, '+%s:%s' % (tagname, tagname)]
GitCommand(self, cmd, bare = True).Wait()
except GitError:
pass
def Sync_LocalHalf(self): def Sync_LocalHalf(self):
"""Perform only the local IO portion of the sync process. """Perform only the local IO portion of the sync process.
Network access is not required. Network access is not required.