mirror of
https://github.com/mroi/apple-internals.git
synced 2026-08-24 12:12:32 +02:00
db: collect contents of asset catalogs
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
MY_INTERNALS = $(HOME)/Library/Mobile\ Documents/com~apple~TextEdit/Documents/Apple\ Internals.rtf
|
MY_INTERNALS = $(HOME)/Library/Mobile\ Documents/com~apple~TextEdit/Documents/Apple\ Internals.rtf
|
||||||
DB := $(if $(DB),$(DB:.lz=),internals-$(shell sw_vers -productVersion).db)
|
DB := $(if $(DB),$(DB:.lz=),internals-$(shell sw_vers -productVersion).db)
|
||||||
DB_TARGETS = db_files db_binaries
|
DB_TARGETS = db_files db_binaries db_assets
|
||||||
CHECK_TARGETS = check_files check_binaries
|
CHECK_TARGETS = check_files check_binaries
|
||||||
|
|
||||||
.PHONY: all check $(DB_TARGETS) $(CHECK_TARGETS)
|
.PHONY: all check $(DB_TARGETS) $(CHECK_TARGETS)
|
||||||
@@ -34,6 +34,9 @@ check: internals.txt
|
|||||||
# MARK: - data extraction helpers
|
# MARK: - data extraction helpers
|
||||||
|
|
||||||
NIX = $(shell nix-build --no-out-link -A nixFlakes '<nixpkgs>')/bin/nix
|
NIX = $(shell nix-build --no-out-link -A nixFlakes '<nixpkgs>')/bin/nix
|
||||||
|
ACEXTRACT = $(shell \
|
||||||
|
$(NIX) --experimental-features 'nix-command flakes' build --no-write-lock-file .\#acextract && \
|
||||||
|
readlink result && rm result)/bin/acextract
|
||||||
DSCU = $(shell \
|
DSCU = $(shell \
|
||||||
$(NIX) --experimental-features 'nix-command flakes' build --no-write-lock-file .\#dyld-shared-cache && \
|
$(NIX) --experimental-features 'nix-command flakes' build --no-write-lock-file .\#dyld-shared-cache && \
|
||||||
readlink result && rm result)/bin/dyld_shared_cache_util
|
readlink result && rm result)/bin/dyld_shared_cache_util
|
||||||
@@ -102,6 +105,15 @@ db_binaries:: dyld
|
|||||||
fi ; \
|
fi ; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
db_assets::
|
||||||
|
printf '\033[1mcollecting asset catalog information...\033[m\n' >&2
|
||||||
|
echo 'DROP TABLE IF EXISTS assets;'
|
||||||
|
echo 'CREATE TABLE assets (id INTEGER REFERENCES files, name TEXT);'
|
||||||
|
$(call find,-type f -name '*.car') | while read -r os path ; do \
|
||||||
|
test -r "$(call prefix,$$os)$$path" && $(ACEXTRACT) --list --input "$(call prefix,$$os)$$path" | \
|
||||||
|
sed "1d;s/'/''/g;s|.*|INSERT INTO assets $(call file,'&');|" ; \
|
||||||
|
done
|
||||||
|
|
||||||
$(DB_TARGETS)::
|
$(DB_TARGETS)::
|
||||||
echo 'COMMIT TRANSACTION;'
|
echo 'COMMIT TRANSACTION;'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user