else
PYTHON_DIR = $(LIBDIR)/python$(PYTHON_VERSION)/site-packages
endif
+PYTHON_FILES = $(addsuffix /*.py,$(addprefix python/,$(PYTHON_MODULES)))
+PYTHON_FILES += tools/pakfire-multicall.py
# The place, where all internally used scripts and bins are copied.
SCRIPT_DIR = $(PREFIX)/lib/$(PACKAGE_NAME)
# A list of all files that contain translations and need to
# be indexed.
-TRANS_FILES = $(addsuffix /*.py,$(addprefix python/,$(PYTHON_MODULES)))
-TRANS_FILES += python/src/*.c tools/pakfire-multicall.py
+TRANS_FILES = $(PYTHON_FILES) python/src/*.c
done
.PHONY: check
-check:
- ./runpychecker.sh
+check: all
+ PYTHONPATH=python/src/ pylint -E python/pakfire
.PHONY: po
po:
# Check if the download checksum matches (if provided).
if self.build_source_hash512:
- h = hashlib.sha512()
+ h = hashlib.new("sha512")
f = open(tmpfile, "rb")
while True:
buf = f.read(BUFFER_SIZE)
+++ /dev/null
-#!/usr/bin/python
-
-import random
-import sys
-import time
-
-def fork_builder(*args, **kwargs):
- cb = ClientBuilder(*args, **kwargs)
-
- try:
- cb()
- except Exception, e:
- print e
- sys.exit(1)
-
-class ClientBuilder(object):
- def __init__(self, id):
- self.id = id
-
- def __call__(self, *args):
- print "Running", self.id, args
-
- time.sleep(2)
-
- if random.choice((False, False, False, True)):
- raise Exception, "Process died"
-
-
-import multiprocessing
-
-
-processes = []
-
-while True:
- # Check if there are at least 2 processes running.
- if len(processes) < 2:
- process = multiprocessing.Process(target=fork_builder, args=(len(processes),))
-
- process.daemon = True
- process.start()
-
- processes.append(process)
-
- print len(processes), "in process list:", processes
-
- for process in processes:
- time.sleep(0.5)
-
- print process.name, "is alive?", process.is_alive()
-
- if not process.is_alive():
- print "Removing process", process
- print " Exitcode:", process.exitcode
- processes.remove(process)
This class is a wrapper that reads package data from the (outer)
tarball and should never be used solely.
"""
+ _type = None
+
def __init__(self, pakfire, repo, filename):
base.Package.__init__(self, pakfire, repo)
self.filename = os.path.abspath(filename)
payload_archive = tar.InnerTarFile.open(fileobj=payload)
else:
- raise Exception, "Unhandled payload compression type: %s" % payload_compression
+ raise Exception, "Unhandled payload compression type: %s" % \
+ self.payload_compression
return payload_archive
continue
# Calc hash of the current configuration file.
- config_hash1 = hashlib.sha512()
+ config_hash1 = hashlib.new("sha512")
f = open(target)
while True:
buf = f.read(BUFFER_SIZE)
# Calculating the hash sum of the added file
# and store it in the chksums file.
f = open(filename)
- h = hashlib.sha512()
+ h = hashlib.new("sha512")
while True:
buf = f.read(BUFFER_SIZE)
if not buf:
# Calculate SHA512 hash of regular files.
if m.isreg():
mobj = datafile.extractfile(m)
- h = hashlib.sha512()
+ h = hashlib.new("sha512")
while True:
buf = mobj.read(BUFFER_SIZE)
return vendor
- @property
- def uuid(self):
- return self.solvable.get_uuid()
-
@property
def build_host(self):
return self.solvable.get_buildhost()
@property
def path(self):
- h = hashlib.sha1(self.url)
+ h = hashlib.new("sha1")
+ h.update(self.url)
# XXX path is to be changed
return "/var/cache/pakfire/sources/%s" % h.hexdigest()
return "%sB/s" % format_size(s)
def calc_hash1(filename=None, data=None):
- h = hashlib.sha1()
+ h = hashlib.new("sha1")
if filename:
f = open(filename)
+++ /dev/null
-#!/bin/bash
-
-pychecker --only --limit 1000 \
- --maxlines 500 --maxargs 20 --maxbranches 80 --maxlocals 60 --maxreturns 20 \
- --no-callinit --no-local --no-shadow --no-shadowbuiltin \
- --no-import --no-miximport --no-pkgimport --no-reimport \
- --no-argsused --no-varargsused --no-override \
- $(find pakfire -name "*.py" )