This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 3.x development tree".
The branch, master has been updated via e454a6a0e72518a97856e63bfee0911ba9b2cd4e (commit) via 9e679849fbe1c235708537136cc30ac6b2657c82 (commit) via 436e7298b437bae9c53727097d65ce8bbbcc59f7 (commit) via 455e7df44e612a50b2f206556f1cda0d8820d76b (commit) from 0fc51f58c2b78d10ed4550001fde20cae7ce6a22 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit e454a6a0e72518a97856e63bfee0911ba9b2cd4e Merge: 0fc51f58c2b78d10ed4550001fde20cae7ce6a22 9e679849fbe1c235708537136cc30ac6b2657c82 Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Mar 19 22:16:28 2010 +0100
Merge branch 'naoki'
commit 9e679849fbe1c235708537136cc30ac6b2657c82 Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Mar 19 22:15:57 2010 +0100
naoki: Replaced package parsing functions.
commit 436e7298b437bae9c53727097d65ce8bbbcc59f7 Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Mar 19 20:28:20 2010 +0100
naoki: Create directories of package loggings.
commit 455e7df44e612a50b2f206556f1cda0d8820d76b Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Mar 19 19:38:39 2010 +0100
naoki: Fix download of files with special characters.
-----------------------------------------------------------------------
Summary of changes: naoki/__init__.py | 30 +++++++------------------- naoki/backend.py | 61 ++++++++++++++++++++++++++++++++++++---------------- naoki/logger.py | 11 +++++++-- 3 files changed, 58 insertions(+), 44 deletions(-)
Difference in files: diff --git a/naoki/__init__.py b/naoki/__init__.py index 80d0de5..1ea09fa 100644 --- a/naoki/__init__.py +++ b/naoki/__init__.py @@ -72,10 +72,7 @@ class Naoki(object): else: package_names = args.packages
- packages = [] - for package in package_names: - package = backend.Package(package, naoki=self) - packages.append(package) + packages = backend.parse_package(package_names, naoki=self)
if len(packages) >= 2: packages_sorted = backend.depsort(packages) @@ -110,10 +107,7 @@ class Naoki(object): return actionmap[args.action.name](args.action)
def call_package_info(self, args): - packages = args.packages or backend.get_package_names() - - for package in packages: - package = backend.PackageInfo(package) + for package in backend.parse_package_info(args.packages): if args.long: print package.fmtstr("""\ -------------------------------------------------------------------------------- @@ -145,8 +139,7 @@ Release : %(release)s """)
def call_package_list(self, args): - for package in self.package_names: - package = backend.PackageInfo(package) + for package in backend.parse_package_info(backend.get_package_names()): if args.long: print package.fmtstr("%(name)-32s | %(version)-15s | %(summary)s") else: @@ -161,8 +154,7 @@ Release : %(release)s print "====== All available groups of packages ======" for group in groups: print "===== %s =====" % group - for package in backend.get_package_names(): - package = backend.PackageInfo(package) + for package in backend.parse_package_info(backend.get_package_names()): if not package.group == group: continue
@@ -185,10 +177,8 @@ Release : %(release)s return actionmap[args.action.name](args.action)
def call_source_download(self, args): - packages = args.packages or backend.get_package_names() - - for package in packages: - package = backend.Package(package, naoki=self) + for package in backend.parse_package(args.packages or \ + backend.get_package_names(), naoki=self): package.download()
def call_source_upload(self, args): @@ -197,8 +187,8 @@ Release : %(release)s def call_source_clean(self, args): self.log.info("Remove all unused files") files = os.listdir(TARBALLDIR) - for package in backend.get_package_names(): - for object in backend.PackageInfo(package).objects: + for package in backend.parse_package_info(backend.get_package_names()): + for object in package.objects: if object in files: files.remove(object)
@@ -234,7 +224,3 @@ Release : %(release)s
self.log.info("Building %s..." % build.package.name) build.build() - - @property - def package_names(self): - return backend.get_package_names() diff --git a/naoki/backend.py b/naoki/backend.py index b5339b8..2764d44 100644 --- a/naoki/backend.py +++ b/naoki/backend.py @@ -14,6 +14,34 @@ __cache = { "group_names" : None, }
+def find_package_info(name, toolchain=False): + for repo in get_repositories(toolchain): + if not os.path.exists(os.path.join(repo.path, name, name + ".nm")): + continue + + return PackageInfo(name, repo=repo) + +def find_package(name, toolchain=False): + package = find_package_info(name, toolchain) + if package: + package = backend.Package(package) + + return package + +def parse_package_info(names, toolchain=False): + packages = [] + for name in names: + package = find_package_info(name, toolchain) + if package: + packages.append(package) + + return packages + +def parse_package(names, toolchain=False, naoki=None): + packages = parse_package_info(names, toolchain) + + return [Package(package.name, naoki=naoki) for package in packages] + def get_package_names(toolchain=False): if not __cache["package_names"]: names = [] @@ -27,8 +55,7 @@ def get_package_names(toolchain=False): def get_group_names(): if not __cache["group_names"]: groups = [] - for package in get_package_names(): - package = PackageInfo(package) + for package in parse_package_info(get_package_names()): if not package.group in groups: groups.append(package.group) @@ -109,7 +136,7 @@ def download(files, logger=None): if os.path.exists(filepath): continue
- url = config["sources_download_url"] + "/%s" % urllib.pathname2url(file) + url = config["sources_download_url"] + "/" + file
if logger: logger.debug("Retrieving %s" % url) @@ -117,6 +144,7 @@ def download(files, logger=None): g = urlgrabber.grabber.URLGrabber( user_agent = "%sSourceGrabber/%s" % (config["distro_name"], config["distro_version"],), progress_obj = urlgrabber.progress.TextMeter(), + quote=0, )
try: @@ -135,8 +163,9 @@ def download(files, logger=None): class PackageInfo(object): __data = {}
- def __init__(self, name): + def __init__(self, name, repo=None): self._name = name + self.repo = repo
def __repr__(self): return "<PackageInfo %s>" % self.name @@ -157,7 +186,7 @@ class PackageInfo(object): env.update(config.environment) env["PKGROOT"] = PKGSDIR output = util.do("make -f %s" % self.filename, shell=True, - cwd=os.path.join(PKGSDIR, self.name), returnOutput=1, env=env) + cwd=os.path.join(PKGSDIR, self.repo.name, self.name), returnOutput=1, env=env)
ret = {} for line in output.splitlines(): @@ -196,12 +225,7 @@ class PackageInfo(object): def _dependencies(self, s, recursive=False): c = s + "_CACHE" if not self._data.has_key(c): - deps = [] - for name in self._data.get(s).split(" "): - name = find_package_name(name) - if name: - deps.append(Dependency(name)) - + deps = parse_package_info(self._data.get(s).split(" ")) self._data.update({c : depsolve(deps, recursive)})
return self._data.get(c) @@ -224,7 +248,8 @@ class PackageInfo(object):
@property def filename(self): - return os.path.join(PKGSDIR, self.name, os.path.basename(self.name)) + ".nm" + return os.path.join(PKGSDIR, self.repo.name, self.name, + os.path.basename(self.name)) + ".nm"
@property def fingerprint(self): @@ -275,18 +300,16 @@ class PackageInfo(object): return self._data.get("PKG_VER")
-class Dependency(PackageInfo): - def __repr__(self): - return "<Dependency %s>" % self.name - - class Package(object): def __init__(self, name, naoki): - self.info = PackageInfo(name) + self.info = find_package_info(name) self.naoki = naoki
#self.log.debug("Initialized package object %s" % name)
+ def __repr__(self): + return "<Package %s>" % self.info.name + def build(self): environment = chroot.Environment(self) environment.build() @@ -332,7 +355,7 @@ class Repository(object): def packages(self): packages = [] for package in os.listdir(self.path): - package = PackageInfo(os.path.join(self.name, package)) + package = PackageInfo(package, repo=self) packages.append(package)
return packages diff --git a/naoki/logger.py b/naoki/logger.py index 322919d..1153ef1 100644 --- a/naoki/logger.py +++ b/naoki/logger.py @@ -64,9 +64,14 @@ class Logging(object): logger.parent = self.log logger.propagate = 1
- handler = logging.handlers.RotatingFileHandler( - os.path.join(LOGDIR, logger.name + ".log"), maxBytes=10*1024**2, - backupCount=5) + logfile = os.path.join(LOGDIR, logger.name + ".log") + logdir = os.path.dirname(logfile) + + if not os.path.exists(logdir): + os.makedirs(logdir) + + handler = logging.handlers.RotatingFileHandler(logfile, + maxBytes=10*1024**2, backupCount=5)
formatter = logging.Formatter("[BUILD] %(message)s") handler.setFormatter(formatter)
hooks/post-receive -- IPFire 3.x development tree