Kaydet (Commit) 5915e696 authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Bugs are fixed

üst ea5fdcc5
......@@ -291,7 +291,7 @@ class Install(AtomicOperation):
# Chowning for additional files
for _file in self.package.get_files().list:
fpath = util.join_path(ctx.config.dest_dir(), _file.path)
ctx.ui.debug("* Chowning in postinstall ({0}:{1})".format(_file.uid, _file.gid))
ctx.ui.debug("* Chowning in postinstall {0} ({1}:{2})".format(_file.path, _file.uid, _file.gid))
os.chown(fpath, int(_file.uid), int(_file.gid))
if ctx.scom:
......@@ -532,6 +532,7 @@ class Install(AtomicOperation):
inary.db.installdb.InstallDB().mark_needs_reboot(package)
# filesdb
ctx.ui.info(util.colorize(_('Adding \'{}\' to db...'), 'purple').format(self.metadata.package.name))
ctx.filesdb.add_files(self.metadata.package.name, self.files)
# installed packages
......
......@@ -46,7 +46,7 @@ Downloads the given inary packages to working directory
group.add_option("-o", "--output-dir", action="store", default=os.path.curdir,
help=_("Output directory for the fetched packages"))
group.add_option("--runtime-deps", action="store_true", default=None,
help=_("Bağımlılıkları ile indirme açıklaması."))
help=_("Download with runtime dependencies."))
def run(self):
packages = inary.db.packagedb.PackageDB()
......
......@@ -93,8 +93,7 @@ class Constants(metaclass=Singleton):
self.__c.config_pending = "configpending"
self.__c.needs_restart = "needsrestart"
self.__c.needs_reboot = "needsreboot"
self.__c.files_db = "files.db"
self.__c.files_ldb = "files.ldb"
self.__c.files_db = "files_db"
self.__c.repos = "repos"
self.__c.devel_package_end = "-devel"
self.__c.doc_package_end = "-docs?$"
......
......@@ -45,6 +45,7 @@ class FilesDB(lazydb.LazyDB):
for pkg in installdb.list_installed():
files = installdb.get_files(pkg)
self.add_files(pkg, files)
ctx.ui.info("%-80.80s\r" % (util.colorize(_('-> Adding \'{}\' to db...'), 'purple').format(pkg)), noln=True)
ctx.ui.info(inary.util.colorize(_('\nAdded files database...'), 'green'))
def get_file(self, path):
......@@ -67,7 +68,7 @@ class FilesDB(lazydb.LazyDB):
def add_files(self, pkg, files):
self.__check_filesdb()
ctx.ui.info("%-80.80s\r" % (util.colorize(_('-> Adding \'{}\' to db...'), 'purple').format(pkg)), noln=True)
for f in files.list:
key=hashlib.md5(f.path.encode('utf-8')).hexdigest()
self.filesdb[key] = pkg
......@@ -92,7 +93,6 @@ class FilesDB(lazydb.LazyDB):
return
files_db = os.path.join(ctx.config.info_dir(), ctx.const.files_db)
if not os.path.exists(files_db):
flag = "n"
elif os.access(files_db, os.W_OK):
......
......@@ -22,7 +22,7 @@ from base64 import encodestring
# Network libraries
from http.client import HTTPException
import ftplib
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.parse, urllib.error
#Gettext translation library
import gettext
......@@ -183,7 +183,7 @@ class Fetcher:
try:
try:
responseObj = urllib.request.urlopen(self.formatRequest(urllib.request.Request(uri)))
except RangeError:
ctx.ui.info(_('Requested range not satisfiable, starting again.'))
self.exist_size = 0
......@@ -341,7 +341,7 @@ class HTTPRangeHandler(urllib.request.BaseHandler):
return urllib.addinfourl(fp, headers, request.get_full_url())
def http_error_416(self, request, fp, errcode, msg, headers):
# HTTP 1.1's 'Range Not Satisfiable' error..
raise RangeError
raise RangeError
class FTPRangeHandler(urllib.request.FTPHandler):
"""
......
......@@ -12,6 +12,8 @@
# python standard library
import os
import shutil
import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
......@@ -83,9 +85,9 @@ class SourceArchive:
def fetch_from_locale(self):
url = self.url.uri
if not os.access(url, os.F_OK):
if not os.access(url[7:], os.F_OK):
raise Error(_('No such file or no permission to read'))
shutil.copy(url, self.archiveFile)
shutil.copy(url[7:], self.archiveFile)
def fetch_from_mirror(self):
......
......@@ -56,7 +56,7 @@ class XmlFile(object):
def parsexml(self, file):
try:
self.doc = iks.parseString(file)
self.doc = iks.parseString(str(file))
return self.doc
except Exception as e:
raise Error(_("File '{}' has invalid XML").format(file) )
......
......@@ -101,13 +101,12 @@ class Install(install):
self.generateConfigFile()
def installi18n(self):
pass
for name in os.listdir('po'):
if not name.endswith('.po'):
continue
lang = name[:-3]
print("Installing '{}' translations...".format(lang))
os.popen("msgfmt po/{0}.po -o po/{0}.mo".format(lang))
os.system("msgfmt po/{0}.po -o po/{0}.mo".format(lang))
if not self.root:
self.root = "/"
destpath = os.path.join(self.root, "usr/share/locale/{}/LC_MESSAGES".format(lang))
......@@ -200,7 +199,7 @@ setup(name="inary",
'scripts/check-newconfigs.py',
'scripts/inarysh',
'tools/pspec2po'],
include_package_data=True,
# include_package_data=True,
cmdclass = {'build' : Build,
'build_po' : BuildPo,
'install' : Install,
......
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