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
|
||||
for afile in package.additionalFiles:
|
||||
src = os.path.join(const.files_dir, afile.filename)
|
||||
dest = os.path.join(install_dir + afile.target)
|
||||
if not afile.fileas:
|
||||
util.copy_file(src, dest, fileas=afile.filename)
|
||||
dest += afile.filename
|
||||
else:
|
||||
util.copy_file(src, dest, fileas=afile.fileas)
|
||||
dest += afile.fileas
|
||||
dest = os.path.join(install_dir + os.path.dirname(afile.target), os.path.basename(afile.target))
|
||||
util.copy_file(src, dest)
|
||||
if afile.permission:
|
||||
os.chmod(dest, int(afile.permission) | 0777)
|
||||
if afile.owner:
|
||||
|
||||
@@ -37,7 +37,6 @@ class AdditionalFileInfo:
|
||||
self.target = getNodeAttribute(node, "target")
|
||||
self.permission = getNodeAttribute(node, "permission")
|
||||
self.owner = getNodeAttribute(node, "owner")
|
||||
self.fileas = getNodeAttribute(node, "fileas")
|
||||
|
||||
def elt(self, xml):
|
||||
node = xml.newNode("AdditionalFile")
|
||||
@@ -47,8 +46,6 @@ class AdditionalFileInfo:
|
||||
node.setAttribute("permission", self.permission)
|
||||
if self.owner:
|
||||
node.setAttribute("owner", self.owner)
|
||||
if self.owner:
|
||||
node.setAttribute("fileas", self.fileas)
|
||||
|
||||
def verify(self):
|
||||
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))])
|
||||
return sum( sizes() )
|
||||
|
||||
def copy_file(src, dest, fileas=''):
|
||||
def copy_file(src, dest):
|
||||
"""copy source file to destination file"""
|
||||
check_file(src)
|
||||
check_dir(os.path.dirname(dest))
|
||||
if not fileas:
|
||||
shutil.copyfile(src, dest)
|
||||
else:
|
||||
shutil.copyfile(src, dest + '/' + fileas)
|
||||
shutil.copyfile(src, dest)
|
||||
|
||||
def get_file_hashes(top, excludePrefixes=None, removePrefix=None):
|
||||
"""Generator function iterates over a toplevel path and returns the
|
||||
|
||||
Reference in New Issue
Block a user