Kaydet (Commit) 8d0cd1dc authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Düzenlemeler falan filan

üst e71388e8
......@@ -9,13 +9,4 @@ install: "pip install -r requirements.txt"
script:
- ./setup.py install --root=/tmp/install-root
# prevent repoman tests from trying to fetch metadata.xsd
# mkdir -p /tmp/install-root/usr/lib/portage/cnf
# cp repoman/cnf/metadata.xsd /tmp/install-root/usr/lib/portage/cnf/
# sudo rsync -a /tmp/install-root/. /
# python -b -Wd -m portage.tests.runTests
# repoman test block
# repoman/setup.py test
# repoman/setup.py install --root=/tmp/install-root
# sudo rsync -a /tmp/install-root/. /
# python -b -Wd -m repoman.tests.runTests
- ./tests/run.py
......@@ -4,6 +4,14 @@
decode edilmeli. Yoksa Localtext ve Text type veriler ile ilgili sorun
cıkıyor
* '\xc3\xb6':
şimdi olay şu yandaki bytes olarak encode edilmiş bir ö harfi.
bu harfi öldürsen string içerisine bu hali ile ALAMAZSIN.
ama nasil olmuşsa ö ve bütün Türkçe karakterler bu şekilde
girmiş xmlden alinan veriler içerisine
* ciksemel.data() fonksiyonu:
Acaba o acaip geri donutler bununla alakali olabilir mi??
2018-01-14 Suleyman POYRAZ <nipalensisaquila@gmail.com>
* inary/atomicoperations.py --- status: not fixed flag: critical ---
......
......@@ -31,11 +31,74 @@ from inary.util import join_path, remove_prefix, uncompress
# ActionsAPI Modules
import inary.actionsapi
import inary.actionsapi.get as get
from inary.actionsapi.inarytoolsfunctions import *
from inary.actionsapi.shelltools import *
from inary.actionsapi import error
# Error Classes
class FileError(inary.actionsapi.Error):
def __init__(self, value=''):
inary.actionsapi.Error.__init__(self, value)
self.value = value
ctx.ui.error(value)
class ArgumentError(inary.actionsapi.Error):
def __init__(self, value=''):
inary.actionsapi.Error.__init__(self, value)
self.value = value
ctx.ui.error(value)
#Tool functions
def executable_insinto(destinationDirectory, *sourceFiles):
'''insert a executable file into destinationDirectory'''
if not sourceFiles or not destinationDirectory:
raise ArgumentError(_('Insufficient arguments.'))
if not can_access_directory(destinationDirectory):
makedirs(destinationDirectory)
for sourceFile in sourceFiles:
sourceFileGlob = glob.glob(sourceFile)
if len(sourceFileGlob) == 0:
raise FileError(_("No executable file matched pattern \"{}\".").format(sourceFile))
for source in sourceFileGlob:
# FIXME: use an internal install routine for these
system('install -m 0755 -o root -g root {0} {1}'.format(source, destinationDirectory))
def readable_insinto(destinationDirectory, *sourceFiles):
'''inserts file list into destinationDirectory'''
if not sourceFiles or not destinationDirectory:
raise ArgumentError(_('Insufficient arguments.'))
if not can_access_directory(destinationDirectory):
makedirs(destinationDirectory)
for sourceFile in sourceFiles:
sourceFileGlob = glob.glob(sourceFile)
if len(sourceFileGlob) == 0:
raise FileError(_("No file matched pattern \"{}\".").format(sourceFile))
for source in sourceFileGlob:
system('install -m 0644 "{0}" {1}'.format(source, destinationDirectory))
def lib_insinto(sourceFile, destinationDirectory, permission = 644):
'''inserts a library fileinto destinationDirectory with given permission'''
if not sourceFile or not destinationDirectory:
raise ArgumentError(_('Insufficient arguments.'))
if not can_access_directory(destinationDirectory):
makedirs(destinationDirectory)
if os.path.islink(sourceFile):
os.symlink(os.path.realpath(sourceFile), os.path.join(destinationDirectory, sourceFile))
else:
system('install -m 0{0} {1} {2}'.format(permission, sourceFile, destinationDirectory))
# inarytools funtions
def dobin(sourceFile, destinationDirectory = '/usr/bin'):
'''insert a executable file into /bin or /usr/bin'''
''' example call: inarytools.dobin("bin/xloadimage", "/bin", "xload") '''
......@@ -103,7 +166,7 @@ def dolib(sourceFile, destinationDirectory = '/usr/lib'):
sourceFile = join_path(os.getcwd(), sourceFile)
destinationDirectory = join_path(get.installDIR(), destinationDirectory)
lib_insinto(sourceFile, destinationDirectory, 0o755)
lib_insinto(sourceFile, destinationDirectory, 755)
def dolib_a(sourceFile, destinationDirectory = '/usr/lib'):
'''insert the static library into /usr/lib with permission 0644'''
......@@ -112,7 +175,7 @@ def dolib_a(sourceFile, destinationDirectory = '/usr/lib'):
sourceFile = join_path(os.getcwd(), sourceFile)
destinationDirectory = join_path(get.installDIR(), destinationDirectory)
lib_insinto(sourceFile, destinationDirectory, 0o644)
lib_insinto(sourceFile, destinationDirectory, 644)
def dolib_so(sourceFile, destinationDirectory = '/usr/lib'):
'''insert the dynamic library into /usr/lib with permission 0755'''
......@@ -121,7 +184,7 @@ def dolib_so(sourceFile, destinationDirectory = '/usr/lib'):
sourceFile = join_path(os.getcwd(), sourceFile)
destinationDirectory = join_path(get.installDIR(), destinationDirectory)
lib_insinto(sourceFile, destinationDirectory, 0o755)
lib_insinto(sourceFile, destinationDirectory, 755)
def doman(*sourceFiles):
'''inserts the man pages in the list of files into /usr/share/man/'''
......
#-*- coding: utf-8 -*-
#
# Copyright (C) 2016 - 2018, Suleyman POYRAZ (Zaryob)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
# Generic functions for common usage of inarytools #
# Standart Python Modules
import os
import glob
import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
# Inary Modules
import inary.context as ctx
# ActionsAPI Modules
import inary.actionsapi
from inary.actionsapi.shelltools import *
class FileError(inary.actionsapi.Error):
def __init__(self, value=''):
inary.actionsapi.Error.__init__(self, value)
self.value = value
ctx.ui.error(value)
class ArgumentError(inary.actionsapi.Error):
def __init__(self, value=''):
inary.actionsapi.Error.__init__(self, value)
self.value = value
ctx.ui.error(value)
def executable_insinto(destinationDirectory, *sourceFiles):
'''insert a executable file into destinationDirectory'''
if not sourceFiles or not destinationDirectory:
raise ArgumentError(_('Insufficient arguments.'))
if not can_access_directory(destinationDirectory):
makedirs(destinationDirectory)
for sourceFile in sourceFiles:
sourceFileGlob = glob.glob(sourceFile)
if len(sourceFileGlob) == 0:
raise FileError(_("No executable file matched pattern \"{}\".").format(sourceFile))
for source in sourceFileGlob:
# FIXME: use an internal install routine for these
system('install -m 0755 -o root -g root {0} {1}'.format(source, destinationDirectory))
def readable_insinto(destinationDirectory, *sourceFiles):
'''inserts file list into destinationDirectory'''
if not sourceFiles or not destinationDirectory:
raise ArgumentError(_('Insufficient arguments.'))
if not can_access_directory(destinationDirectory):
makedirs(destinationDirectory)
for sourceFile in sourceFiles:
sourceFileGlob = glob.glob(sourceFile)
if len(sourceFileGlob) == 0:
raise FileError(_("No file matched pattern \"{}\".").format(sourceFile))
for source in sourceFileGlob:
system('install -m 0644 "{0}" {1}'.format(source, destinationDirectory))
def lib_insinto(sourceFile, destinationDirectory, permission = 0o644):
'''inserts a library fileinto destinationDirectory with given permission'''
if not sourceFile or not destinationDirectory:
raise ArgumentError(_('Insufficient arguments.'))
if not can_access_directory(destinationDirectory):
makedirs(destinationDirectory)
if os.path.islink(sourceFile):
os.symlink(os.path.realpath(sourceFile), os.path.join(destinationDirectory, sourceFile))
else:
system('install -m 0{0} {1} {2}'.format(permission, sourceFile, destinationDirectory))
......@@ -106,3 +106,4 @@ def run(parameters=''):
if system('ruby {}'.format(parameters)):
raise RuntimeError(_("Running 'ruby {}' failed.").format(parameters))
......@@ -13,7 +13,6 @@
import os
import glob
import shutil
import string
import pwd
import grp
import sys
......
......@@ -24,7 +24,7 @@ import inary.db
class DistUpdate(command.PackageOp, metaclass=command.autocommand):
__doc__ = _("""Update the system a new release
Usage: DistUpdate [ next_dist_release_repo_url ] [ dist-update-list ]
Usage: dist-update [ next_dist_release_repo_url ]
WARNING: DIST-UPDATE risk içerir.
Dist-Update yapmadan önce iki kez düşününüz. Çünkü
......@@ -50,8 +50,6 @@ Usage: DistUpdate [ next_dist_release_repo_url ] [ dist-update-list ]
group = optparse.OptionGroup(self.parser, _("dist-update options"))
super(Upgrade, self).options(group)
group.add_option("--security-only", action="store_true",
default=False, help=_("Security related package upgrades only"))
group.add_option("-x", "--exclude", action="append",
default=None, help=_("When upgrading system, ignore packages and components whose basenames match pattern."))
group.add_option("--exclude-from", action="store",
......@@ -65,8 +63,11 @@ Usage: DistUpdate [ next_dist_release_repo_url ] [ dist-update-list ]
self.parser.add_option_group(group)
def run(self):
self.init()
argv = []
argv.extend(self.args)
targetrepo = argv[1]
Reactor.distupdate(targetrepo)
if len(self.args) > 1:
self.init()
for arg in self.args:
if arg.endswith(".xml") or arg.endswith("xml.xz"):
targetrepo = arg
break
Reactor.distupdate(targetrepo)
......@@ -20,7 +20,7 @@ import inary.context as ctx
defaultForceInstallPackageURI = "http://packages.sulin.org/main/force-install.list"
class DistupdatePlanner:
class DistUpdatePlanner:
def __init__(self, nextRepoUri, forceInstallUri=defaultForceInstallPackageURI, Debug=False):
self.debug = Debug
self.forceInstallUri = forceInstallUri
......@@ -292,5 +292,10 @@ class DistupdatePlanner:
self.calculateNextRepoSize()
self.calculeNeededSpace()
class MakeDistUpdate():
pass
def MakeDistUpdate():
try:
inary.operations.upgrade.upgrade(packages, 'distuprepo') #FIXME: Should write a detailed
# upgrade system
except:
raise Error(_('A problem occured')) # FIXME: When not complete distupdate
# inary make takeback
......@@ -342,7 +342,7 @@ def upgrade(packages=[], repo=None):
return inary.operations.upgrade.upgrade(packages, repo)
def distupdate(targetrepo):
weddingplanner = inary.operations.distupdate.DistupdatePlanner(nextRepoUri=targetrepo, Debug=True)
weddingplanner = inary.operations.distupdate.DistUpdatePlanner(nextRepoUri=targetrepo, Debug=True)
weddingplanner.plan()
ctx.ui.info(inary.util.colorize(_("*** Conclusion ***"),"red"))
......@@ -359,7 +359,14 @@ def distupdate(targetrepo):
ctx.ui.info(_(" biggest package size {}").format(weddingplanner.sizeOfBiggestPackage))
ctx.ui.info(_(" total space needed for distupdate {}").format(weddingplanner.sizeOfNeededTotalSpace))
if ctx.ui.confirm(str(_('Do you want make dist-update?'))):
if ctx.ui.confirm(str(_('Do you want make dist update?'))):
for repo in inary.db.repodb.RepoDB().list_repos():
repodb.remove_repo(repo)
inary.db.flush_caches()
ctx.ui.debug(_('Repo {} removed from system.').format(name))
add_repo('distuprepo',targetrepo)
update_repo(['distuprepo'])
inary.operations.distupdate.MakeDistUpdate()
......
......@@ -76,7 +76,7 @@ def getNodeText(node, tagpath = ""):
# KLUDGE: FIXME: python 2.x bug: force decoding as UTF-8
child_data = str(child.data())
#print('child_data=', child_data.strip())
return child_data.strip() # in any case, strip whitespaces...
return str(child_data.strip()) # in any case, strip whitespaces...
else:
raise XmlError(_("getNodeText: Expected text node, got something else!"))
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -96,7 +96,7 @@ class BuildPo(build):
class Install(install):
def run(self):
install.run(self)
#self.installi18n()
self.installi18n()
self.installdoc()
self.generateConfigFile()
......
......@@ -133,13 +133,13 @@ class Package:
def get_spec_template(self):
package = self.name
homepage = "www.pardus.org.tr"
packager_name = "Joe Packager"
packager_email = "joe@pardus.org.tr"
summary = "%s is a very useful package" % self.name
description = "%s is a very useful package that is known for its usefulness." % self.name
homepage = "www.sulin.org"
packager_name = "Inary Testers"
packager_email = "developers@sulin.org"
summary = "%s is a test package" % self.name
description = "%s is a test package for testing repositories." % self.name
sha1sum = "cc64dfa6e068fe1f6fb68a635878b1ea21acfac7"
archive = "http://cekirdek.uludag.org.tr/~faik/spam/skeleton.tar.gz"
archive = "http://dev.sulin.org/inary/skeleton.tar.gz"
date = time.strftime("%Y-%m-%d")
partof = self.partof
......@@ -216,7 +216,7 @@ class Repository:
open("components.xml", "w").write(xml_content)
class Pardus2007Repo(Repository):
class MainRepo(Repository):
def __init__(self):
Repository.__init__(self, "main-2018", "2018", [], ["wengophone", "rar"])
......@@ -245,9 +245,9 @@ class Pardus2007Repo(Repository):
Repository.create(self)
class Contrib2007Repo(Repository):
class ContribRepo(Repository):
def __init__(self):
Repository.__init__(self, "contrib-2007", "2007", [], ["xara"])
Repository.__init__(self, "contrib-2018", "2018", [], ["xara"])
def create(self):
......@@ -283,6 +283,6 @@ class BuildFarm:
self.create_index(repo)
if __name__ == "__main__":
Pardus2007Repo().create()
Contrib2007Repo().create()
BuildFarm().build(["pardus-2007", "contrib-2007", "repo1", "repo2"])
MainRepo().create()
ContribRepo().create()
BuildFarm().build(["main-2018", "contrib-2018", "repo1", "repo2"])
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