btrbk: 0.25.1 -> 0.26.0

This update fixes compatibility with recent btrfs-progs which are
already available in NixOS.
This commit is contained in:
Moritz Ulrich 2017-12-29 13:01:44 +01:00
parent e2fe111d46
commit 8a5f3ec6a8
No known key found for this signature in database
GPG Key ID: 45833CACBC407FA7
3 changed files with 10 additions and 76 deletions

View File

@ -1,39 +0,0 @@
From d5978c207f2b266165140dd21e9746ace5792daf Mon Sep 17 00:00:00 2001
From: Moritz Ulrich <moritz@tarn-vedra.de>
Date: Fri, 18 Mar 2016 14:01:22 +0100
Subject: [PATCH] btrbk: Prefix PATH instead of resetting it.
Some distros don't even install use /usr/bin, /sbin, etc. (notably
NixOS). Instead, they use PATH to specify which programs are available
to a given executable.
This patch changes the behavior or `btrbk` so it extends PATH with its
own search paths instead of resetting it. This allows users and distros
to specify their own custom location for `btrfs` via `PATH`.
---
btrbk | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/btrbk b/btrbk
index ab15858..0b91cbe 100755
--- a/btrbk
+++ b/btrbk
@@ -2464,10 +2464,11 @@ sub exit_status
MAIN:
{
- # set PATH instead of using absolute "/sbin/btrfs" (for now), as
- # different distros (and even different versions of btrfs-progs)
- # install the "btrfs" executable to different locations.
- $ENV{PATH} = '/sbin:/bin:/usr/sbin:/usr/bin';
+ # Prefix PATH with /sbin etc. instead of using absolute
+ # "/sbin/btrfs" (for now), as different distros (and even different
+ # versions of btrfs-progs) install the "btrfs" executable to
+ # different locations.
+ $ENV{PATH} .= '/sbin:/bin:/usr/sbin:/usr/bin';
Getopt::Long::Configure qw(gnu_getopt);
$Data::Dumper::Sortkeys = 1;
--
2.7.3

View File

@ -1,25 +0,0 @@
From 8abe8a915aa2d0c79c4dbe00dc7d255c32b7b85d Mon Sep 17 00:00:00 2001
From: Moritz Ulrich <moritz@tarn-vedra.de>
Date: Fri, 18 Mar 2016 13:20:48 +0100
Subject: [PATCH] btrbk-mail: Use `btrbk` instead of unbound variable `$btrbk`
---
contrib/cron/btrbk-mail | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/cron/btrbk-mail b/contrib/cron/btrbk-mail
index f7e4f12..9143f2d 100755
--- a/contrib/cron/btrbk-mail
+++ b/contrib/cron/btrbk-mail
@@ -113,7 +113,7 @@ case $exitcode in
;;
10) status="ERROR: At least one backup task aborted!"
;;
- *) status="ERROR: $btrbk failed with error code $exitcode"
+ *) status="ERROR: btrbk failed with error code $exitcode"
;;
esac
--
2.7.3

View File

@ -1,25 +1,23 @@
{ stdenv, fetchurl, coreutils, bash, btrfs-progs, openssh, perl, perlPackages, makeWrapper }: { stdenv, fetchurl, coreutils, bash, btrfs-progs, openssh, perl, perlPackages
, asciidoc-full, makeWrapper }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "btrbk-${version}"; name = "btrbk-${version}";
version = "0.25.1"; version = "0.26.0";
src = fetchurl { src = fetchurl {
url = "http://digint.ch/download/btrbk/releases/${name}.tar.xz"; url = "http://digint.ch/download/btrbk/releases/${name}.tar.xz";
sha256 = "02qc9vbd5l0ywnv01p60v9q3dcx2z92dfaf95qf7ccxqaa9zxfr5"; sha256 = "1brnh5x3fd91j3v8rz3van08m9i0ym4lv4hqz274s86v1kx4k330";
}; };
patches = [ buildInputs = with perlPackages; [ asciidoc-full makeWrapper perl DateCalc ];
# https://github.com/digint/btrbk/pull/74
./btrbk-Prefix-PATH-instead-of-resetting-it.patch
];
buildInputs = with perlPackages; [ makeWrapper perl DateCalc ];
preInstall = '' preInstall = ''
substituteInPlace Makefile \ for f in $(find . -name Makefile); do
--replace "/usr" "$out" \ substituteInPlace "$f" \
--replace "/etc" "$out/etc" --replace "/usr" "$out" \
--replace "/etc" "$out/etc"
done
# Tainted Mode disables PERL5LIB # Tainted Mode disables PERL5LIB
substituteInPlace btrbk --replace "perl -T" "perl" substituteInPlace btrbk --replace "perl -T" "perl"