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

Bugs are fixed

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