diff --git a/inary/archive.py b/inary/archive.py index 618baa634b593f218566e0096247d91ac275c27b..245a2ef7ab6171ec98008caccbd8a8c28293ecb3 100644 --- a/inary/archive.py +++ b/inary/archive.py @@ -733,6 +733,10 @@ class ArchiveZip(ArchiveBase): if is_dir: # this is a directory if not os.path.isdir(ofile): os.makedirs(ofile) + perm = info.external_attr >> 16 + if perm == 0: + perm = 33261 # octets of -rwxr-xr-x + os.chmod(ofile, perm) continue # check that output dir is present @@ -751,8 +755,12 @@ class ArchiveZip(ArchiveBase): target = self.zip_obj.read(info.filename) os.symlink(target, ofile) else: + 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) def unpack_files(self, paths, target_dir): self.unpack_file_cond(lambda f: f in paths, target_dir) diff --git a/inary/cli/command.py b/inary/cli/command.py index f631b1f9905a6a9663a9d56ffb3fdf0a138e1964..4a94f10cc101c120c03d22bae9f88cc0a61d7ab0 100644 --- a/inary/cli/command.py +++ b/inary/cli/command.py @@ -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: diff --git a/inary/constants.py b/inary/constants.py index e9b53301b784f3a4701493f180788cc3c23bf6d7..b18414921a5663d79c25f91c538a1021e3b15662 100644 --- a/inary/constants.py +++ b/inary/constants.py @@ -69,6 +69,8 @@ class Constants(metaclass=Singleton): self.__c.lzma_suffix = ".lzma" # suffix for xz self.__c.xz_suffix = ".xz" + # suffix for gz + self.__c.gz_suffix = ".gz" self.__c.partial_suffix = ".part" self.__c.temporary_suffix = ".tmp" diff --git a/inary/operations/build.py b/inary/operations/build.py index 346cc85bf7ad7dfe61cdbe87f98d4a2caa3cb61b..e7452c1c9a2f39b23e589e376e29e9567ba74179 100644 --- a/inary/operations/build.py +++ b/inary/operations/build.py @@ -1208,13 +1208,15 @@ package might be a good solution.")) orgname = util.join_path("debug", finfo.path) pkg.add_to_install(orgname, finfo.path) - if self.target_package_format == "1.2": + if self.target_package_format == "1.3": + archive_format = ".tar.gz" + elif self.target_package_format == "1.2": archive_format = ".tar.xz" elif self.target_package_format == "1.1": archive_format = ".tar.lzma" else: # "1.0" format does not have an archive - archive_format = "" + archive_format = ".tar" self.metadata.package.installTarHash = util.sha1_file( "{0}/install{1}".format(self.pkg_dir(), archive_format)) diff --git a/inary/package.py b/inary/package.py index 19efb923b5cb265f5bc3715a0c0ab79044051e6f..d3c57a6c78497a4de2562593880cebd54431cb49 100644 --- a/inary/package.py +++ b/inary/package.py @@ -40,21 +40,24 @@ class Package: """INARY Package Class provides access to a inary package (.inary file).""" - formats = ("1.0", "1.1", "1.2") + formats = ("1.0", "1.1", "1.2", "1.3") default_format = "1.2" timestamp = None @staticmethod def archive_name_and_format(package_format): - if package_format == "1.2": + if package_format == "1.3": + archive_format = "targz" + archive_suffix = ctx.const.gz_suffix + elif package_format == "1.2": archive_format = "tarxz" archive_suffix = ctx.const.xz_suffix elif package_format == "1.1": archive_format = "tarlzma" archive_suffix = ctx.const.lzma_suffix else: - # "1.0" format does not have an archive - return None, None + archive_format = "tar" + archive_suffix = "" archive_name = ctx.const.install_tar + archive_suffix return archive_name, archive_format @@ -121,11 +124,6 @@ class Package: if arcname is None: arcname = name - if self.format == "1.0": - arcname = util.join_path("install", arcname) - self.add_to_package(name, arcname) - return - if self.install_archive is None: archive_name, archive_format = \ self.archive_name_and_format(self.format)