Kaydet (Commit) 1b5bcbd5 authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Main branch was returned this side.

tüm geliştirmelerin parça parça koda yedirilmesi için kod yeri çekildi.
üst d0d311be
......@@ -928,7 +928,7 @@ class SourceArchive:
# check hash
if util.check_file_hash(self.archiveFile, self.archive.sha1sum):
if interactive:
ctx.ui.info(_('{} [cached]').format(self.archive.name),noln=True)
ctx.ui.info(_('{} [cached]').format(self.archive.name))
return True
return False
......
......@@ -205,7 +205,7 @@ class PackageOp(Command):
def __init__(self, args):
super(PackageOp, self).__init__(args)
self.scom = False
self.scom = True
def options(self, group):
group.add_option("--ignore-dependency", action="store_true",
......
......@@ -12,11 +12,11 @@
# Please read the COPYING file.
#
import gettext
import optparse
import os
import sys
import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
......
......@@ -209,7 +209,7 @@ def takeback(operation):
errors = []
paths = []
for pkg in beinstalled:
ctx.ui.info(_("\nDownloading %d / %d") % (beinstalled.index(pkg) + 1, len(beinstalled)), color="yellow")
ctx.ui.info(_("Downloading %d / %d") % (beinstalled.index(pkg) + 1, len(beinstalled)), color="yellow")
pkg += ctx.const.package_suffix
if fetch_remote_file(pkg, errors):
paths.append(os.path.join(ctx.config.cached_packages_dir(), pkg))
......
......@@ -97,7 +97,7 @@ def install_pkg_names(A, reinstall=False, extra=False):
paths = []
extra_paths = {}
for x in order:
ctx.ui.info(_("\nDownloading %d / %d") % (order.index(x) + 1, len(order)), color="yellow")
ctx.ui.info(_("Downloading %d / %d") % (order.index(x) + 1, len(order)), color="yellow")
install_op = atomicoperations.Install.from_name(x)
paths.append(install_op.package_fname)
if x in extra_packages or (extra and x in A):
......
......@@ -216,7 +216,7 @@ def upgrade(A=None, repo=None):
paths = []
for x in order:
ctx.ui.info(_("\nDownloading %d / %d") % (order.index(x) + 1, len(order)), color="yellow")
ctx.ui.info(_("Downloading %d / %d") % (order.index(x) + 1, len(order)), color="yellow")
install_op = atomicoperations.Install.from_name(x)
paths.append(install_op.package_fname)
......
......@@ -109,7 +109,7 @@ class Package:
url))
raise
else:
ctx.ui.info(_('{} [cached]').format(url.filename()),noln=True)
ctx.ui.info(_('{} [cached]').format(url.filename()))
def add_to_package(self, fn, an=None):
"""Add a file or directory to package"""
......
......@@ -15,15 +15,12 @@
import inary.context as ctx
import inary.errors
class Error(inary.errors.Error):
pass
class Exception(inary.errors.Exception):
pass
def error(msg):
if ctx.config.get_option('ignore_action_errors'):
ctx.ui.error(msg)
......
......@@ -13,6 +13,7 @@
#
class Actions:
template = """
from inary.actionsapi import inarytools
......
......@@ -13,7 +13,6 @@
class _constant:
"""Constant members implementation"""
class ConstError(TypeError):
pass
......@@ -29,8 +28,8 @@ class _constant:
# we don't have an attribute by this name
raise NameError(name)
class Constants:
__c = _constant()
def __getattr__(self, attr):
......@@ -42,7 +41,6 @@ class Constants:
def __delattr__(self, attr):
delattr(self.__c, attr)
consts = Constants()
consts.scenarios_path = "scenarios/"
......
#!/usr/bin/python
# -*- coding: utf-8 -*-
#-*- coding: utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
......@@ -14,37 +14,29 @@
#
import os
import inary.util as util
from inary.scenarioapi.constants import *
def inary_upgraded(*args):
packages = util.strlist(args).rstrip()
os.system("inary -D{0} upgrade {1}".format(consts.inary_db, packages))
def inary_info(package):
os.system("inary -D{0} info {1}".format(consts.inary_db, package))
def inary_removed(*args):
packages = util.strlist(args).rstrip()
os.system("inary -D{0} remove {1}".format(consts.inary_db, packages))
def inary_added_repo(name, url):
os.system("inary -D{0} add-repo -y {1} {2}".format(consts.inary_db, name, url))
def inary_updated_repo():
os.system("inary -D{0} update-repo".fotmat(consts.inary_db))
def inary_installed(*args):
packages = util.strlist(args).rstrip()
os.system("inary -D{0} install {1}".format(consts.inary_db, packages))
def inary_reinstalled(package):
os.system("inary -D{0} install --reinstall {1}".format(consts.inary_db, package))
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#-*- coding: utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
......@@ -13,21 +13,20 @@
# Please read the COPYING file.
#
import gettext
import glob
import os
import glob
from inary.scenarioapi.pspec import Pspec
from inary.scenarioapi.actions import Actions
from inary.scenarioapi.constants import *
from inary.scenarioapi.pspec import Pspec
from inary.scenarioapi.withops import *
import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
class Package:
def __init__(self, name, deps=None, cons=None, date="2006-18-18", ver="1.0", partOf="None"):
def __init__(self, name, deps=None, cons=None, date ="2006-18-18", ver ="1.0", partOf="None"):
if deps is None:
deps = []
if cons is None:
......@@ -103,7 +102,6 @@ class Package:
self.actions.write()
self.create_inary()
if __name__ == "__main__":
p = Package("w0rmux", [], [], "0.7")
p.version_bump()
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#-*- coding: utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
......@@ -13,13 +13,11 @@
# Please read the COPYING file.
#
from inary.conflict import Conflict
from inary.specfile import SpecFile, Package, Update, Path, Action, Archive, AnyDependency
from inary.dependency import Dependency
from inary.specfile import SpecFile, Package, Update, Path, Action, Archive
from inary.conflict import Conflict
from inary.sxml.autoxml import LocalText
class Pspec:
def __init__(self, pkgname, filepath):
self.pspec = SpecFile()
......@@ -160,7 +158,7 @@ class Pspec:
self.pspec.packages.append(self.package)
def set_history(self, date, version, comment="No Comment", release="1"):
def set_history(self, date, version, comment = "No Comment", release = "1"):
self.update.date = date
self.update.version = version
self.update.comment = comment
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#-*- coding: utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
......@@ -13,19 +13,18 @@
# Please read the COPYING file.
#
import gettext
import os
from inary.scenarioapi.constants import *
from inary.scenarioapi.package import Package
from inary.scenarioapi.withops import *
from inary.scenarioapi.constants import *
import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
repodb = {}
def repo_added_package(package, *args):
if package in repodb:
raise Exception(_("Repo already has package named {}.").format(package))
......@@ -50,7 +49,6 @@ def repo_added_package(package, *args):
repodb[package] = Package(package, dependencies, conflicts, ver=version, partOf=partOf)
def repo_removed_package(package):
if package not in repodb:
raise Exception(_("Repo does not have package named {}.").format(package))
......@@ -58,7 +56,6 @@ def repo_removed_package(package):
os.unlink(os.path.join(consts.repo_path, repodb[package].get_file_name()))
del repodb[package]
def repo_version_bumped(package, *args):
if package not in repodb:
raise Exception(_("Repo does not have package named {}.").format(package))
......@@ -67,7 +64,6 @@ def repo_version_bumped(package, *args):
repodb[package].version_bump(*args)
os.unlink(os.path.join(consts.repo_path, old_file))
def repo_updated_index():
cur = os.getcwd()
path = os.path.join(cur, consts.repo_path)
......@@ -75,6 +71,5 @@ def repo_updated_index():
os.system("inary index --skip-signing {} >/dev/null 2>&1".format(path))
os.chdir(cur)
def repo_get_url():
return "."
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#-*- coding: utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
......@@ -15,16 +15,14 @@
import os
from inary.scenarioapi.constants import *
from inary.scenarioapi.inaryops import *
from inary.scenarioapi.repoops import *
from inary.scenarioapi.inaryops import *
from inary.scenarioapi.constants import *
def let_repo_had(package, *args):
repo_added_package(package, *args)
repo_updated_index()
def let_inary_had(*args):
url = os.path.join(os.getcwd(), consts.repo_url)
inary_added_repo(consts.repo_name, url)
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#-*- coding: utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
......@@ -16,12 +16,10 @@
ADDED, REMOVED, INIT = list(range(3))
PARTOF, VERSION, CONFLICT, DEPENDENCY, REQUIRES = list(range(5))
class With:
def __init__(self):
pass
def with_action(types, action, data):
w = With()
w.types = types
......@@ -29,43 +27,33 @@ def with_action(types, action, data):
w.data = data
return w
def with_partof(partof):
return with_action(PARTOF, INIT, partof)
def with_version(version):
return with_action(VERSION, INIT, version)
def with_conflicts(*cons):
return with_action(CONFLICT, INIT, cons)
def with_requiring_actions(*action):
return with_action(REQUIRES, ADDED, action)
def with_dependencies(*deps):
return with_action(DEPENDENCY, INIT, deps)
def with_added_conflicts(*cons):
return with_action(CONFLICT, ADDED, cons)
def with_removed_conflicts(*cons):
return with_action(CONFLICT, REMOVED, cons)
def with_added_dependencies(*deps):
return with_action(DEPENDENCY, ADDED, deps)
def with_removed_dependencies(*deps):
return with_action(DEPENDENCY, REMOVED, deps)
def with_added_conflict(package, **kw):
assert len(kw) <= 1
......@@ -73,17 +61,16 @@ def with_added_conflict(package, **kw):
return with_action(CONFLICT, ADDED, [package])
if ("versionFrom" in kw or
"versionTo" in kw or
"version" in kw or
"releaseFrom" in kw or
"releaseTo" in kw or
"release" in kw):
"versionTo" in kw or
"version" in kw or
"releaseFrom" in kw or
"releaseTo" in kw or
"release" in kw):
return with_action(CONFLICT, ADDED, [kw, package])
# pass other keywords.
return with_action(CONFLICT, ADDED, [package])
def with_added_dependency(package, **kw):
assert len(kw) <= 1
......@@ -91,11 +78,11 @@ def with_added_dependency(package, **kw):
return with_action(DEPENDENCY, ADDED, [package])
if ("versionFrom" in kw or
"versionTo" in kw or
"version" in kw or
"releaseFrom" in kw or
"releaseTo" in kw or
"release" in kw):
"versionTo" in kw or
"version" in kw or
"releaseFrom" in kw or
"releaseTo" in kw or
"release" in kw):
return with_action(DEPENDENCY, ADDED, [kw, package])
# pass other keywords.
......
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