From 81cdbb9890dc58405004824f52b5b1fbd95c3e08 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Thu, 15 May 2014 10:44:06 +0200 Subject: [PATCH] mksnapshot: Only try to install into /etc/apt/apt.conf.d if writable Use $(PREFIX)/etc/apt/apt.conf.d when /etc/apt/apt.conf.d isn't writable. --- btrfs/mksnapshot/Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/btrfs/mksnapshot/Makefile b/btrfs/mksnapshot/Makefile index f56c7fe..49e0cf2 100644 --- a/btrfs/mksnapshot/Makefile +++ b/btrfs/mksnapshot/Makefile @@ -1,6 +1,6 @@ # # ax-linux: Alex' Linux Tools & Scripts -# Copyright (c)2013 Alexander Barton (alex@barton.de) +# Copyright (c)2013-2014 Alexander Barton (alex@barton.de) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,10 +22,15 @@ install-local: $(ALL) $(DESTDIR)$(PREFIX)/sbin/btrfs-mksnapshot install -p -o $(USER) -g $(GROUP) -m 755 btrfs-mksnapshot-rootfs \ $(DESTDIR)$(PREFIX)/sbin/btrfs-mksnapshot-rootfs + test -w /etc/apt/apt.conf.d \ + && make PREFIX= install-local-apt \ + || make PREFIX=$(PREFIX) install-local-apt + +install-local-apt: install -d -o $(USER) -g $(GROUP) -m 755 \ - $(DESTDIR)/etc/apt/apt.conf.d + $(DESTDIR)$(PREFIX)/etc/apt/apt.conf.d install -p -o $(USER) -g $(GROUP) -m 644 06btrfs-mksnapshot \ - $(DESTDIR)/etc/apt/apt.conf.d/06btrfs-mksnapshot + $(DESTDIR)$(PREFIX)/etc/apt/apt.conf.d/06btrfs-mksnapshot 06btrfs-mksnapshot: 06btrfs-mksnapshot.tmpl cat 06btrfs-mksnapshot.tmpl | sed -e 's@:PREFIX:@$(PREFIX)@g' \ -- 2.39.2