Kaydet (Commit) 2f663959 authored tarafından Your Name's avatar Your Name

fix destdir remove

üst 5cd128e8
......@@ -445,9 +445,9 @@ class ArchiveTar(ArchiveBase):
shutil.rmtree(tarinfo.name)
try:
if not os.path.isdir("/"+tarinfo.name) and not os.path.islink("/"+tarinfo.name):
if not os.path.isdir(tarinfo.name) and not os.path.islink(tarinfo.name):
try:
os.unlink("/"+tarinfo.name)
os.unlink(tarinfo.name)
except:
# TODO: review this block
pass
......
......@@ -68,6 +68,7 @@ class Package:
def __init__(self, packagefn, mode='r', format=None,
tmp_dir=None, pkgname='', no_fetch=False):
self.filepath = packagefn
self.destdir = ctx.config.dest_dir()
url = inary.uri.URI(packagefn)
if ("://" in self.filepath) and not no_fetch:
......@@ -225,17 +226,19 @@ class Package:
# Also, tar.extract() doesn't write on symlinks...
# We remove file symlinks before (directory symlinks
# broke system)
if not os.path.isdir(tarinfo.name):
if os.path.islink(tarinfo.name):
link = os.readlink(tarinfo.name)
if not os.path.isdir(link):
if not os.path.isdir(self.destdir+"/"+tarinfo.name):
if os.path.islink(self.destdir+"/"+tarinfo.name):
link = os.readlink(self.destdir+"/"+tarinfo.name)
if not os.path.isdir(self.destdir+"/"+link):
try:
os.unlink(tarinfo.name)
if os.path.exists(self.destdir+"/"+tarinfo.name):
os.unlink(self.destdir+"/"+tarinfo.name)
except OSError as e:
ctx.ui.warning(e)
else:
try:
os.unlink(tarinfo.name)
if os.path.exists(self.destdir+"/"+tarinfo.name):
os.unlink(self.destdir+"/"+tarinfo.name)
except OSError as e:
ctx.ui.warning(e)
......
......@@ -21,7 +21,7 @@ then
echo "$sulin is a file. You must delete or move."
exit 1
fi
inary ar sulin https://master.dl.sourceforge.net/project/sulinos/SulinRepository/inary-index.xml -y -D$sulin
inary ar sulin https://master.dl.sourceforge.net/project/sulinos/SulinRepository/inary-index.xml.xz -y -D$sulin
inary ur -y -D$sulin
inary it baselayout --ignore-dep --ignore-safety --ignore-configure -y -D$sulin
inary it -c system.base -y --ignore-configure -D$sulin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment