From 4b58035e0e63b8cdb7aa6e2dbb9c98a51dc40ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 16 Aug 2018 23:44:16 +0100 Subject: [PATCH 1/2] add contact information --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b6fa1832f..77adb5517 100644 --- a/README.md +++ b/README.md @@ -350,7 +350,6 @@ with pkgs.lib; } ``` - ## Contribution guideline - When adding packages to your repository make sure they build and set @@ -381,6 +380,11 @@ override existing packages. Also without coordination multiple overlays could easily introduce dependency cycles. +## Contact + +You can chat with us on IRC in channel [#nixos-nur](https://webchat.freenode.net/?url=irc%3A%2F%2Firc.freenode.net%2Fnixos-nur). +Apart from that we also read posts on [https://discourse.nixos.org](https://discourse.nixos.org/). + ## Roadmap - Implement a search to find packages From fb3c4fc80ab80d7c066746b0656f571f0cb46840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 17 Aug 2018 00:19:20 +0100 Subject: [PATCH 2/2] nur combine: delete old content before copying new --- nur/combine.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/nur/combine.py b/nur/combine.py index a9e9e5e74..d48bd2d80 100644 --- a/nur/combine.py +++ b/nur/combine.py @@ -2,6 +2,7 @@ import logging import os import shutil import subprocess +from tempfile import TemporaryDirectory from argparse import Namespace from distutils.dir_util import copy_tree from pathlib import Path @@ -44,12 +45,22 @@ def commit_files(files: List[str], message: str) -> None: def commit_repo(repo: Repo, message: str, path: Path) -> Repo: - repo_path = str(path.joinpath(repo.name).resolve()) + repo_path = path.joinpath(repo.name).resolve() - copy_tree(repo_source(repo.name), repo_path) + tmp: Optional[TemporaryDirectory] = TemporaryDirectory(prefix=str(repo_path.parent)) + assert tmp is not None + + try: + copy_tree(repo_source(repo.name), tmp.name) + shutil.rmtree(repo_path, ignore_errors=True) + os.rename(tmp.name, repo_path) + tmp = None + finally: + if tmp is not None: + tmp.cleanup() with chdir(str(path)): - commit_files([repo_path], message) + commit_files([str(repo_path)], message) return repo