create core package
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Licensed under the GNU General Public License, version 3.
|
||||
# See the file http://www.gnu.org/licenses/gpl.txt
|
||||
|
||||
from pisi.actionsapi import get
|
||||
from pisi.actionsapi import pisitools
|
||||
from pisi.actionsapi import shelltools
|
||||
from pisi.actionsapi import pythonmodules
|
||||
|
||||
def build():
|
||||
pisitools.dosed("pisi/__init__.py", "2.4", "2.6")
|
||||
pisitools.dosed("pisi/db/lazydb.py", "2.4", "2.6")
|
||||
pythonmodules.compile()
|
||||
|
||||
def install():
|
||||
# Install into /usr/lib/pardus so we can protect ourself from python updates
|
||||
pythonmodules.install("--install-lib=/usr/lib/pisilinux")
|
||||
|
||||
pisitools.dosym("pisi-cli", "/usr/bin/pisi")
|
||||
|
||||
shelltools.touch("LOCK")
|
||||
shelltools.chmod("LOCK", 0666)
|
||||
pisitools.dodir("/run/lock/files.ldb")
|
||||
pisitools.insinto("/run/lock/files.ldb", "LOCK")
|
||||
pisitools.dodir("/var/lib/pisi/info/files.ldb")
|
||||
pisitools.dosym("/run/lock/files.ldb/LOCK", "/var/lib/pisi/info/files.ldb/LOCK")
|
||||
|
||||
|
||||
pisitools.insinto("/etc/pisi", "pisi.conf-%s" % get.ARCH(), "pisi.conf")
|
||||
|
||||
# we need it teporary
|
||||
pisitools.dodir("/usr/lib/pardus")
|
||||
pisitools.dosym("/usr/lib/pisilinux/pisi", "/usr/lib/pardus/pisi")
|
||||
@@ -0,0 +1,245 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2005-2009 TUBITAK/UEKAE
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# Disable cyclic garbage collector of Python to avoid comar segmentation
|
||||
# faults under high load (#11110)
|
||||
import gc
|
||||
gc.disable()
|
||||
|
||||
import os
|
||||
import locale
|
||||
import string
|
||||
|
||||
# FIXME: later this will be Comar's job
|
||||
systemlocale = open("/etc/mudur/locale", "r").readline().strip()
|
||||
|
||||
# for pisi
|
||||
os.environ["LC_ALL"] = systemlocale
|
||||
|
||||
# for system error messages
|
||||
locale.setlocale(locale.LC_ALL, systemlocale)
|
||||
|
||||
try:
|
||||
import pisi.api
|
||||
import pisi.db
|
||||
import pisi.ui
|
||||
import pisi.util as util
|
||||
import pisi.configfile
|
||||
from pisi.version import Version
|
||||
except KeyboardInterrupt:
|
||||
notify("System.Manager", "cancelled", "")
|
||||
|
||||
class UI(pisi.ui.UI):
|
||||
def error(self, msg):
|
||||
notify("System.Manager", "error", str(msg))
|
||||
|
||||
def warning(self, msg):
|
||||
notify("System.Manager", "warning", str(msg))
|
||||
|
||||
def notify(self, event, **keywords):
|
||||
if event == pisi.ui.installing:
|
||||
pkgname = keywords["package"].name
|
||||
notify("System.Manager", "status", ("installing", pkgname, "", ""))
|
||||
elif event == pisi.ui.configuring:
|
||||
pkgname = keywords["package"].name
|
||||
notify("System.Manager", "status", ("configuring", pkgname, "", ""))
|
||||
elif event == pisi.ui.extracting:
|
||||
pkgname = keywords["package"].name
|
||||
notify("System.Manager", "status", ("extracting", pkgname, "", ""))
|
||||
elif event == pisi.ui.updatingrepo:
|
||||
reponame = keywords["name"]
|
||||
notify("System.Manager", "status", ("updatingrepo", reponame, "", ""))
|
||||
elif event == pisi.ui.removing:
|
||||
pkgname = keywords["package"].name
|
||||
notify("System.Manager", "status", ("removing", pkgname, "", ""))
|
||||
elif event == pisi.ui.cached:
|
||||
total = str(keywords["total"])
|
||||
cached = str(keywords["cached"])
|
||||
notify("System.Manager", "status", ("cached", total, cached, ""))
|
||||
elif event == pisi.ui.installed:
|
||||
notify("System.Manager", "status", ("installed", "", "", ""))
|
||||
elif event == pisi.ui.removed:
|
||||
notify("System.Manager", "status", ("removed", "", "", ""))
|
||||
elif event == pisi.ui.upgraded:
|
||||
notify("System.Manager", "status", ("upgraded", "", "", ""))
|
||||
elif event == pisi.ui.packagestogo:
|
||||
notify("System.Manager", "status", ("order", "", "", ""))
|
||||
elif event == pisi.ui.desktopfile:
|
||||
filepath = keywords["desktopfile"]
|
||||
notify("System.Manager", "status", ("desktopfile", filepath, "", ""))
|
||||
else:
|
||||
return
|
||||
|
||||
def ack(self, msg):
|
||||
return True
|
||||
|
||||
def confirm(self, msg):
|
||||
return True
|
||||
|
||||
def display_progress(self, operation, percent, info="", **kw):
|
||||
if operation == "fetching":
|
||||
file_name = kw["filename"]
|
||||
if not file_name.startswith("pisi-index.xml"):
|
||||
file_name = pisi.util.parse_package_name(file_name)[0]
|
||||
out = (operation, file_name, str(percent), int(kw["rate"]), kw["symbol"], int(kw["downloaded_size"]), int(kw["total_size"]))
|
||||
else:
|
||||
out = (operation, str(percent), info, 0, 0, 0, 0)
|
||||
notify("System.Manager", "progress", out)
|
||||
|
||||
def _init_pisi():
|
||||
ui = UI()
|
||||
try:
|
||||
pisi.api.set_userinterface(ui)
|
||||
except KeyboardInterrupt:
|
||||
cancelled()
|
||||
|
||||
def cancelled():
|
||||
notify("System.Manager", "cancelled", None)
|
||||
|
||||
def started(operation=""):
|
||||
notify("System.Manager", "started", operation)
|
||||
|
||||
def finished(operation=""):
|
||||
if operation in ["System.Manager.setCache", "System.Manager.installPackage", "System.Manager.removePackage", "System.Manager.updatePackage"]:
|
||||
__checkCacheLimits()
|
||||
|
||||
notify("System.Manager", "finished", operation)
|
||||
|
||||
def privileged(func):
|
||||
"""
|
||||
Decorator for synchronizing privileged functions
|
||||
"""
|
||||
def wrapper(*__args,**__kw):
|
||||
operation = "System.Manager.%s" % func.func_name
|
||||
|
||||
started(operation)
|
||||
_init_pisi()
|
||||
try:
|
||||
func(*__args,**__kw)
|
||||
except KeyboardInterrupt:
|
||||
cancelled()
|
||||
return
|
||||
except Exception, e:
|
||||
notify("System.Manager", "error", str(e))
|
||||
return
|
||||
finished(operation)
|
||||
|
||||
return wrapper
|
||||
|
||||
@privileged
|
||||
def installPackage(package=None):
|
||||
if package:
|
||||
package = package.split(",")
|
||||
reinstall = package[0].endswith(".pisi")
|
||||
pisi.api.install(package, ignore_file_conflicts=True, reinstall=reinstall)
|
||||
|
||||
@privileged
|
||||
def reinstallPackage(package=None):
|
||||
if package:
|
||||
package = package.split(",")
|
||||
pisi.api.install(package, ignore_file_conflicts=True, reinstall=True)
|
||||
|
||||
@privileged
|
||||
def updatePackage(package=None):
|
||||
if package is None:
|
||||
package = []
|
||||
else:
|
||||
package = package.split(",")
|
||||
pisi.api.upgrade(package)
|
||||
|
||||
@privileged
|
||||
def removePackage(package=None):
|
||||
if package:
|
||||
package = package.split(",")
|
||||
pisi.api.remove(package)
|
||||
|
||||
@privileged
|
||||
def updateRepository(repository=None):
|
||||
if repository:
|
||||
pisi.api.update_repo(repository)
|
||||
|
||||
@privileged
|
||||
def updateAllRepositories():
|
||||
repos = pisi.db.repodb.RepoDB().list_repos()
|
||||
for repo in repos:
|
||||
try:
|
||||
pisi.api.update_repo(repo)
|
||||
except pisi.db.repodb.RepoError, e:
|
||||
notify("System.Manager", "error", str(e))
|
||||
|
||||
@privileged
|
||||
def addRepository(name=None,uri=None):
|
||||
if name and uri:
|
||||
pisi.api.add_repo(name,uri)
|
||||
|
||||
@privileged
|
||||
def removeRepository(repo=None):
|
||||
if repo:
|
||||
pisi.api.remove_repo(repo)
|
||||
|
||||
@privileged
|
||||
def setRepoActivities(repos=None):
|
||||
if repos:
|
||||
for repo, active in repos.items():
|
||||
pisi.api.set_repo_activity(repo, active)
|
||||
|
||||
@privileged
|
||||
def setRepositories(repos):
|
||||
oldRepos = pisi.db.repodb.RepoDB().list_repos(only_active=False)
|
||||
|
||||
for repo in oldRepos:
|
||||
pisi.api.remove_repo(repo)
|
||||
|
||||
for repo in repos:
|
||||
pisi.api.add_repo(repo[0], repo[1])
|
||||
|
||||
@privileged
|
||||
# ex: setConfig("general", "bandwidth_limit", "30")
|
||||
def setConfig(category, name, value):
|
||||
config = pisi.configfile.ConfigurationFile("/etc/pisi/pisi.conf")
|
||||
config.set(category, name, value)
|
||||
|
||||
config.write_config()
|
||||
|
||||
@privileged
|
||||
def setCache(enabled, limit):
|
||||
config = pisi.configfile.ConfigurationFile("/etc/pisi/pisi.conf")
|
||||
config.set("general", "package_cache", str(enabled))
|
||||
config.set("general", "package_cache_limit", str(limit))
|
||||
|
||||
config.write_config()
|
||||
|
||||
@privileged
|
||||
def takeSnapshot():
|
||||
pisi.api.snapshot()
|
||||
|
||||
@privileged
|
||||
def takeBack(operation):
|
||||
pisi.api.takeback(operation)
|
||||
|
||||
@privileged
|
||||
def clearCache(cacheDir, limit):
|
||||
pisi.api.clearCache(int(limit) == 0)
|
||||
|
||||
def __checkCacheLimits():
|
||||
cached_pkgs_dir = "/var/cache/pisi/packages"
|
||||
config = pisi.configfile.ConfigurationFile("/etc/pisi/pisi.conf")
|
||||
cache = config.get("general", "package_cache")
|
||||
if cache == "True":
|
||||
limit = config.get("general", "package_cache_limit")
|
||||
|
||||
# If PackageCache is used and limit is 0. It means limitless.
|
||||
if limit and int(limit) != 0:
|
||||
clearCache(cached_pkgs_dir, int(limit) * 1024 * 1024)
|
||||
elif cache == "False":
|
||||
clearCache(cached_pkgs_dir, 0)
|
||||
@@ -0,0 +1,13 @@
|
||||
#/usr/bin/python
|
||||
|
||||
import os
|
||||
|
||||
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
|
||||
if not os.path.exists("/var/lib/pisi/info/files.ldb"):
|
||||
os.mkdir("/var/lib/pisi/info/files.ldb")
|
||||
os.chmod("/var/lib/pisi/info/files.ldb", 509)
|
||||
os.chown("/var/lib/pisi/info/files.ldb", 0, 10)
|
||||
if not os.path.exists("/var/lib/pisi/package"):
|
||||
os.system("mkdir /var/lib/pisi/package")
|
||||
os.system("mv /var/lib/pisi/* /var/lib/pisi/package/")
|
||||
os.system("mv /var/lib/pisi/package/scripts /var/lib/pisi/")
|
||||
@@ -0,0 +1,12 @@
|
||||
diff -Naur pisi~/operations/build.py pisi/operations/build.py
|
||||
--- pisi~/operations/build.py 2014-06-15 16:33:39.000000000 +0200
|
||||
+++ pisi/operations/build.py 2014-07-06 18:04:24.648575441 +0200
|
||||
@@ -402,6 +402,8 @@
|
||||
if self.build_type == "emul32":
|
||||
env["CC"] = "%s -m32" % os.getenv("CC")
|
||||
env["CXX"] = "%s -m32" % os.getenv("CXX")
|
||||
+ env["CFLAGS"] = os.getenv("CFLAGS").replace("-fPIC", "")
|
||||
+ env["CXXFLAGS"] = os.getenv("CXXFLAGS").replace("-fPIC", "")
|
||||
env["PKG_CONFIG_PATH"] = "/usr/lib32/pkgconfig"
|
||||
os.environ.update(env)
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
diff -Naur pisi~/index.py pisi/index.py
|
||||
--- pisi~/index.py 2014-03-07 23:03:46.000000000 +0100
|
||||
+++ pisi/index.py 2014-09-04 21:47:38.282627704 +0200
|
||||
@@ -13,6 +13,7 @@
|
||||
"""PiSi source/package index"""
|
||||
|
||||
import os
|
||||
+import re
|
||||
import shutil
|
||||
import multiprocessing
|
||||
|
||||
@@ -91,6 +92,7 @@
|
||||
specs = []
|
||||
deltas = {}
|
||||
|
||||
+ pkgs_sorted = False
|
||||
for fn in os.walk(repo_uri).next()[2]:
|
||||
if fn.endswith(ctx.const.delta_package_suffix) or fn.endswith(ctx.const.package_suffix):
|
||||
pkgpath = os.path.join(repo_uri,
|
||||
@@ -100,6 +102,9 @@
|
||||
fn), noln = False if ctx.config.get_option("verbose") else True)
|
||||
shutil.copy2(os.path.join(repo_uri, fn), pkgpath)
|
||||
os.remove(os.path.join(repo_uri, fn))
|
||||
+ pkgs_sorted = True
|
||||
+ if pkgs_sorted:
|
||||
+ ctx.ui.info("%-80.80s\r" % '')
|
||||
|
||||
for root, dirs, files in os.walk(repo_uri):
|
||||
# Filter hidden directories
|
||||
@@ -166,14 +171,26 @@
|
||||
|
||||
# Before calling pool.map check if list is empty or not: python#12157
|
||||
if latest_packages:
|
||||
- try:
|
||||
- # Add binary packages to index using a process pool
|
||||
- self.packages = pool.map(add_package, latest_packages)
|
||||
- except:
|
||||
- pool.terminate()
|
||||
- pool.join()
|
||||
- ctx.ui.info("")
|
||||
- raise
|
||||
+ sorted_pkgs = {}
|
||||
+ for pkg in latest_packages:
|
||||
+ key = re.search("\/((lib)?[\d\w])\/", pkg[0])
|
||||
+ key = key.group(1) if key else os.path.dirname(pkg[0])
|
||||
+ try:
|
||||
+ sorted_pkgs[key].append(pkg)
|
||||
+ except KeyError:
|
||||
+ sorted_pkgs[key] = [pkg]
|
||||
+ self.packages = []
|
||||
+ for key, pkgs in sorted(sorted_pkgs.items()):
|
||||
+ ctx.ui.info("%-80.80s\r" % (_("Adding packages from directory %s... " % key)), noln=True)
|
||||
+ try:
|
||||
+ # Add binary packages to index using a process pool
|
||||
+ self.packages.extend(pool.map(add_package, pkgs))
|
||||
+ except:
|
||||
+ pool.terminate()
|
||||
+ pool.join()
|
||||
+ ctx.ui.info("")
|
||||
+ raise
|
||||
+ ctx.ui.info("%-80.80s\r" % (_("Adding packages from directory %s... done." % key)))
|
||||
|
||||
ctx.ui.info("")
|
||||
pool.close()
|
||||
@@ -0,0 +1,283 @@
|
||||
diff -Naur pisi~/api.py pisi/api.py
|
||||
--- pisi~/api.py 2014-06-15 16:33:39.000000000 +0200
|
||||
+++ pisi/api.py 2014-06-24 22:36:50.565227969 +0200
|
||||
@@ -401,10 +401,9 @@
|
||||
|
||||
>>> [("kvm", (["lib/modules/2.6.18.8-86/extra/kvm-amd.ko","lib/modules/2.6.18.8-86/extra/kvm-intel.ko"])),]
|
||||
"""
|
||||
- filesdb = pisi.db.filesldb.FilesLDB()
|
||||
if term.startswith("/"): # FIXME: why? why?
|
||||
term = term[1:]
|
||||
- return filesdb.search_file(term)
|
||||
+ return ctx.filesdb.search_file(term)
|
||||
|
||||
def fetch(packages=[], path=os.path.curdir):
|
||||
"""
|
||||
@@ -869,7 +868,6 @@
|
||||
# FIXME: rebuild_db is only here for filesdb and it really is ugly. we should not need any rebuild.
|
||||
@locked
|
||||
def rebuild_db():
|
||||
- filesdb = pisi.db.filesldb.FilesLDB()
|
||||
|
||||
# save parameters and shutdown pisi
|
||||
options = ctx.config.options
|
||||
@@ -877,9 +875,9 @@
|
||||
comar = ctx.comar
|
||||
pisi._cleanup()
|
||||
|
||||
- filesdb.close()
|
||||
- filesdb.destroy()
|
||||
- filesdb = pisi.db.filesldb.FilesLDB()
|
||||
+ ctx.filesdb.close()
|
||||
+ ctx.filesdb.destroy()
|
||||
+ ctx.filesdb = pisi.db.filesldb.FilesLDB()
|
||||
|
||||
# reinitialize everything
|
||||
set_userinterface(ui)
|
||||
diff -Naur pisi~/atomicoperations.py pisi/atomicoperations.py
|
||||
--- pisi~/atomicoperations.py 2014-06-15 16:33:39.000000000 +0200
|
||||
+++ pisi/atomicoperations.py 2014-06-25 19:10:49.061679815 +0200
|
||||
@@ -120,6 +120,7 @@
|
||||
raise Error(_("Package %s not found in any active repository.") % name)
|
||||
|
||||
def __init__(self, package_fname, ignore_dep = None, ignore_file_conflicts = None):
|
||||
+ if not ctx.filesdb: ctx.filesdb = pisi.db.filesldb.FilesLDB()
|
||||
"initialize from a file name"
|
||||
super(Install, self).__init__(ignore_dep)
|
||||
if not ignore_file_conflicts:
|
||||
@@ -134,14 +135,10 @@
|
||||
self.metadata = self.package.metadata
|
||||
self.files = self.package.files
|
||||
self.pkginfo = self.metadata.package
|
||||
- self.filesdb = pisi.db.filesldb.FilesLDB()
|
||||
self.installdb = pisi.db.installdb.InstallDB()
|
||||
self.operation = INSTALL
|
||||
self.store_old_paths = None
|
||||
|
||||
- def __del__(self):
|
||||
- self.filesdb.close()
|
||||
-
|
||||
def install(self, ask_reinstall = True):
|
||||
|
||||
# Any package should remove the package it replaces before
|
||||
@@ -186,7 +183,7 @@
|
||||
def check_replaces(self):
|
||||
for replaced in self.pkginfo.replaces:
|
||||
if self.installdb.has_package(replaced.package):
|
||||
- pisi.operations.remove.remove_replaced_packages([replaced.package], filesdb=self.filesdb)
|
||||
+ pisi.operations.remove.remove_replaced_packages([replaced.package])
|
||||
|
||||
def check_versioning(self, version, release):
|
||||
try:
|
||||
@@ -215,7 +212,7 @@
|
||||
# check file conflicts
|
||||
file_conflicts = []
|
||||
for f in self.files.list:
|
||||
- pkg, existing_file = self.filesdb.get_file(f.path)
|
||||
+ pkg, existing_file = ctx.filesdb.get_file(f.path)
|
||||
if pkg:
|
||||
dst = pisi.util.join_path(ctx.config.dest_dir(), f.path)
|
||||
if pkg != self.pkginfo.name and not os.path.isdir(dst) and really_conflicts(pkg):
|
||||
@@ -282,7 +279,7 @@
|
||||
self.old_files = self.installdb.get_files(pkg.name)
|
||||
self.old_pkginfo = self.installdb.get_info(pkg.name)
|
||||
self.old_path = self.installdb.pkg_dir(pkg.name, iversion_s, irelease_s)
|
||||
- self.remove_old = Remove(pkg.name, store_old_paths = self.store_old_paths, filesdb = self.filesdb)
|
||||
+ self.remove_old = Remove(pkg.name, store_old_paths = self.store_old_paths)
|
||||
self.remove_old.run_preremove()
|
||||
self.remove_old.run_postremove()
|
||||
|
||||
@@ -454,7 +451,7 @@
|
||||
if os.path.samestat(new_file_stat, old_file_stat):
|
||||
break
|
||||
else:
|
||||
- Remove.remove_file(old_file, self.pkginfo.name, store_old_paths=self.store_old_paths, filesdb=self.filesdb)
|
||||
+ Remove.remove_file(old_file, self.pkginfo.name, store_old_paths=self.store_old_paths)
|
||||
|
||||
if self.reinstall():
|
||||
# get 'config' typed file objects
|
||||
@@ -512,7 +509,7 @@
|
||||
def update_databases(self):
|
||||
"update databases"
|
||||
if self.reinstall():
|
||||
- self.remove_old.remove_db(filesdb=self.filesdb)
|
||||
+ self.remove_old.remove_db()
|
||||
|
||||
if self.config_later:
|
||||
self.installdb.mark_pending(self.pkginfo.name)
|
||||
@@ -531,7 +528,7 @@
|
||||
pisi.api.add_needs_reboot(package_name)
|
||||
|
||||
# filesdb
|
||||
- self.filesdb.add_files(self.metadata.package.name, self.files)
|
||||
+ ctx.filesdb.add_files(self.metadata.package.name, self.files)
|
||||
|
||||
# installed packages
|
||||
self.installdb.add_package(self.pkginfo)
|
||||
@@ -562,10 +559,10 @@
|
||||
|
||||
class Remove(AtomicOperation):
|
||||
|
||||
- def __init__(self, package_name, ignore_dep = None, store_old_paths = None, filesdb = None):
|
||||
+ def __init__(self, package_name, ignore_dep = None, store_old_paths = None):
|
||||
+ if not ctx.filesdb: ctx.filesdb = pisi.db.filesldb.FilesLDB()
|
||||
super(Remove, self).__init__(ignore_dep)
|
||||
self.installdb = pisi.db.installdb.InstallDB()
|
||||
- self.filesdb = filesdb
|
||||
self.package_name = package_name
|
||||
self.package = self.installdb.get_package(self.package_name)
|
||||
self.store_old_paths = store_old_paths
|
||||
@@ -577,10 +574,9 @@
|
||||
ctx.ui.warning(_('File list could not be read for package %s, continuing removal.') % package_name)
|
||||
self.files = pisi.files.Files()
|
||||
|
||||
- def run(self, filesdb = None):
|
||||
+ def run(self):
|
||||
"""Remove a single package"""
|
||||
|
||||
- if filesdb: self.filesdb = filesdb
|
||||
ctx.ui.status(_('Removing package %s') % self.package_name)
|
||||
ctx.ui.notify(pisi.ui.removing, package = self.package, files = self.files)
|
||||
if not self.installdb.has_package(self.package_name):
|
||||
@@ -591,7 +587,7 @@
|
||||
|
||||
self.run_preremove()
|
||||
for fileinfo in self.files.list:
|
||||
- self.remove_file(fileinfo, self.package_name, True, filesdb=filesdb)
|
||||
+ self.remove_file(fileinfo, self.package_name, True)
|
||||
|
||||
self.run_postremove()
|
||||
|
||||
@@ -609,7 +605,7 @@
|
||||
# is there any package who depends on this package?
|
||||
|
||||
@staticmethod
|
||||
- def remove_file(fileinfo, package_name, remove_permanent=False, store_old_paths=None, filesdb=None):
|
||||
+ def remove_file(fileinfo, package_name, remove_permanent=False, store_old_paths=None):
|
||||
|
||||
if fileinfo.permanent and not remove_permanent:
|
||||
return
|
||||
@@ -621,9 +617,7 @@
|
||||
# package (this can legitimately occur while upgrading
|
||||
# two packages such that a file has moved from one package to
|
||||
# another as in #2911)
|
||||
- if not filesdb:
|
||||
- filesdb = pisi.db.filesldb.FilesLDB()
|
||||
- pkg, existing_file = filesdb.get_file(fileinfo.path)
|
||||
+ pkg, existing_file = ctx.filesdb.get_file(fileinfo.path)
|
||||
if pkg and not pkg == package_name:
|
||||
ctx.ui.warning(_('Not removing conflicted file : %s') % fpath)
|
||||
return
|
||||
@@ -690,17 +684,16 @@
|
||||
def remove_pisi_files(self):
|
||||
util.clean_dir(self.package.pkg_dir())
|
||||
|
||||
- def remove_db(self, filesdb=None):
|
||||
+ def remove_db(self):
|
||||
self.installdb.remove_package(self.package_name)
|
||||
- if not filesdb: self.filesdb.remove_files(self.files.list)
|
||||
- else: filesdb.remove_files(self.files.list)
|
||||
+ ctx.filesdb.remove_files(self.files.list)
|
||||
# FIX:DB
|
||||
# # FIXME: something goes wrong here, if we use ctx operations ends up with segmentation fault!
|
||||
# pisi.db.packagedb.remove_tracking_package(self.package_name)
|
||||
|
||||
|
||||
-def remove_single(package_name, filesdb=None):
|
||||
- Remove(package_name).run(filesdb=filesdb)
|
||||
+def remove_single(package_name):
|
||||
+ Remove(package_name).run()
|
||||
|
||||
def build(package):
|
||||
# wrapper for build op
|
||||
diff -Naur pisi~/context.py pisi/context.py
|
||||
--- pisi~/context.py 2011-05-26 19:17:29.000000000 +0200
|
||||
+++ pisi/context.py 2014-06-24 22:28:17.685246708 +0200
|
||||
@@ -62,3 +62,5 @@
|
||||
|
||||
def keyboard_interrupt_pending():
|
||||
return sig and sig.signal_pending(signal.SIGINT)
|
||||
+
|
||||
+filesdb = None
|
||||
diff -Naur pisi~/operations/install.py pisi/operations/install.py
|
||||
--- pisi~/operations/install.py 2014-06-15 16:33:39.000000000 +0200
|
||||
+++ pisi/operations/install.py 2014-06-24 22:40:35.901219735 +0200
|
||||
@@ -95,7 +95,6 @@
|
||||
ctx.ui.info(util.colorize(_("Downloading %d / %d") % (order.index(x)+1, len(order)), "yellow"))
|
||||
install_op = atomicoperations.Install.from_name(x)
|
||||
paths.append(install_op.package_fname)
|
||||
- install_op = None
|
||||
|
||||
# fetch to be installed packages but do not install them.
|
||||
if ctx.get_option('fetch_only'):
|
||||
@@ -108,7 +107,6 @@
|
||||
ctx.ui.info(util.colorize(_("Installing %d / %d") % (paths.index(path)+1, len(paths)), "yellow"))
|
||||
install_op = atomicoperations.Install(path)
|
||||
install_op.install(False)
|
||||
- install_op = None
|
||||
|
||||
return True
|
||||
|
||||
diff -Naur pisi~/operations/remove.py pisi/operations/remove.py
|
||||
--- pisi~/operations/remove.py 2014-06-15 16:33:39.000000000 +0200
|
||||
+++ pisi/operations/remove.py 2014-06-24 22:37:47.963225871 +0200
|
||||
@@ -24,11 +24,9 @@
|
||||
import pisi.ui as ui
|
||||
import pisi.db
|
||||
|
||||
-def remove(A, ignore_dep = False, ignore_safety = False, filesdb = None):
|
||||
+def remove(A, ignore_dep = False, ignore_safety = False):
|
||||
"""remove set A of packages from system (A is a list of package names)"""
|
||||
|
||||
- if not filesdb: filesdb = pisi.db.filesldb.FilesLDB()
|
||||
-
|
||||
componentdb = pisi.db.componentdb.ComponentDB()
|
||||
installdb = pisi.db.installdb.InstallDB()
|
||||
|
||||
@@ -82,7 +80,7 @@
|
||||
|
||||
for x in order:
|
||||
if installdb.has_package(x):
|
||||
- atomicoperations.remove_single(x, filesdb=filesdb)
|
||||
+ atomicoperations.remove_single(x)
|
||||
else:
|
||||
ctx.ui.info(_('Package %s is not installed. Cannot remove.') % x)
|
||||
|
||||
@@ -129,6 +127,6 @@
|
||||
if remove(obsoletes, ignore_dep=True, ignore_safety=True):
|
||||
raise Exception(_("Obsoleted packages remaining"))
|
||||
|
||||
-def remove_replaced_packages(replaced, filesdb=None):
|
||||
- if remove(replaced, ignore_dep=True, ignore_safety=True, filesdb=filesdb):
|
||||
+def remove_replaced_packages(replaced):
|
||||
+ if remove(replaced, ignore_dep=True, ignore_safety=True):
|
||||
raise Exception(_("Replaced package remains"))
|
||||
diff -Naur pisi~/operations/upgrade.py pisi/operations/upgrade.py
|
||||
--- pisi~/operations/upgrade.py 2014-06-15 16:33:39.000000000 +0200
|
||||
+++ pisi/operations/upgrade.py 2014-06-24 22:40:50.745219193 +0200
|
||||
@@ -205,7 +205,6 @@
|
||||
ctx.ui.info(util.colorize(_("Downloading %d / %d") % (order.index(x)+1, len(order)), "yellow"))
|
||||
install_op = atomicoperations.Install.from_name(x)
|
||||
paths.append(install_op.package_fname)
|
||||
- install_op = None
|
||||
|
||||
# fetch to be upgraded packages but do not install them.
|
||||
if ctx.get_option('fetch_only'):
|
||||
@@ -220,7 +219,6 @@
|
||||
ctx.ui.info(util.colorize(_("Installing %d / %d") % (paths.index(path)+1, len(paths)), "yellow"))
|
||||
install_op = atomicoperations.Install(path, ignore_file_conflicts = True)
|
||||
install_op.install(not ctx.get_option('compare_sha1sum'))
|
||||
- install_op = None
|
||||
|
||||
def plan_upgrade(A, force_replaced=True, replaces=None):
|
||||
# FIXME: remove force_replaced
|
||||
diff -Naur pisi-cli~ pisi-cli
|
||||
--- pisi-cli~ 2011-05-26 19:17:29.000000000 +0200
|
||||
+++ pisi-cli 2014-06-25 18:24:25.499781521 +0200
|
||||
@@ -79,4 +79,6 @@
|
||||
signal.signal(signal.SIGTERM, sig_handler)
|
||||
|
||||
cli = pisicli.PisiCLI()
|
||||
+ if cli.command.name[1] in "rdb sf".split():
|
||||
+ ctx.filesdb = pisi.db.filesldb.FilesLDB()
|
||||
cli.run_command()
|
||||
@@ -0,0 +1,224 @@
|
||||
apache http://www.eu.apache.org/dist/
|
||||
apache http://www.apache.org/dist/
|
||||
apache http://apache.planetmirror.com.au/dist/
|
||||
apache http://gd.tuwien.ac.at/infosys/servers/http/apache/dist/
|
||||
apache http://apache.fastorama.com/dist/
|
||||
apache http://mir2.ovh.net/ftp.apache.org/dist/
|
||||
apache ftp://ftp.planetmirror.com/pub/apache/dist/
|
||||
apache ftp://gd.tuwien.ac.at/pub/infosys/servers/http/apache/dist/
|
||||
apache ftp://ftp.fastorama.com/mirrors/ftp.apache.org/dist/
|
||||
berlios http://download.berlios.de/
|
||||
berlios http://download2.berlios.de/
|
||||
cpan http://search.cpan.org/CPAN/
|
||||
cpan http://cpan.ulak.net.tr/
|
||||
cpan http://www.perl.com/CPAN/
|
||||
cpan http://mirrors.jtlnet.com/CPAN/
|
||||
cpan ftp://ftp.ncsu.edu/pub/mirror/CPAN/
|
||||
cpan ftp://ftp.duke.edu/pub/perl/
|
||||
gnome http://ftp.gnome.org/pub/GNOME/sources
|
||||
gnome http://ftp.rpmfind.net/linux/gnome.org/sources/
|
||||
gnome http://ftp.unina.it/pub/linux/GNOME/sources/
|
||||
gnome http://ftp.acc.umu.se/pub/GNOME/sources/
|
||||
gnome http://ftp.belnet.be/mirror/ftp.gnome.org/sources/
|
||||
gnome ftp://ftp.cse.buffalo.edu/pub/Gnome/sources/
|
||||
gnu http://ftp.gnu.org/gnu/
|
||||
gnu ftp://ftp.gnu.org/gnu/
|
||||
gnu http://ftp.club.cc.cmu.edu/pub/gnu/
|
||||
gnu http://mirrors.usc.edu/pub/gnu/
|
||||
gnu http://mirrors.kernel.org/gnu/
|
||||
gnu ftp://ftp.club.cc.cmu.edu/gnu/
|
||||
gnu ftp://aeneas.mit.edu/pub/gnu/
|
||||
gnu ftp://ftp.cse.ohio-state.edu/mirror/gnu/
|
||||
gnu ftp://ftp.cs.tu-berlin.de/pub/gnu/
|
||||
gnu ftp://mirrors.kernel.org/gnu/
|
||||
gnu ftp://ftp.cs.ubc.ca/pub/gnu/
|
||||
gnu ftp://ftp.math.uni-bremen.de/pub/gnu/
|
||||
gnu ftp://ftp.informatik.rwth-aachen.de/pub/gnu/
|
||||
gnu ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.gnu.org/
|
||||
gnu ftp://ftp.mirror.ac.uk/sites/ftp.gnu.org/gnu/
|
||||
gnu ftp://sunsite.cnlab-switch.ch/mirror/gnu/
|
||||
gnu http://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.gnu.org/
|
||||
gnu ftp://ftp.stacken.kth.se/pub/gnu/
|
||||
gnu ftp://ftp.isy.liu.se/pub/gnu/
|
||||
gnu ftp://ftp.task.gda.pl/pub/gnu/
|
||||
gnu ftp://ftp.nluug.nl/pub/gnu/
|
||||
gnu ftp://ftp.funet.fi/pub/gnu/prep/
|
||||
gnu ftp://sunsite.icm.edu.pl/pub/gnu/
|
||||
gnu ftp://ftp.freenet.de/pub/mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/
|
||||
gnu ftp://ftp.mirror.nl/pub/mirror/gnu/
|
||||
gnu ftp://ftp.esat.net/pub/gnu/
|
||||
gnu ftp://ftp.mcc.ac.uk/pub/gnu/
|
||||
gnu ftp://ftp.cise.ufl.edu/pub/mirrors/GNU/
|
||||
gnu ftp://ftp.uninett.no/pub/gnu/
|
||||
gnu ftp://ftp.duth.gr/pub/gnu/
|
||||
gnu ftp://sunsite.dk/mirrors/gnu/
|
||||
gnu http://mirrors.sunsite.dk/gnu/
|
||||
gnu ftp://ftp.etsimo.uniovi.es/pub/gnu/
|
||||
gnu ftp://ftp.sunet.se/pub/gnu/
|
||||
gnu http://ftp.roedu.net/mirrors/gnu.org/
|
||||
gnu ftp://ftp.forthnet.gr/pub/gnu/
|
||||
gnu ftp://ftp.univie.ac.at/packages/gnu/
|
||||
gnu ftp://core.ring.gr.jp/pub/GNU/
|
||||
gnu ftp://ftp.cs.cuhk.edu.hk/pub/gnu/gnu/
|
||||
gnu ftp://tron.um.u-tokyo.ac.jp/pub/GNU/
|
||||
gnu http://ftp.azc.uam.mx/mirrors/gnu/
|
||||
gnu ftp://ftp.kaist.ac.kr/gnu/
|
||||
gnu ftp://ftp.chg.ru/pub/gnu/
|
||||
gnu ftp://ftp.inf.utfsm.cl/pub/gnu/
|
||||
gnu ftp://ftp.arnes.si/software/gnu/
|
||||
gnu ftp://gnu.cs.lewisu.edu/gnu/
|
||||
gnu http://ftp.wayne.edu/pub/gnu/
|
||||
gnu ftp://ftp.wayne.edu/pub/gnu/
|
||||
gnu http://kambing.vlsm.org/gnu/
|
||||
gnu http://gd.tuwien.ac.at/gnu/gnusrc/
|
||||
kde http://download.kde.org/
|
||||
kde http://master.kde.org/
|
||||
kde ftp://ftp.kde.org/pub/kde/
|
||||
kde http://ftp.icm.edu.pl/pub/unix/kde/
|
||||
kde http://ftp.pbone.net/pub/kde/
|
||||
kde http://ftp.fi.muni.cz/pub/kde/
|
||||
kde http://mirror.karneval.cz/pub/kde/
|
||||
kde http://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/
|
||||
kde http://ftp.rz.uni-wuerzburg.de/pub/unix/kde/
|
||||
kde http://ftp-stud.fht-esslingen.de/Mirrors/ftp.kde.org/pub/kde/
|
||||
kde http://ftp5.gwdg.de/pub/linux/kde/
|
||||
kde http://fr2.rpmfind.net/linux/KDE/
|
||||
kde http://archive.sunet.se/pub/X11/kde/
|
||||
kde http://vesta.informatik.rwth-aachen.de/ftp/pub/mirror/kde/
|
||||
kde http://mirrors.dotsrc.org/kde/
|
||||
kde http://ftp.nluug.nl/pub/windowing/kde/
|
||||
kde http://ftp.SURFnet.nl/windowing/kde/
|
||||
kde http://kde-mirror.freenux.org/stable/
|
||||
kde http://www-ftp.lip6.fr/pub/X11/kde/
|
||||
kde http://mirrors.ircam.fr/pub/KDE/
|
||||
kde http://www.mirrorservice.org/sites/ftp.kde.org/pub/kde/
|
||||
kde http://kde.mirror.anlx.net/
|
||||
kde http://mirror.catn.com/pub/kde/
|
||||
kde http://mirrors.fe.up.pt/pub/kde/
|
||||
kde http://ftp.heanet.ie/mirrors/ftp.kde.org/
|
||||
kde http://ftp.rhnet.is/pub/kde/
|
||||
kde http://chernabog.cc.vt.edu/pub/projects/kde/
|
||||
kde http://ftp.gtlib.cc.gatech.edu/pub/kde/
|
||||
kde ftp://chernabog.cc.vt.edu/pub/projects/kde/
|
||||
kde ftp://ftp.gtlib.cc.gatech.edu/pub/kde/
|
||||
kde ftp://carroll.aset.psu.edu/pub/kde/
|
||||
kde ftp://ftp.oregonstate.edu/pub/kde/
|
||||
kde ftp://ftp.ussg.iu.edu/pub/kde/
|
||||
kde http://mirrors.isc.org/pub/kde/
|
||||
kde http://mirror.karneval.cz/pub/kde/
|
||||
kde http://ftp.belnet.be/packages/kde/
|
||||
kde http://ftp.fi.muni.cz/pub/kde/
|
||||
kde http://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/
|
||||
kde http://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/
|
||||
kde http://ftp.rhnet.is/pub/kde/
|
||||
kde http://ftp-stud.fht-esslingen.de/Mirrors/ftp.kde.org/pub/kde/
|
||||
kde http://ftp.tiscali.nl/kde/
|
||||
kde http://mirrors.isc.org/pub/kde/
|
||||
kde http://sunsite.icm.edu.pl/pub/unix/kde/
|
||||
kde ftp://ftp.belnet.be/packages/kde/
|
||||
kde ftp://ftp.estpak.ee/pub/kde/
|
||||
kde ftp://ftp.fu-berlin.de/pub/unix/X11/gui/kde/
|
||||
kde ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.kde.org/pub/kde/
|
||||
kde http://ftp.du.se/pub/mirrors/kde/
|
||||
kde ftp://ftp.du.se/pub/mirrors/kde/
|
||||
kde ftp://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/
|
||||
kde ftp://ftp.mirrorservice.org/sites/ftp.kde.org/pub/kde/
|
||||
kde ftp://ftp.rhnet.is/pub/kde/
|
||||
kde ftp://ftp.sunet.se/pub/kde/
|
||||
kde ftp://ftp.tu-chemnitz.de/pub/X11/kde/
|
||||
kde ftp://ftp.tuniv.szczecin.pl/pub/kde/
|
||||
kde http://ftp.esat.net/mirrors/ftp.kde.org/pub/kde/
|
||||
kde http://ftp.kde.org.yu/kde/
|
||||
kde http://ftp.ring.gr.jp/pub/X/kde/
|
||||
kde http://ftp.tuniv.szczecin.pl/pub/kde/
|
||||
kde http://ftp.unina.it/pub/Linux/kde/
|
||||
kde http://mi.mirror.garr.it/mirrors/KDE/
|
||||
kde http://mirrors.dotsrc.org/kde/
|
||||
kde ftp://ftp.duth.gr/pub/kde/
|
||||
kde ftp://ftp.kde.org.yu/kde/
|
||||
kde ftp://ftp.pbone.net/mirror/ftp.kde.org/pub/kde/
|
||||
kde ftp://ftp.rz.uni-wuerzburg.de/pub/unix/kde/
|
||||
kde ftp://ftp.unina.it/pub/Linux/kde/
|
||||
kde ftp://mirrors.dotsrc.org/kde/
|
||||
kde ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/kde/
|
||||
kde http://ftp.duth.gr/pub/kde/
|
||||
kde http://ftp.hol.gr/mirror/kde/
|
||||
kde http://ftp.sunet.se/pub/kde/
|
||||
kde http://ring.asahi-net.or.jp/pub/X/kde/
|
||||
kde ftp://ftp.esat.net/mirrors/ftp.kde.org/pub/kde/
|
||||
kde ftp://ftp.no.kde.org/pub/kde/
|
||||
kde ftp://ftp.tiscali.nl/pub/mirrors/kde/
|
||||
kde http://ftp.heanet.ie/mirrors/ftp.kde.org/
|
||||
kde http://ftp.scarlet.be/pub/kde/
|
||||
kde ftp://ftp.solnet.ch/mirror/KDE/
|
||||
kde ftp://ftp.heanet.ie/mirrors/ftp.kde.org/
|
||||
kde ftp://ftp.iasi.roedu.net/pub/mirrors/ftp.kde.org/
|
||||
kde ftp://ftp.xcp.kiev.ua/ftp.kde.org/
|
||||
kde ftp://ring.asahi-net.or.jp/pub/X/kde/
|
||||
kde http://ftp.yz.yamagata-u.ac.jp/pub/X11/wm/kde/
|
||||
kde ftp://ftp.scarlet.be/pub/kde/
|
||||
kde ftp://sunsite.icm.edu.pl/pub/unix/kde/
|
||||
kde http://www.mirrorservice.org/sites/ftp.kde.org/pub/kde/
|
||||
kde ftp://ftp.hol.gr/pub/mirror/kde/
|
||||
kde http://gd.tuwien.ac.at/kde/
|
||||
kde ftp://ftp.ntua.gr/pub/X11/kde/
|
||||
kde http://ftp.ntua.gr/pub/X11/kde/
|
||||
kde ftp://ftp.fi.muni.cz/pub/kde/
|
||||
kde ftp://ftp.planetmirror.com/pub/kde/
|
||||
kde http://public.planetmirror.com/pub/kde/
|
||||
kde ftp://ftp.yz.yamagata-u.ac.jp/pub/X11/wm/kde/
|
||||
kde ftp://ftp.ring.gr.jp/pub/X/kde/
|
||||
kde ftp://kde.paralax.org/kde/
|
||||
kde http://ftp.kddlabs.co.jp/pub/X11/kde/
|
||||
kde ftp://ftp.kddlabs.co.jp/pub/X11/kde/
|
||||
kde ftp://ftp.nectec.or.th/pub/linux-softwares/KDE/
|
||||
kde ftp://ftp.chg.ru/pub/kde/
|
||||
kde http://ftp.chg.ru/pub/kde/
|
||||
kde http://ftp.gwdg.de/pub/x11/kde/
|
||||
kde ftp://gd.tuwien.ac.at/kde/
|
||||
kde ftp://ftp.gwdg.de/pub/x11/kde/
|
||||
kde http://gd.tuwien.ac.at/kde/
|
||||
kde ftp://ftp.sayclub.com/pub/X/KDE/
|
||||
kde http://ftp.sayclub.com/pub/X/KDE/
|
||||
sourceforge http://heanet.dl.sourceforge.net/
|
||||
sourceforge http://hivelocity.dl.sourceforge.net/
|
||||
sourceforge http://garr.dl.sourceforge.net/
|
||||
sourceforge http://biznetnetworks.dl.sourceforge.net/
|
||||
sourceforge http://internap.dl.sourceforge.net/
|
||||
sourceforge http://internode.dl.sourceforge.net/
|
||||
sourceforge http://iweb.dl.sourceforge.net/
|
||||
sourceforge http://jaist.dl.sourceforge.net/
|
||||
sourceforge http://kent.dl.sourceforge.net/
|
||||
sourceforge http://mesh.dl.sourceforge.net/
|
||||
sourceforge http://nchc.dl.sourceforge.net/
|
||||
sourceforge http://nfsi.dl.sourceforge.net/
|
||||
sourceforge http://ovh.dl.sourceforge.net/
|
||||
sourceforge http://puzzle.dl.sourceforge.net/
|
||||
sourceforge http://softlayer.dl.sourceforge.net/
|
||||
sourceforge http://sunet.dl.sourceforge.net/
|
||||
sourceforge http://superb-east.dl.sourceforge.net/
|
||||
sourceforge http://superb-west.dl.sourceforge.net/
|
||||
sourceforge http://surfnet.dl.sourceforge.net/
|
||||
sourceforge http://switch.dl.sourceforge.net/
|
||||
sourceforge http://transact.dl.sourceforge.net/
|
||||
sourceforge http://ufpr.dl.sourceforge.net/
|
||||
sourceforge http://voxel.dl.sourceforge.net/
|
||||
sourceforge http://waix.dl.sourceforge.net/
|
||||
sourceforge http://easynews.dl.sourceforge.net/
|
||||
sourceforge http://optusnet.dl.sourceforge.net/
|
||||
sourceforge http://dfn.dl.sourceforge.net/
|
||||
sourceforge http://freefr.dl.sourceforge.net/
|
||||
xorg http://ftp.x.org/pub/
|
||||
xorg http://xorg.freedesktop.org/archive/
|
||||
xorg http://mirror.sg.depaul.edu/pub/x.org/
|
||||
xorg http://x.paracoda.com/pub/
|
||||
xorg http://x.hostingzero.com/
|
||||
xfce http://mirror.netcologne.de/xfce/
|
||||
xfce http://ftp.udc.es/xfce/
|
||||
xfce http://www.p0llux.be/xfce/
|
||||
xfce http://archive.be.xfce.org/
|
||||
xfce http://archive.be2.xfce.org/
|
||||
xfce http://archive.se.xfce.org/
|
||||
xfce http://xfce.mirror.uber.com.au/
|
||||
xfce http://mirror.yongbok.net/X11/xfce-mirror/
|
||||
xfce http://archive.al-us.xfce.org/
|
||||
@@ -0,0 +1,11 @@
|
||||
--- pisi/db/filesldb.py~ 2014-06-15 16:33:39.000000000 +0200
|
||||
+++ pisi/db/filesldb.py 2014-06-17 18:29:52.356729861 +0200
|
||||
@@ -27,7 +27,7 @@
|
||||
self.files_ldb_path = os.path.join(ctx.config.info_dir(), ctx.const.files_ldb)
|
||||
self.filesdb = plyvel.DB(self.files_ldb_path, create_if_missing=True)
|
||||
if not [f for f in os.listdir(self.files_ldb_path) if f.endswith('.ldb')]:
|
||||
- self.destroy()
|
||||
+ if ctx.comar: self.destroy()
|
||||
self.create_filesdb()
|
||||
|
||||
def __del__(self):
|
||||
@@ -0,0 +1,277 @@
|
||||
diff -Naur pisi~/cli/pisicli.py pisi/cli/pisicli.py
|
||||
--- pisi~/cli/pisicli.py 2011-05-26 19:17:29.000000000 +0200
|
||||
+++ pisi/cli/pisicli.py 2014-07-05 20:01:49.432333678 +0200
|
||||
@@ -39,6 +39,7 @@
|
||||
import pisi.cli.listavailable
|
||||
import pisi.cli.listcomponents
|
||||
import pisi.cli.listinstalled
|
||||
+import pisi.cli.listorphaned
|
||||
import pisi.cli.listpending
|
||||
import pisi.cli.listrepo
|
||||
import pisi.cli.listsources
|
||||
@@ -46,6 +47,7 @@
|
||||
import pisi.cli.rebuilddb
|
||||
import pisi.cli.remove
|
||||
import pisi.cli.removerepo
|
||||
+import pisi.cli.removeorphaned
|
||||
import pisi.cli.enablerepo
|
||||
import pisi.cli.disablerepo
|
||||
import pisi.cli.searchfile
|
||||
diff -Naur pisi~/cli/listorphaned.py pisi/cli/listorphaned.py
|
||||
--- pisi~/cli/listorphaned.py 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ pisi/cli/listorphaned.py 2014-09-15 22:22:18.827459865 +0200
|
||||
@@ -0,0 +1,59 @@
|
||||
+# -*- coding:utf-8 -*-
|
||||
+#
|
||||
+# Copyright (C) 2014, marcin.bojara (at) gmail.com
|
||||
+#
|
||||
+# 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.
|
||||
+#
|
||||
+
|
||||
+import optparse
|
||||
+
|
||||
+import gettext
|
||||
+__trans = gettext.translation('pisi', fallback=True)
|
||||
+_ = __trans.ugettext
|
||||
+
|
||||
+import pisi.cli.command as command
|
||||
+import pisi.context as ctx
|
||||
+import pisi.util as util
|
||||
+import pisi.db
|
||||
+
|
||||
+class ListOrphaned(command.Command):
|
||||
+ __doc__ = _("""List orphaned packages
|
||||
+
|
||||
+Usage: list-orphaned
|
||||
+
|
||||
+Lists packages installed as dependency, but no longer needed by any other installed package.
|
||||
+""")
|
||||
+ __metaclass__ = command.autocommand
|
||||
+
|
||||
+ def __init__(self, args):
|
||||
+ super(ListOrphaned, self).__init__(args)
|
||||
+ self.installdb = pisi.db.installdb.InstallDB()
|
||||
+
|
||||
+ name = ("list-orphaned", "lo")
|
||||
+
|
||||
+ def options(self):
|
||||
+
|
||||
+ group = optparse.OptionGroup(self.parser, _("list-orphaned options"))
|
||||
+ group.add_option("-a", "--all", action="store_true",
|
||||
+ default=False, help=_("Show all packages without reverse dependencies"))
|
||||
+ group.add_option("-x", "--exclude", action="append",
|
||||
+ default=None, help=_("Ignore packages and components whose basenames match pattern."))
|
||||
+ self.parser.add_option_group(group)
|
||||
+
|
||||
+ def run(self):
|
||||
+
|
||||
+ self.init(database = True, write = False)
|
||||
+ orphaned = self.installdb.get_no_rev_deps() if self.options.all else self.installdb.get_orphaned()
|
||||
+
|
||||
+ if self.options.exclude:
|
||||
+ orphaned = pisi.blacklist.exclude(orphaned, ctx.get_option('exclude'))
|
||||
+
|
||||
+ if orphaned:
|
||||
+ ctx.ui.info(_("Orphaned packages:"))
|
||||
+ ctx.ui.info(util.format_by_columns(sorted(orphaned)))
|
||||
+ else: ctx.ui.info(_("No orphaned packages"))
|
||||
diff -Naur pisi~/cli/removeorphaned.py pisi/cli/removeorphaned.py
|
||||
--- pisi~/cli/removeorphaned.py 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ pisi/cli/removeorphaned.py 2014-09-15 22:22:37.484459184 +0200
|
||||
@@ -0,0 +1,55 @@
|
||||
+# -*- coding:utf-8 -*-
|
||||
+#
|
||||
+# Copyright (C) 2014, marcin.bojara (at) gmail.com
|
||||
+#
|
||||
+# 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.
|
||||
+#
|
||||
+
|
||||
+import optparse
|
||||
+
|
||||
+import gettext
|
||||
+__trans = gettext.translation('pisi', fallback=True)
|
||||
+_ = __trans.ugettext
|
||||
+
|
||||
+import pisi.cli.command as command
|
||||
+import pisi.context as ctx
|
||||
+import pisi.api
|
||||
+import pisi.db
|
||||
+
|
||||
+class RemoveOrphaned(command.PackageOp):
|
||||
+ __doc__ = _("""Remove orphaned packages
|
||||
+
|
||||
+Usage: remove-orphaned
|
||||
+
|
||||
+Remove all orphaned packages from the system.
|
||||
+""")
|
||||
+ __metaclass__ = command.autocommand
|
||||
+
|
||||
+ def __init__(self,args):
|
||||
+ super(RemoveOrphaned, self).__init__(args)
|
||||
+ self.installdb = pisi.db.installdb.InstallDB()
|
||||
+
|
||||
+ name = ("remove-orphaned", "ro")
|
||||
+
|
||||
+ def options(self):
|
||||
+ group = optparse.OptionGroup(self.parser, _("remove-orphaned options"))
|
||||
+
|
||||
+ super(RemoveOrphaned, self).options(group)
|
||||
+ group.add_option("-x", "--exclude", action="append",
|
||||
+ default=None, help=_("When removing orphaned, ignore packages and components whose basenames match pattern."))
|
||||
+
|
||||
+ self.parser.add_option_group(group)
|
||||
+
|
||||
+ def run(self):
|
||||
+
|
||||
+ self.init(database = True, write = False)
|
||||
+ orphaned = self.installdb.get_orphaned()
|
||||
+ if ctx.get_option('exclude'):
|
||||
+ orphaned = pisi.blacklist.exclude(orphaned, ctx.get_option('exclude'))
|
||||
+
|
||||
+ pisi.api.remove(orphaned)
|
||||
diff -Naur pisi~/constants.py pisi/constants.py
|
||||
--- pisi~/constants.py 2014-06-15 16:33:39.000000000 +0200
|
||||
+++ pisi/constants.py 2014-08-14 20:51:46.437906848 +0200
|
||||
@@ -104,6 +104,7 @@
|
||||
self.__c.system_devel_component = "system.devel"
|
||||
self.__c.devels_component = "programming.devel"
|
||||
self.__c.docs_component = "programming.docs"
|
||||
+ self.__c.installed_extra = "installedextra"
|
||||
|
||||
#file/directory permissions
|
||||
self.__c.umask = 0022
|
||||
diff -Naur pisi~/db/installdb.py pisi/db/installdb.py
|
||||
--- pisi~/db/installdb.py 2014-06-15 16:33:39.000000000 +0200
|
||||
+++ pisi/db/installdb.py 2014-08-31 16:59:29.586602738 +0200
|
||||
@@ -67,6 +67,15 @@
|
||||
def init(self):
|
||||
self.installed_db = self.__generate_installed_pkgs()
|
||||
self.rev_deps_db = self.__generate_revdeps()
|
||||
+ self.installed_extra = self.__generate_installed_extra()
|
||||
+
|
||||
+ def __generate_installed_extra(self):
|
||||
+ ie = []
|
||||
+ ie_path = os.path.join(ctx.config.info_dir(), ctx.const.installed_extra)
|
||||
+ if os.path.isfile(ie_path):
|
||||
+ with open(ie_path) as ie_file:
|
||||
+ ie.extend(ie_file.read().strip().split("\n"))
|
||||
+ return ie
|
||||
|
||||
def __generate_installed_pkgs(self):
|
||||
def split_name(dirname):
|
||||
@@ -259,6 +268,19 @@
|
||||
|
||||
return rev_deps
|
||||
|
||||
+ def get_orphaned(self):
|
||||
+ """
|
||||
+ get list of packages installed as extra dependency,
|
||||
+ but without reverse dependencies now.
|
||||
+ """
|
||||
+ return [x for x in self.installed_extra if not self.get_rev_deps(x)]
|
||||
+
|
||||
+ def get_no_rev_deps(self):
|
||||
+ """
|
||||
+ get installed packages list which haven't reverse dependencies.
|
||||
+ """
|
||||
+ return [x for x in self.installed_db if not self.get_rev_deps(x)]
|
||||
+
|
||||
def pkg_dir(self, pkg, version, release):
|
||||
return pisi.util.join_path(ctx.config.packages_dir(), pkg + '-' + version + '-' + release)
|
||||
|
||||
diff -Naur pisi~/operations/install.py pisi/operations/install.py
|
||||
--- pisi~/operations/install.py 2014-09-15 22:14:00.381478078 +0200
|
||||
+++ pisi/operations/install.py 2014-07-03 18:54:49.000000000 +0200
|
||||
@@ -27,7 +27,7 @@
|
||||
import pisi.ui as ui
|
||||
import pisi.db
|
||||
|
||||
-def install_pkg_names(A, reinstall = False):
|
||||
+def install_pkg_names(A, reinstall = False, extra = False):
|
||||
"""This is the real thing. It installs packages from
|
||||
the repository, trying to perform a minimum number of
|
||||
installs"""
|
||||
@@ -78,7 +78,8 @@
|
||||
if ctx.get_option('dry_run'):
|
||||
return True
|
||||
|
||||
- if set(order) - A_0:
|
||||
+ extra_packages = set(order) - A_0
|
||||
+ if extra_packages:
|
||||
if not ctx.ui.confirm(_('There are extra packages due to dependencies. Do you want to continue?')):
|
||||
return False
|
||||
|
||||
@@ -91,10 +92,18 @@
|
||||
conflicts = operations.helper.check_conflicts(order, packagedb)
|
||||
|
||||
paths = []
|
||||
+ extra_paths = {}
|
||||
for x in order:
|
||||
ctx.ui.info(util.colorize(_("Downloading %d / %d") % (order.index(x)+1, len(order)), "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):
|
||||
+ extra_paths[install_op.package_fname] = x
|
||||
+ elif reinstall and x in installdb.installed_extra:
|
||||
+ installdb.installed_extra.remove(x)
|
||||
+ with open(os.path.join(ctx.config.info_dir(), ctx.const.installed_extra), "w") as ie_file:
|
||||
+ ie_file.write("\n".join(installdb.installed_extra) + ("\n" if installdb.installed_extra else ""))
|
||||
+
|
||||
|
||||
# fetch to be installed packages but do not install them.
|
||||
if ctx.get_option('fetch_only'):
|
||||
@@ -107,6 +116,12 @@
|
||||
ctx.ui.info(util.colorize(_("Installing %d / %d") % (paths.index(path)+1, len(paths)), "yellow"))
|
||||
install_op = atomicoperations.Install(path)
|
||||
install_op.install(False)
|
||||
+ try:
|
||||
+ with open(os.path.join(ctx.config.info_dir(), ctx.const.installed_extra), "a") as ie_file:
|
||||
+ ie_file.write("%s\n" % extra_paths[path])
|
||||
+ installdb.installed_extra.append(extra_paths[path])
|
||||
+ except KeyError:
|
||||
+ pass
|
||||
|
||||
return True
|
||||
|
||||
@@ -199,7 +214,7 @@
|
||||
ctx.ui.info(util.format_by_columns(sorted(extra_packages)))
|
||||
if not ctx.ui.confirm(_('Do you want to continue?')):
|
||||
raise Exception(_('External dependencies not satisfied'))
|
||||
- install_pkg_names(extra_packages, reinstall=True)
|
||||
+ install_pkg_names(extra_packages, reinstall=True, extra=True)
|
||||
|
||||
class PackageDB:
|
||||
def get_package(self, key, repo = None):
|
||||
diff -Naur pisi~/operations/remove.py pisi/operations/remove.py
|
||||
--- pisi~/operations/remove.py 2014-09-15 22:14:00.381478078 +0200
|
||||
+++ pisi/operations/remove.py 2014-07-03 18:54:49.000000000 +0200
|
||||
@@ -10,6 +10,7 @@
|
||||
# Please read the COPYING file.
|
||||
#
|
||||
|
||||
+import os
|
||||
import sys
|
||||
|
||||
import gettext
|
||||
@@ -81,6 +82,11 @@
|
||||
for x in order:
|
||||
if installdb.has_package(x):
|
||||
atomicoperations.remove_single(x)
|
||||
+ if x in installdb.installed_extra:
|
||||
+ installdb.installed_extra.remove(x)
|
||||
+ with open(os.path.join(ctx.config.info_dir(), ctx.const.installed_extra), "w") as ie_file:
|
||||
+ ie_file.write("\n".join(installdb.installed_extra) + ("\n" if installdb.installed_extra else ""))
|
||||
+
|
||||
else:
|
||||
ctx.ui.info(_('Package %s is not installed. Cannot remove.') % x)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
diff -Nuar pisi-2.6-OSmanOS/pisi/actionsapi/pisitools.py pisi-2.6/pisi/actionsapi/pisitools.py
|
||||
--- pisi-2.6-OSmanOS/pisi/actionsapi/pisitools.py 2014-03-08 00:03:46.000000000 +0200
|
||||
+++ pisi-2.6/pisi/actionsapi/pisitools.py 2014-12-07 20:32:05.111207119 +0200
|
||||
@@ -41,6 +41,11 @@
|
||||
''' example call: pisitools.dobin("bin/xloadimage", "/bin", "xload") '''
|
||||
executable_insinto(join_path(get.installDIR(), destinationDirectory), sourceFile)
|
||||
|
||||
+def dopixmaps(sourceFile, destinationDirectory = '/usr/share/pixmaps'):
|
||||
+ '''insert a data file into /usr/share/pixmaps'''
|
||||
+ ''' example call: pisitools.dopixmaps("/usr/share/pixmaps/firefox", "firefox") '''
|
||||
+ readable_insinto(join_path(get.installDIR(), destinationDirectory), sourceFile)
|
||||
+
|
||||
def dodir(destinationDirectory):
|
||||
'''creates a directory tree'''
|
||||
makedirs(join_path(get.installDIR(), destinationDirectory))
|
||||
@@ -0,0 +1,49 @@
|
||||
[build]
|
||||
build_host = localhost
|
||||
# buildhelper = None
|
||||
commonflags = -mtune=atom -march=i686 -O2 -pipe -fomit-frame-pointer -fstack-protector -D_FORTIFY_SOURCE=2 -ggdb3 -funwind-tables -fasynchronous-unwind-tables
|
||||
cflags = %(commonflags)s
|
||||
cxxflags = %(commonflags)s
|
||||
host = i686-pc-linux-gnu
|
||||
cc = %(host)s-gcc
|
||||
cxx = %(host)s-g++
|
||||
compressionlevel = 9
|
||||
enableSandbox = True
|
||||
fallback = http://source.pisilinux.org/1.0
|
||||
generateDebug = False
|
||||
jobs = -j5
|
||||
ldflags = -Wl,-O1 -Wl,-z,relro -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--sort-common
|
||||
ignored_build_types = emul32
|
||||
|
||||
[directories]
|
||||
cache_root_dir = /var/cache/pisi
|
||||
archives_dir = %(cache_root_dir)s/archives
|
||||
cached_packages_dir = %(cache_root_dir)s/packages
|
||||
compiled_packages_dir = %(cache_root_dir)s/packages
|
||||
debug_packages_dir = %(cache_root_dir)s/packages-debug
|
||||
lib_dir = /var/lib/pisi
|
||||
history_dir = %(lib_dir)s/history
|
||||
index_dir = %(lib_dir)s/index
|
||||
info_dir = %(lib_dir)s/info
|
||||
kde_dir = /usr
|
||||
lock_dir = /run/lock/subsys
|
||||
log_dir = /var/log
|
||||
packages_dir = %(lib_dir)s/package
|
||||
qt_dir = /usr
|
||||
tmp_dir = /var/pisi
|
||||
|
||||
[general]
|
||||
architecture = i686
|
||||
autoclean = False
|
||||
bandwidth_limit = 0
|
||||
destinationdirectory = /
|
||||
distribution = PisiLinux
|
||||
distribution_release = 1.0
|
||||
distribution_id = p01
|
||||
# ftp_proxy = None
|
||||
# http_proxy = None
|
||||
# https_proxy = None
|
||||
ignore_delta = False
|
||||
ignore_safety = False
|
||||
package_cache = False
|
||||
package_cache_limit = 0
|
||||
@@ -0,0 +1,49 @@
|
||||
[build]
|
||||
build_host = localhost
|
||||
# buildhelper = None
|
||||
commonflags = -mtune=generic -march=x86-64 -O2 -pipe -fstack-protector -D_FORTIFY_SOURCE=2 -g -fPIC
|
||||
cflags = %(commonflags)s
|
||||
cxxflags = %(commonflags)s
|
||||
host = x86_64-pc-linux-gnu
|
||||
cc = %(host)s-gcc
|
||||
cxx = %(host)s-g++
|
||||
compressionlevel = 9
|
||||
enableSandbox = True
|
||||
fallback = http://source.pisilinux.org/1.0
|
||||
generateDebug = False
|
||||
jobs = -j5
|
||||
ldflags = -Wl,-O1 -Wl,-z,relro -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--sort-common
|
||||
ignored_build_types = pae
|
||||
|
||||
[directories]
|
||||
cache_root_dir = /var/cache/pisi
|
||||
archives_dir = %(cache_root_dir)s/archives
|
||||
cached_packages_dir = %(cache_root_dir)s/packages
|
||||
compiled_packages_dir = %(cache_root_dir)s/packages
|
||||
debug_packages_dir = %(cache_root_dir)s/packages-debug
|
||||
lib_dir = /var/lib/pisi
|
||||
history_dir = %(lib_dir)s/history
|
||||
index_dir = %(lib_dir)s/index
|
||||
info_dir = %(lib_dir)s/info
|
||||
kde_dir = /usr
|
||||
lock_dir = /run/lock/subsys
|
||||
log_dir = /var/log
|
||||
packages_dir = %(lib_dir)s/package
|
||||
qt_dir = /usr
|
||||
tmp_dir = /var/pisi
|
||||
|
||||
[general]
|
||||
architecture = x86_64
|
||||
autoclean = False
|
||||
bandwidth_limit = 0
|
||||
destinationdirectory = /
|
||||
distribution = PisiLinux
|
||||
distribution_release = 1.0
|
||||
distribution_id = p01
|
||||
# ftp_proxy = None
|
||||
# http_proxy = None
|
||||
# https_proxy = None
|
||||
ignore_delta = False
|
||||
ignore_safety = False
|
||||
package_cache = False
|
||||
package_cache_limit = 0
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||
<mime-type type="application/x-pisi">
|
||||
<comment>PiSi package</comment>
|
||||
<comment xml:lang="tr">PiSi paketi</comment>
|
||||
<glob pattern="*.pisi"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
@@ -0,0 +1,32 @@
|
||||
for managing CFLAGS, CXXFLAGS and LDFLAGS you can use pisitools
|
||||
for CFLAGGS -> pisitools.cflags
|
||||
for LDFLAGGS -> pisitools.ldflags
|
||||
for CXXFLAGGS -> pisitools.cxxflags
|
||||
for both CFLAGGS and CXXFLAGS -> pisitools.flags
|
||||
|
||||
available operations:
|
||||
|
||||
add("param1", "param2", ..., "paramN")
|
||||
e.g.
|
||||
pisitools.cxxflags.add("-fpermisive")
|
||||
-> shelltools.export("CXXFLAGS", "%s -fpermisive" % get.CXXFLAGS())
|
||||
pisitools.flags.add("-fno-strict-aliasing", "-fPIC")
|
||||
-> shelltools.export("CFLAGS", "%s -fno-strict-aliasing -fPIC" % get.CFLAGS())
|
||||
-> shelltools.export("CXXFLAGS", "%s -ffno-strict-aliasing -fPIC" % get.CXXFLAGS())
|
||||
|
||||
remove("param1", "param2", ..., "paramN")
|
||||
e.g.
|
||||
pisitools.cflags.remove("-fno-strict-aliasing")
|
||||
-> shelltools.export("CFLAGS", get.CFLAGS().replace("-fno-strict-aliasing", ""))
|
||||
|
||||
replace("old value", "new value")
|
||||
e.g.
|
||||
pisitools.cflags.replace("-O2", "-O3")
|
||||
-> shelltools.export("CFLAGS", get.CFLAGS().replace("-O2", "-O3"))
|
||||
|
||||
sub(pattern, repl, count, flags)
|
||||
works like re.sub(pattern, repl, string, count, flags) for specified flags
|
||||
e.g.
|
||||
pisitools.cflags.replace("-O\d", "-Os")
|
||||
-> import re
|
||||
-> shelltools.export("CFLAGS", re.sub("-O\d", "-Os", get.CFLAGS()))
|
||||
@@ -0,0 +1,139 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2011 TUBITAK/UEKAE
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Standart Python Modules
|
||||
import subprocess
|
||||
|
||||
import gettext
|
||||
__trans = gettext.translation('pisi', fallback=True)
|
||||
_ = __trans.ugettext
|
||||
|
||||
# PiSi Modules
|
||||
import pisi.context as ctx
|
||||
import pisi.actionsapi
|
||||
|
||||
class PkgconfigError(pisi.actionsapi.Error):
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
|
||||
def getVariableForLibrary(library, variable):
|
||||
# Returns a specific variable provided in the library .pc file
|
||||
try:
|
||||
proc = subprocess.Popen(["pkg-config",
|
||||
"--variable=%s" % variable,
|
||||
"%s" % library],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
return_code = proc.wait()
|
||||
except OSError, exception:
|
||||
if exception.errno == 2:
|
||||
raise PkgconfigError(_("pkg-config is not installed on your system."))
|
||||
else:
|
||||
if return_code == 0 and proc.stdout:
|
||||
return proc.stdout.read().strip()
|
||||
else:
|
||||
# Command failed
|
||||
raise PkgconfigError(proc.stderr.read().strip())
|
||||
|
||||
def getLibraryVersion(library):
|
||||
"""Returns the module version provided in the library .pc file."""
|
||||
try:
|
||||
proc = subprocess.Popen(["pkg-config",
|
||||
"--modversion",
|
||||
library],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
return_code = proc.wait()
|
||||
except OSError, exception:
|
||||
if exception.errno == 2:
|
||||
raise PkgconfigError(_("pkg-config is not installed on your system."))
|
||||
else:
|
||||
if return_code == 0 and proc.stdout:
|
||||
return proc.stdout.read().strip()
|
||||
else:
|
||||
# Command failed
|
||||
raise PkgconfigError(proc.stderr.read().strip())
|
||||
|
||||
def getLibraryCFLAGS(library):
|
||||
"""Returns compiler flags for compiling with this library.
|
||||
Ex: -I/usr/include/nss"""
|
||||
try:
|
||||
proc = subprocess.Popen(["pkg-config",
|
||||
"--cflags",
|
||||
"%s" % library],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
return_code = proc.wait()
|
||||
except OSError, exception:
|
||||
if exception.errno == 2:
|
||||
raise PkgconfigError(_("pkg-config is not installed on your system."))
|
||||
else:
|
||||
if return_code == 0 and proc.stdout:
|
||||
return proc.stdout.read().strip()
|
||||
else:
|
||||
# Command failed
|
||||
raise PkgconfigError(proc.stderr.read().strip())
|
||||
|
||||
def getLibraryLIBADD(library):
|
||||
"""Returns linker flags for linking with this library.
|
||||
Ex: -lpng14"""
|
||||
try:
|
||||
proc = subprocess.Popen(["pkg-config",
|
||||
"--libs",
|
||||
"%s" % library],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
return_code = proc.wait()
|
||||
except OSError, exception:
|
||||
if exception.errno == 2:
|
||||
raise PkgconfigError(_("pkg-config is not installed on your system."))
|
||||
else:
|
||||
if return_code == 0 and proc.stdout:
|
||||
return proc.stdout.read().strip()
|
||||
else:
|
||||
# Command failed
|
||||
raise PkgconfigError(proc.stderr.read().strip())
|
||||
|
||||
def runManualCommand(*args):
|
||||
"""Runs the given command and returns the output."""
|
||||
cmd = ["pkg-config"]
|
||||
cmd.extend(args)
|
||||
try:
|
||||
proc = subprocess.Popen(cmd,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
return_code = proc.wait()
|
||||
except OSError, exception:
|
||||
if exception.errno == 2:
|
||||
raise PkgconfigError(_("pkg-config is not installed on your system."))
|
||||
else:
|
||||
if return_code == 0 and proc.stdout:
|
||||
return proc.stdout.read().strip()
|
||||
else:
|
||||
# Command failed
|
||||
raise PkgconfigError(proc.stderr.read().strip())
|
||||
|
||||
|
||||
def libraryExists(library):
|
||||
"""Returns True if the library provides a .pc file."""
|
||||
result = None
|
||||
try:
|
||||
result = subprocess.call(["pkg-config",
|
||||
"--exists",
|
||||
"%s" % library])
|
||||
except OSError, exception:
|
||||
if exception.errno == 2:
|
||||
raise PkgconfigError(_("pkg-config is not installed on your system."))
|
||||
else:
|
||||
return result == 0
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
# This file contains valid path list for pisi sandbox
|
||||
# and used in the build process to constrain actions.py inside
|
||||
# the build directories
|
||||
|
||||
# Paths like /tmp allow writing to /tmp2/lala
|
||||
# while /tmp/ only allows inside the /tmp directory
|
||||
# ~ at the beginning of the path is replaced by pisi user's home directory
|
||||
|
||||
# Each package has its build directory (/var/pisi/pkgname) allowed by default
|
||||
# And ccache directory is automatically added when that feature is enabled
|
||||
# Any other extra path should be configured here
|
||||
|
||||
# Generic system paths needed by almost all programs
|
||||
/tmp/
|
||||
/var/tmp/
|
||||
/var/run/utmp
|
||||
/dev/tty
|
||||
/dev/pts/
|
||||
/dev/pty
|
||||
/dev/null
|
||||
/dev/zero
|
||||
/dev/ptmx
|
||||
/dev/shm/
|
||||
/dev/full
|
||||
/run/shm
|
||||
/proc/
|
||||
# stupid autoconf family needs /usr/lib/conftest* and /usr/lib/cf* for some conftest,
|
||||
# http://sources.gentoo.org/viewcvs.py/portage/trunk/sandbox/files/sandbox/sandbox.c also permits these
|
||||
/usr/lib/conftest
|
||||
/usr/lib/cf
|
||||
# every qt/KDE application check these
|
||||
~/.qt/.qt_plugins_3.3rc.lock
|
||||
~/.qt/qt_plugins_3.3rc.tmp
|
||||
~/.qt/.qtrc.lock
|
||||
~/.qt/.qt_designerrc.lock
|
||||
/usr/qt/3/etc/settings/.qt_plugins_3.3rc.lock
|
||||
/usr/qt/3/etc/settings/qt_plugins_3.3rc.tmp
|
||||
/usr/qt/3/etc/settings/qt_plugins_3.3rc
|
||||
/usr/qt/3/etc/settings/.qtrc.lock
|
||||
/usr/qt/3/etc/settings/.qt_designerrc.lock
|
||||
|
||||
# FontConfig cache directory
|
||||
/var/cache/fontconfig
|
||||
@@ -0,0 +1,2 @@
|
||||
D /run/lock/files.ldb 0777 root root - -
|
||||
F /run/lock/files.ldb/LOCK 0666 root root - -
|
||||
@@ -0,0 +1,306 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>pisi</Name>
|
||||
<Homepage>http://www.pisilinux.org/</Homepage>
|
||||
<Packager>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Packager>
|
||||
<License>GPLv2</License>
|
||||
<IsA>app:console</IsA>
|
||||
<Summary>PISI is the package management system of Pisi Linux</Summary>
|
||||
<Description>PISI is a modern package management system implemented in Python. Some of its main features are: package sources are written in XML and python, implements all functions through a simple-to-use API, integrates low-level and high-level package management features.</Description>
|
||||
<Archive sha1sum="7f16d1a0e4c8d2df73838a329485b74523fe50ad" type="tarxz">http://source.pisilinux.org/1.0/pisi-2.6.tar.xz</Archive>
|
||||
<AdditionalFiles>
|
||||
<AdditionalFile permission="0644" target="pisi.conf-i686">pisi.conf-i686</AdditionalFile>
|
||||
<AdditionalFile permission="0644" target="pisi.conf-x86_64">pisi.conf-x86_64</AdditionalFile>
|
||||
</AdditionalFiles>
|
||||
<BuildDependencies>
|
||||
<Dependency>comar</Dependency>
|
||||
<Dependency>plyvel</Dependency>
|
||||
<Dependency>python</Dependency>
|
||||
<Dependency>gettext</Dependency>
|
||||
<Dependency>leveldb-devel</Dependency>
|
||||
</BuildDependencies>
|
||||
<Patches>
|
||||
<Patch>initialize_filesdb_once.patch</Patch>
|
||||
<Patch>no_clean_if_ignore_comar.patch</Patch>
|
||||
<Patch>orphaned_pkgs.patch</Patch>
|
||||
<Patch>improve_pisi_ix.patch</Patch>
|
||||
<Patch>fix_emul32_flags.patch</Patch>
|
||||
<Patch level="1">pisi-2.6-pisitools.dopixmaps-add.patch</Patch>
|
||||
</Patches>
|
||||
</Source>
|
||||
|
||||
<Package>
|
||||
<Name>pisi</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency>tar</Dependency>
|
||||
<Dependency>file</Dependency>
|
||||
<Dependency>comar</Dependency>
|
||||
<Dependency>plyvel</Dependency>
|
||||
<Dependency>python</Dependency>
|
||||
<Dependency>gettext</Dependency>
|
||||
<Dependency>leveldb</Dependency>
|
||||
<Dependency>piksemel</Dependency>
|
||||
<Dependency>comar-api</Dependency>
|
||||
<Dependency>urlgrabber</Dependency>
|
||||
<Dependency>python-psutil</Dependency>
|
||||
<Dependency>python-pyliblzma</Dependency>
|
||||
<Dependency releaseFrom="16">mudur</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="executable">/usr/bin</Path>
|
||||
<Path fileType="executable">/usr/sbin</Path>
|
||||
<Path fileType="library">/usr/lib/pardus/pisi</Path>
|
||||
<Path fileType="library">/usr/lib/pisilinux/pisi</Path>
|
||||
<Path fileType="localedata">/usr/share/locale</Path>
|
||||
<Path fileType="doc">/usr/share/doc</Path>
|
||||
<Path fileType="config">/etc/pisi</Path>
|
||||
<Path fileType="data">/usr/share/mime/packages</Path>
|
||||
<Path fileType="config">/usr/lib/tmpfiles.d/pisi.conf</Path>
|
||||
<Path fileType="data">/run/lock/files.ldb/LOCK</Path>
|
||||
<Path fileType="data">/var/lib/pisi/info/files.ldb/LOCK</Path>
|
||||
</Files>
|
||||
<AdditionalFiles>
|
||||
<AdditionalFile owner="root" permission="0644" target="/etc/pisi/mirrors.conf">mirrors.conf</AdditionalFile>
|
||||
<AdditionalFile owner="root" permission="0644" target="/etc/pisi/sandbox.conf">sandbox.conf</AdditionalFile>
|
||||
<AdditionalFile owner="root" permission="0644" target="/usr/share/mime/packages/pisi.xml">pisi.xml</AdditionalFile>
|
||||
<AdditionalFile owner="root" permission="0644" target="/usr/lib/pisilinux/pisi/actionsapi/pkgconfig.py">pkgconfig.py</AdditionalFile>
|
||||
<AdditionalFile target="/usr/lib/tmpfiles.d/pisi.conf" permission="0644" owner="root">tmpfiles.conf</AdditionalFile>
|
||||
</AdditionalFiles>
|
||||
<Provides>
|
||||
<COMAR script="package.py">System.Package</COMAR>
|
||||
<COMAR script="manager.py">System.Manager</COMAR>
|
||||
</Provides>
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="31">
|
||||
<Date>2014-12-07</Date>
|
||||
<Version>2.6</Version>
|
||||
<Comment>Add new pisitools.dopixmaps</Comment>
|
||||
<Name>Osman Erkan</Name>
|
||||
<Email>osman.erkan@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="30">
|
||||
<Date>2014-09-15</Date>
|
||||
<Version>2.6</Version>
|
||||
<Comment>Add new pisi commands: list-orphaned and remove-orphaned.
|
||||
Improve pisi index.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="29">
|
||||
<Date>2014-08-04</Date>
|
||||
<Version>2.6</Version>
|
||||
<Comment>pisi search-file works without sudo now.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="28">
|
||||
<Date>2014-07-25</Date>
|
||||
<Version>2.6</Version>
|
||||
<Comment>Rebuild for version number.</Comment>
|
||||
<Name>Aydın Demirel</Name>
|
||||
<Email>aydin.demirel@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="27">
|
||||
<Date>2014-06-24</Date>
|
||||
<Version>2.6</Version>
|
||||
<Comment>Add patch for initialize filesdb once.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="26">
|
||||
<Date>2014-06-15</Date>
|
||||
<Version>2.6</Version>
|
||||
<Comment>Version bump.
|
||||
revdep-rebuild rewritten in python.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="25">
|
||||
<Date>2014-06-08</Date>
|
||||
<Version>2.5</Version>
|
||||
<Comment>Add case sensitive for 'pisi sr'.
|
||||
Change install path.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="24">
|
||||
<Date>2014-05-27</Date>
|
||||
<Version>2.5</Version>
|
||||
<Comment>Add patch level auto detection feature,
|
||||
sha1sum for install.tar.xz file,
|
||||
check sha1sum for upgrade.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="23">
|
||||
<Date>2014-05-11</Date>
|
||||
<Version>2.5</Version>
|
||||
<Comment>Release bump.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="22">
|
||||
<Date>2014-05-11</Date>
|
||||
<Version>2.5</Version>
|
||||
<Comment>Some improvements for buildfarm.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="21" type="critical">
|
||||
<Date>2014-04-04</Date>
|
||||
<Version>2.5</Version>
|
||||
<Comment>Handle error for file command.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="20" type="critical">
|
||||
<Date>2014-03-16</Date>
|
||||
<Version>2.5</Version>
|
||||
<Comment>Workaround for update espeak package.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="19">
|
||||
<Date>2014-03-07</Date>
|
||||
<Version>2.5</Version>
|
||||
<Comment>Version bump.</Comment>
|
||||
<Name>Serdar Soytetir</Name>
|
||||
<Email>kaptan@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="18">
|
||||
<Date>2014-02-28</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Fix pisitools.dosed output.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="17">
|
||||
<Date>2014-02-13</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Workaround for the case where old dir /a/b/c is replaced by file c in /a/b dir.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="16">
|
||||
<Date>2013-11-12</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Fix stripping issues, in file info: LSB executable, LSB shared syntax.</Comment>
|
||||
<Name>Serdar Soytetir</Name>
|
||||
<Email>kaptan@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="15">
|
||||
<Date>2013-10-22</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Disable python_installation patch to check python upgrading breaks pisi or not.</Comment>
|
||||
<Name>Serdar Soytetir</Name>
|
||||
<Email>kaptan@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="14">
|
||||
<Date>2013-08-25</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Fix autocompletion for local uncompressed index file.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="13" type="security">
|
||||
<Date>2013-08-21</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Fix upgrading python package.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="12">
|
||||
<Date>2013-08-01</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Improve managing CFLAGS, CXXFLAGS and LDFLAGS,
|
||||
export HOME=get.workDIR() as default.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="11">
|
||||
<Date>2013-07-25</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Fix and improve kerneltools.
|
||||
Avoid double slashes pisi error.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="10">
|
||||
<Date>2013-07-11</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>adjust takeback to new dir structure.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="9">
|
||||
<Date>2013-06-21</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>No capital letters in directory names.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="8">
|
||||
<Date>2013-06-17</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Fix overwrite 64bit libs by 32bit for some packages</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="7">
|
||||
<Date>2013-06-02</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Add sorting packages for pisi ix</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="6">
|
||||
<Date>2013-05-15</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Add pisitools.flags() and pisitools.ldflags()</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="5">
|
||||
<Date>2013-05-12</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Sandbox.conf edit.</Comment>
|
||||
<Name>PisiLinux Community</Name>
|
||||
<Email>admins@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="4">
|
||||
<Date>2013-03-20</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Add patch for speed up packaging process</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="3">
|
||||
<Date>2013-03-14</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Improve dosed</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="2">
|
||||
<Date>2013-02-14</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>Add assign-devel-and-doc-packages.patch.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="1">
|
||||
<Date>2013-01-18</Date>
|
||||
<Version>2.4</Version>
|
||||
<Comment>First release.</Comment>
|
||||
<Name>Marcin Bojara</Name>
|
||||
<Email>marcin@pisilinux.org</Email>
|
||||
</Update>
|
||||
</History>
|
||||
</PISI>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" ?>
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>pisi</Name>
|
||||
<Summary xml:lang="tr">PİSİ PiSi Linux'un paket yönetim sistemidir</Summary>
|
||||
<Summary xml:lang="pl">PiSi – menadżer pakietów dla PiSi Linux.</Summary>
|
||||
<Description xml:lang="tr">PİSİ Python'da yazılmış modern bir paket yöneticisidir. Bazı ana özellikleri: Paket kaynakları XML ve python kullanılarak yazılır, bütün işlevleri kullanması kolay bir API ile sağlar ve düşük ve yüksek seviyeli paket yönetim işlevlerini birleştirir. </Description>
|
||||
<Description xml:lang="fr">PISI est gestionnaire de paquets moderne implémenté en Python.Ces principales fonctionnalités sont les suivantes : - Les paquets sources sont écrits en XML et en python - Implemente tout les fonctions à travers une API simple d'utilisation - Intègre aussi bien les fonctionnalités de bas niveaux que de haut niveau de gestion de paquets.</Description>
|
||||
<Description xml:lang="pl">PISI jest podstawowym narzędziem do instalacji, aktualizacji i usuwania pakietów. Obsługuje zależności dla poszczególnych pakietów, bibliotek i zadań ÇOMAR-a. Instalacja oprogramowania odbywa się w łatwy i przyjazny sposób. Do przechowywania informacji o pakietach wykorzystuje bazę Berkeley DP, co zapewnia większą stabilność i szybkość.</Description>
|
||||
</Source>
|
||||
</PISI>
|
||||
Reference in New Issue
Block a user