Пример #1
0
	def genFileRepo(self):
		manager = CavanGitManager(self.mPathFileRepo, self.mVerbose, name = None)
		if not manager.genGitRepo():
			return False

		listFile = self.mManifest.getFiles()
		if not listFile:
			return listFile != None

		nodeProject = self.mManifest.appendProject("platform/copyfile", self.getRelPath(self.mPathFileRepo))
		if not nodeProject:
			return False

		for node in listFile:
			pathname = self.getProjectRelPath(node)
			dirname = os.path.dirname(pathname)
			if not dirname:
				dirname = self.mPathFileRepo
			else:
				dirname = os.path.join(self.mPathFileRepo, dirname)
				if not os.path.isdir(dirname):
					os.makedirs(dirname)

			if not self.doExecute(["cp", "-a", pathname, dirname]):
				return False

			copyfile = self.mManifest.createElement("copyfile")
			if not copyfile:
				return False

			copyfile.setAttribute("dest", pathname)
			copyfile.setAttribute("src", pathname)
			nodeProject.appendChild(copyfile)

		return manager.gitAutoCommit()
Пример #2
0
	def genManifestRepo(self):
		manager = CavanGitManager(self.mPathManifestRepo, self.mVerbose, name = None)
		if not manager.genGitRepo():
			return False

		if not self.mManifest.save(os.path.join(self.mPathManifestRepo, "default.xml")):
			return False

		return manager.gitAutoCommit()