atomicoperations.py:24: Imported module (pisi.packagedb) not used
atomicoperations.py:25: Imported module (pisi.dependency) not used atomicoperations.py:151: Local variable (com) not used atomicoperations.py:167: (file) shadows builtin atomicoperations.py:280: (file) shadows builtin atomicoperations.py:360: (file) shadows builtin atomicoperations.py:363: (file) shadows builtin atomicoperations.py:513: Local variable (e) not used
This commit is contained in:
+14
-17
@@ -15,15 +15,12 @@ import gettext
|
|||||||
__trans = gettext.translation('pisi', fallback=True)
|
__trans = gettext.translation('pisi', fallback=True)
|
||||||
_ = __trans.ugettext
|
_ = __trans.ugettext
|
||||||
|
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
import bsddb3.db as db
|
import bsddb3.db as db
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
import pisi
|
import pisi
|
||||||
import pisi.context as ctx
|
import pisi.context as ctx
|
||||||
import pisi.packagedb as packagedb
|
|
||||||
import pisi.dependency as dependency
|
|
||||||
import pisi.conflict
|
import pisi.conflict
|
||||||
import pisi.util as util
|
import pisi.util as util
|
||||||
import pisi.metadata
|
import pisi.metadata
|
||||||
@@ -149,7 +146,7 @@ class Install(AtomicOperation):
|
|||||||
# check comar
|
# check comar
|
||||||
if self.metadata.package.providesComar and ctx.comar:
|
if self.metadata.package.providesComar and ctx.comar:
|
||||||
import pisi.comariface as comariface
|
import pisi.comariface as comariface
|
||||||
com = comariface.get_comar()
|
comariface.get_comar()
|
||||||
|
|
||||||
def check_relations(self):
|
def check_relations(self):
|
||||||
# check dependencies
|
# check dependencies
|
||||||
@@ -165,10 +162,10 @@ class Install(AtomicOperation):
|
|||||||
|
|
||||||
# check file conflicts
|
# check file conflicts
|
||||||
file_conflicts = []
|
file_conflicts = []
|
||||||
for file in self.files.list:
|
for f in self.files.list:
|
||||||
if ctx.filesdb.has_file(file.path):
|
if ctx.filesdb.has_file(f.path):
|
||||||
pkg, existing_file = ctx.filesdb.get_file(file.path)
|
pkg, existing_file = ctx.filesdb.get_file(f.path)
|
||||||
dst = pisi.util.join_path(ctx.config.dest_dir(), file.path)
|
dst = pisi.util.join_path(ctx.config.dest_dir(), f.path)
|
||||||
if pkg != self.pkginfo.name and not os.path.isdir(dst):
|
if pkg != self.pkginfo.name and not os.path.isdir(dst):
|
||||||
file_conflicts.append( (pkg, existing_file) )
|
file_conflicts.append( (pkg, existing_file) )
|
||||||
if file_conflicts:
|
if file_conflicts:
|
||||||
@@ -278,8 +275,8 @@ class Install(AtomicOperation):
|
|||||||
fpath = pisi.util.join_path(ctx.config.dest_dir(), config.path)
|
fpath = pisi.util.join_path(ctx.config.dest_dir(), config.path)
|
||||||
if os.path.exists(fpath) and not os.path.isdir(fpath):
|
if os.path.exists(fpath) and not os.path.isdir(fpath):
|
||||||
if os.path.islink(fpath):
|
if os.path.islink(fpath):
|
||||||
file = os.readlink(fpath)
|
f = os.readlink(fpath)
|
||||||
if os.path.exists(file) and pisi.util.sha1_data(file) != config.hash:
|
if os.path.exists(f) and pisi.util.sha1_data(f) != config.hash:
|
||||||
changed = True
|
changed = True
|
||||||
else:
|
else:
|
||||||
if pisi.util.sha1_file(fpath) != config.hash:
|
if pisi.util.sha1_file(fpath) != config.hash:
|
||||||
@@ -358,13 +355,13 @@ class Install(AtomicOperation):
|
|||||||
config_overlaps = newconfig & oldconfig
|
config_overlaps = newconfig & oldconfig
|
||||||
if config_overlaps:
|
if config_overlaps:
|
||||||
files = filter(lambda x: x.path in config_overlaps, old)
|
files = filter(lambda x: x.path in config_overlaps, old)
|
||||||
for file in files:
|
for f in files:
|
||||||
check_config_changed(file)
|
check_config_changed(f)
|
||||||
else:
|
else:
|
||||||
for file in self.files.list:
|
for f in self.files.list:
|
||||||
if file.type == 'config':
|
if f.type == 'config':
|
||||||
# there may be left over config files
|
# there may be left over config files
|
||||||
check_config_changed(file)
|
check_config_changed(f)
|
||||||
|
|
||||||
if self.package_fname.endswith(ctx.const.delta_package_suffix):
|
if self.package_fname.endswith(ctx.const.delta_package_suffix):
|
||||||
relocate_files()
|
relocate_files()
|
||||||
@@ -511,7 +508,7 @@ class Remove(AtomicOperation):
|
|||||||
try:
|
try:
|
||||||
if pisi.util.sha1_file(fpath) == fileinfo.hash:
|
if pisi.util.sha1_file(fpath) == fileinfo.hash:
|
||||||
os.unlink(fpath)
|
os.unlink(fpath)
|
||||||
except pisi.util.FileError, e:
|
except pisi.util.FileError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if os.path.isfile(fpath) or os.path.islink(fpath):
|
if os.path.isfile(fpath) or os.path.islink(fpath):
|
||||||
@@ -543,7 +540,7 @@ class Remove(AtomicOperation):
|
|||||||
def remove_db(self, txn):
|
def remove_db(self, txn):
|
||||||
ctx.installdb.remove(self.package_name, txn)
|
ctx.installdb.remove(self.package_name, txn)
|
||||||
ctx.filesdb.remove_files(self.files, txn)
|
ctx.filesdb.remove_files(self.files, txn)
|
||||||
pisi.packagedb.remove_tracking_package(self.package_name, txn)
|
ctx.packagedb.remove_tracking_package(self.package_name, txn)
|
||||||
|
|
||||||
|
|
||||||
def remove_single(package_name):
|
def remove_single(package_name):
|
||||||
|
|||||||
Reference in New Issue
Block a user