From: Alexander Barton Date: Thu, 15 May 2014 08:44:06 +0000 (+0200) Subject: mksnapshot: Only try to install into /etc/apt/apt.conf.d if writable X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ax-linux.git;a=commitdiff_plain;h=81cdbb9890dc58405004824f52b5b1fbd95c3e08 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. --- 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' \