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): ...@@ -733,10 +733,9 @@ class ArchiveZip(ArchiveBase):
if is_dir: # this is a directory if is_dir: # this is a directory
if not os.path.isdir(ofile): if not os.path.isdir(ofile):
os.makedirs(ofile) os.makedirs(ofile)
perm = info.external_attr perm = info.external_attr >> 16
perm &= 0xFFFF0000 if perm == 0:
perm >>= 16 perm = 33261 # octets of -rwxr-xr-x
perm |= 0x00000100
os.chmod(ofile, perm) os.chmod(ofile, perm)
continue continue
...@@ -756,11 +755,9 @@ class ArchiveZip(ArchiveBase): ...@@ -756,11 +755,9 @@ class ArchiveZip(ArchiveBase):
target = self.zip_obj.read(info.filename) target = self.zip_obj.read(info.filename)
os.symlink(target, ofile) os.symlink(target, ofile)
else: else:
perm = info.external_attr perm = info.external_attr >> 16
perm &= 0x08FF0000 if perm==0:
perm >>= 16 perm=33261 # -rwxr-xr-x
perm |= 0x00000100
info.filename = outpath info.filename = outpath
self.zip_obj.extract(info, target_dir) self.zip_obj.extract(info, target_dir)
os.chmod(ofile, perm) os.chmod(ofile, perm)
......
...@@ -128,8 +128,6 @@ class Command(object): ...@@ -128,8 +128,6 @@ class Command(object):
pass pass
def process_opts(self): def process_opts(self):
self.check_auth_info()
# make destdir absolute # make destdir absolute
if self.options.destdir: if self.options.destdir:
d = str(self.options.destdir) d = str(self.options.destdir)
...@@ -138,32 +136,8 @@ class Command(object): ...@@ -138,32 +136,8 @@ class Command(object):
os.makedirs(d) os.makedirs(d)
self.options.destdir = os.path.realpath(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): def init(self, database=True, write=True, locked=False):
"""initialize INARY components""" """initialize INARY components"""
if self.options: if self.options:
ui = inary.cli.CLI(self.options.debug, self.options.verbose) ui = inary.cli.CLI(self.options.debug, self.options.verbose)
else: 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