mirror of
https://github.com/mroi/apple-internals.git
synced 2026-02-12 17:12:44 +00:00
db: store compressed database file
automatically decompress before using
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1 @@
|
||||
/internals-*.db
|
||||
/internals-*.db.lz
|
||||
|
||||
14
Makefile
14
Makefile
@@ -1,19 +1,29 @@
|
||||
MY_INTERNALS = $(HOME)/Library/Mobile\ Documents/com~apple~TextEdit/Documents/Apple\ Internals.rtf
|
||||
DB = internals-$(shell sw_vers -productVersion).db
|
||||
DB := $(if $(DB),$(DB:.lz=),internals-$(shell sw_vers -productVersion).db)
|
||||
DB_TARGETS = db_files
|
||||
|
||||
.PHONY: all $(DB_TARGETS)
|
||||
.INTERMEDIATE: $(DB)
|
||||
|
||||
all: internals.txt $(DB)
|
||||
all: internals.txt $(DB).lz
|
||||
|
||||
ifneq ($(wildcard $(MY_INTERNALS)),)
|
||||
internals.txt: $(MY_INTERNALS)
|
||||
textutil -cat txt "$<" -output $@
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard $(DB).lz),)
|
||||
$(DB): $(DB).lz
|
||||
compression_tool -decode -i $< -o $@
|
||||
else
|
||||
$(DB):
|
||||
@$(MAKE) --silent --jobs=1 $(DB_TARGETS) | sqlite3 -bail $@
|
||||
|
||||
$(DB).lz: $(DB)
|
||||
compression_tool -encode -i $< -o $@
|
||||
tmutil addexclusion $@
|
||||
endif
|
||||
|
||||
|
||||
# MARK: - data extraction helpers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user