pisi/util.py ve pisi/specfile.py eski haline geri döndü, sadece build.py'de değişiklikler yapıldı
This commit is contained in:
+2
-7
@@ -247,13 +247,8 @@ class PisiBuild:
|
|||||||
install_dir = self.ctx.pkg_dir() + const.install_dir_suffix
|
install_dir = self.ctx.pkg_dir() + const.install_dir_suffix
|
||||||
for afile in package.additionalFiles:
|
for afile in package.additionalFiles:
|
||||||
src = os.path.join(const.files_dir, afile.filename)
|
src = os.path.join(const.files_dir, afile.filename)
|
||||||
dest = os.path.join(install_dir + afile.target)
|
dest = os.path.join(install_dir + os.path.dirname(afile.target), os.path.basename(afile.target))
|
||||||
if not afile.fileas:
|
util.copy_file(src, dest)
|
||||||
util.copy_file(src, dest, fileas=afile.filename)
|
|
||||||
dest += afile.filename
|
|
||||||
else:
|
|
||||||
util.copy_file(src, dest, fileas=afile.fileas)
|
|
||||||
dest += afile.fileas
|
|
||||||
if afile.permission:
|
if afile.permission:
|
||||||
os.chmod(dest, int(afile.permission) | 0777)
|
os.chmod(dest, int(afile.permission) | 0777)
|
||||||
if afile.owner:
|
if afile.owner:
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ class AdditionalFileInfo:
|
|||||||
self.target = getNodeAttribute(node, "target")
|
self.target = getNodeAttribute(node, "target")
|
||||||
self.permission = getNodeAttribute(node, "permission")
|
self.permission = getNodeAttribute(node, "permission")
|
||||||
self.owner = getNodeAttribute(node, "owner")
|
self.owner = getNodeAttribute(node, "owner")
|
||||||
self.fileas = getNodeAttribute(node, "fileas")
|
|
||||||
|
|
||||||
def elt(self, xml):
|
def elt(self, xml):
|
||||||
node = xml.newNode("AdditionalFile")
|
node = xml.newNode("AdditionalFile")
|
||||||
@@ -47,8 +46,6 @@ class AdditionalFileInfo:
|
|||||||
node.setAttribute("permission", self.permission)
|
node.setAttribute("permission", self.permission)
|
||||||
if self.owner:
|
if self.owner:
|
||||||
node.setAttribute("owner", self.owner)
|
node.setAttribute("owner", self.owner)
|
||||||
if self.owner:
|
|
||||||
node.setAttribute("fileas", self.fileas)
|
|
||||||
|
|
||||||
def verify(self):
|
def verify(self):
|
||||||
if not self.filename: return False
|
if not self.filename: return False
|
||||||
|
|||||||
+2
-5
@@ -166,14 +166,11 @@ def dir_size(dir):
|
|||||||
yield sum([getsize(join(root, name)) for name in files if not islink(join(root,name))])
|
yield sum([getsize(join(root, name)) for name in files if not islink(join(root,name))])
|
||||||
return sum( sizes() )
|
return sum( sizes() )
|
||||||
|
|
||||||
def copy_file(src, dest, fileas=''):
|
def copy_file(src, dest):
|
||||||
"""copy source file to destination file"""
|
"""copy source file to destination file"""
|
||||||
check_file(src)
|
check_file(src)
|
||||||
check_dir(os.path.dirname(dest))
|
check_dir(os.path.dirname(dest))
|
||||||
if not fileas:
|
shutil.copyfile(src, dest)
|
||||||
shutil.copyfile(src, dest)
|
|
||||||
else:
|
|
||||||
shutil.copyfile(src, dest + '/' + fileas)
|
|
||||||
|
|
||||||
def get_file_hashes(top, excludePrefixes=None, removePrefix=None):
|
def get_file_hashes(top, excludePrefixes=None, removePrefix=None):
|
||||||
"""Generator function iterates over a toplevel path and returns the
|
"""Generator function iterates over a toplevel path and returns the
|
||||||
|
|||||||
Reference in New Issue
Block a user