Unverified Kaydet (Commit) 84ec972f authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Merge branch 'patch-41838' into patch-41837

Fixed archive problems.
......@@ -733,10 +733,9 @@ class ArchiveZip(ArchiveBase):
if is_dir: # this is a directory
if not os.path.isdir(ofile):
os.makedirs(ofile)
perm = info.external_attr
perm &= 0xFFFF0000
perm >>= 16
perm |= 0x00000100
perm = info.external_attr >> 16
if perm == 0:
perm = 33261 # octets of -rwxr-xr-x
os.chmod(ofile, perm)
continue
......@@ -756,11 +755,9 @@ class ArchiveZip(ArchiveBase):
target = self.zip_obj.read(info.filename)
os.symlink(target, ofile)
else:
perm = info.external_attr
perm &= 0x08FF0000
perm >>= 16
perm |= 0x00000100
perm = info.external_attr >> 16
if perm==0:
perm=33261 # -rwxr-xr-x
info.filename = outpath
self.zip_obj.extract(info, target_dir)
os.chmod(ofile, perm)
......
......@@ -128,8 +128,6 @@ class Command(object):
pass
def process_opts(self):
self.check_auth_info()
# make destdir absolute
if self.options.destdir:
d = str(self.options.destdir)
......@@ -138,32 +136,8 @@ class Command(object):
os.makedirs(d)
self.options.destdir = os.path.realpath(d)
def check_auth_info(self):
username = self.options.username
password = self.options.password
# TODO: We'll get the username, password pair from a configuration
# file from users home directory. Currently we need user to
# give it from the user interface.
# if not username and not password:
# if someauthconfig.username and someauthconfig.password:
# self.authInfo = (someauthconfig.username,
# someauthconfig.password)
# return
if username and password:
self.options.authinfo = (username, password)
return
if username and not password:
from getpass import getpass
password = getpass(_("Password: "))
self.options.authinfo = (username, password)
else:
self.options.authinfo = None
def init(self, database=True, write=True, locked=False):
"""initialize INARY components"""
if self.options:
ui = inary.cli.CLI(self.options.debug, self.options.verbose)
else:
......
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