Pass relative paths of patches to quilt. This makes the

patches directory have the same structure as the files
directory of package.
This commit is contained in:
Fatih Aşıcı
2009-06-26 05:47:55 +00:00
parent 0ac62f6d5a
commit 7f6b686835
3 changed files with 13 additions and 4 deletions
+5
View File
@@ -1,3 +1,8 @@
2009-06-26 Fatih Aşıcı <fatih@pardus.org.tr>
* Pass relative paths of patches to quilt. This makes the
patches directory have the same structure as the files
directory of package.
2009-06-16 Fatih Aşıcı <fatih@pardus.org.tr>
* Fix resetting of the environment.
+3 -2
View File
@@ -596,14 +596,15 @@ class Builder:
for patch in self.spec.source.patches:
patchFile = pisi.util.join_path(files_dir, patch.filename)
relativePath = patch.filename
if patch.compressionType:
patchFile = pisi.util.uncompress(patchFile,
compressType=patch.compressionType,
targetDir=ctx.config.tmp_dir())
relativePath = relativePath.rsplit(".%s" % patch.compressionType, 1)[0]
ctx.ui.action(_("* Applying patch: %s") % patch.filename)
pisi.util.do_patch(self.srcDir, patchFile, level=patch.level)
return True
pisi.util.do_patch(self.srcDir, patchFile, level=patch.level, name=relativePath)
return True
def generate_static_package_object(self):
+5 -2
View File
@@ -443,7 +443,7 @@ def uncompress(patchFile, compressType="gz", targetDir=None):
return filePath
def do_patch(sourceDir, patchFile, level = 0):
def do_patch(sourceDir, patchFile, level=0, name=None):
"""Apply given patch to the sourceDir."""
cwd = os.getcwd()
os.chdir(sourceDir)
@@ -451,6 +451,9 @@ def do_patch(sourceDir, patchFile, level = 0):
if level == None:
level = 0
if name is None:
name = os.path.basename(patchFile)
check_file(patchFile)
if ctx.get_option('use_quilt'):
@@ -459,7 +462,7 @@ def do_patch(sourceDir, patchFile, level = 0):
if not os.path.exists(patchesDir):
os.makedirs(patchesDir)
# Import original patch into quilt tree
(ret, out, err) = run_batch('quilt import -p %d -P %s \"%s\"' % (level, os.path.basename(patchFile), patchFile))
(ret, out, err) = run_batch('quilt import -p %d -P %s \"%s\"' % (level, name, patchFile))
# run quilt push to apply original patch into tree
(ret, out, err) = run_batch('quilt push')
else: