[Lunar-commits] <lunar-iso> Create aaa_base.tar.bz2
Peter de Ridder
peter at lunar-linux.org
Thu Apr 11 00:32:20 CEST 2013
commit 24ddbc5840d578173d132fb9033586ff9b9d65e3
Author: Peter de Ridder <peter at lunar-linux.org>
Date: Mon, 08 Oct 2012 13:53:44 -0700
URL: https://github.com/lunar-linux/lunar-iso/commit/24ddbc5840d578173d132fb9033586ff9b9d65e3
Create aaa_base.tar.bz2
---
Makefile | +2/-1
mkfiles/pack.mk | +51/-0
2 files changed, 53 insertions(+), 1 deletion(-)
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ ISO_TARGET = $(ISO_SOURCE)/BUILD
export ISO_SOURCE ISO_TARGET ISO_BUILD
-all: stage2
+all: pack
.SUFFIXES:
@@ -41,6 +41,7 @@ include mkfiles/bootstrap.mk
include mkfiles/download.mk
include mkfiles/stage1.mk
include mkfiles/stage2.mk
+include mkfiles/pack.mk
clean:
rm -rf $(ISO_TARGET) $(ISO_SOURCE)/{spool,cache}
--- /dev/null
+++ b/mkfiles/pack.mk
@@ -0,0 +1,51 @@
+.INTERMEDIATE: pack pack-base
+
+pack: pack-base
+
+
+# Create listing of all potention installed files
+.INTERMEDIATE: $(ISO_TARGET)/.aaa_base.found
+$(ISO_TARGET)/.aaa_base.found: stage2
+ @echo pack-find
+ @find $(ISO_TARGET) ! -path '$(ISO_TARGET)/.*' -printf '/%P\n' \( \
+ -path '$(ISO_TARGET)/dev' -o \
+ -path '$(ISO_TARGET)/etc/lunar/local' -o \
+ -path '$(ISO_TARGET)/mnt' -o \
+ -path '$(ISO_TARGET)/proc' -o \
+ -path '$(ISO_TARGET)/root' -o \
+ -path '$(ISO_TARGET)/sys' -o \
+ -path '$(ISO_TARGET)/tmp' -o \
+ -path '$(ISO_TARGET)/usr/include' -o \
+ -path '$(ISO_TARGET)/usr/lib' -o \
+ -path '$(ISO_TARGET)/usr/libexec' -o \
+ -path '$(ISO_TARGET)/usr/share' -o \
+ -path '$(ISO_TARGET)/var/cache' -o \
+ -path '$(ISO_TARGET)/var/lib/lunar' -o \
+ -path '$(ISO_TARGET)/var/log' -o \
+ -path '$(ISO_TARGET)/var/spool' -o \
+ -path '$(ISO_TARGET)/var/state/lunar' \) -prune > $@
+
+# Create listing of all installed files
+.INTERMEDIATE: $(ISO_TARGET)/.aaa_base.tracked
+$(ISO_TARGET)/.aaa_base.tracked: stage2
+ @echo pack-tracked
+ @sort -u $(ISO_TARGET)/var/log/lunar/install/* > $@
+
+# Filter listing of all installed files
+.INTERMEDIATE: $(ISO_TARGET)/.aaa_base.filtered
+$(ISO_TARGET)/.aaa_base.filtered: $(ISO_TARGET)/.aaa_base.found $(ISO_TARGET)/.aaa_base.tracked
+ @echo pack-filtered
+ @sort $^ | uniq -d > $@
+
+# Diff listing of files
+.INTERMEDIATE: $(ISO_TARGET)/.aaa_base.list
+$(ISO_TARGET)/.aaa_base.list: $(ISO_TARGET)/.aaa_base.found $(ISO_TARGET)/.aaa_base.filtered
+ @echo pack-list
+ @sort $^ | uniq -u | sed 's:^/::' > $@
+
+# Create tar with not tracked files
+$(ISO_TARGET)/var/spool/lunar/aaa_base.tar.bz2: $(ISO_TARGET)/.aaa_base.list
+ @echo pack-base
+ @tar -cjf $@ -C $(ISO_TARGET) --no-recursion -T $<
+
+pack-base: $(ISO_TARGET)/var/spool/lunar/aaa_base.tar.bz2
More information about the Lunar-commits
mailing list