* revert this.
We upgraded pisi db. But "from imports" of pisi do not let us reload all the extracted modules and than safely run rebuild-db.
This commit is contained in:
+1
-1
@@ -496,7 +496,7 @@ class Builder:
|
|||||||
targetDir=ctx.config.tmp_dir())
|
targetDir=ctx.config.tmp_dir())
|
||||||
|
|
||||||
ctx.ui.action(_("* Applying patch: %s") % patch.filename)
|
ctx.ui.action(_("* Applying patch: %s") % patch.filename)
|
||||||
util.do_patch(self.srcDir, patchFile, level=patch.level)
|
util.do_patch(self.srcDir, patchFile, level=patch.level, target=patch.target)
|
||||||
|
|
||||||
def generate_static_package_object(self):
|
def generate_static_package_object(self):
|
||||||
ar_files = []
|
ar_files = []
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ class Patch:
|
|||||||
s_Filename = [autoxml.String, autoxml.mandatory]
|
s_Filename = [autoxml.String, autoxml.mandatory]
|
||||||
a_compressionType = [autoxml.String, autoxml.optional]
|
a_compressionType = [autoxml.String, autoxml.optional]
|
||||||
a_level = [autoxml.Integer, autoxml.optional]
|
a_level = [autoxml.Integer, autoxml.optional]
|
||||||
|
a_target = [autoxml.String, autoxml.optional]
|
||||||
|
|
||||||
#FIXME: what's the cleanest way to give a default value for reading level?
|
#FIXME: what's the cleanest way to give a default value for reading level?
|
||||||
#def decode_hook(self, node, errs, where):
|
#def decode_hook(self, node, errs, where):
|
||||||
@@ -80,6 +81,8 @@ class Patch:
|
|||||||
s += ' (' + self.compressionType + ')'
|
s += ' (' + self.compressionType + ')'
|
||||||
if self.level:
|
if self.level:
|
||||||
s += ' level:' + self.level
|
s += ' level:' + self.level
|
||||||
|
if self.target:
|
||||||
|
s += ' target:' + self.target
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -480,17 +480,19 @@ def uncompress(patchFile, compressType="gz", targetDir=None):
|
|||||||
return filePath
|
return filePath
|
||||||
|
|
||||||
|
|
||||||
def do_patch(sourceDir, patchFile, level = 0):
|
def do_patch(sourceDir, patchFile, level = 0, target = ''):
|
||||||
"""Apply given patch to the sourceDir."""
|
"""Apply given patch to the sourceDir."""
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
os.chdir(sourceDir)
|
os.chdir(sourceDir)
|
||||||
|
|
||||||
if level == None:
|
if level == None:
|
||||||
level = 0
|
level = 0
|
||||||
|
if target == None:
|
||||||
|
target = ''
|
||||||
|
|
||||||
check_file(patchFile)
|
check_file(patchFile)
|
||||||
(ret, out, err) = run_batch("patch -p%d < %s" %
|
(ret, out, err) = run_batch("patch -p%d %s < %s" %
|
||||||
(level, patchFile))
|
(level, target, patchFile))
|
||||||
if ret:
|
if ret:
|
||||||
if out is None and err is None:
|
if out is None and err is None:
|
||||||
# Which means stderr and stdout directed so they are None
|
# Which means stderr and stdout directed so they are None
|
||||||
|
|||||||
Reference in New Issue
Block a user