devscript: add new id and app sources

for list_apps_in_pkg and list_ids_in_pkg
This commit is contained in:
Roland Walker
2014-02-06 07:26:29 -05:00
parent a26dfafdcb
commit 08694bf813
2 changed files with 15 additions and 0 deletions
+8
View File
@@ -59,6 +59,13 @@ app_source_4 () {
'while (m{path\s*=\s*"([^"]+\.app)"}sg) { my $p = $1; $p =~ s{\A.*/}{}; print "$p\n" }';
}
app_source_5 () {
/usr/bin/find "$pkgdir" -name Archive.pax.gz -print0 | \
/usr/bin/xargs -0 -n1 -I{} sh -c \
"/usr/bin/gunzip -c '{}' | /bin/pax | /usr/bin/egrep '\.app'" | \
/usr/bin/perl -pe 's{\A.*/([^/]+\.app).*\Z}{$1}';
}
merge_sources () {
/usr/bin/sort | /usr/bin/uniq
}
@@ -138,6 +145,7 @@ _list_apps_in_pkg () {
app_source_3;
if [[ -n "$opt_lax" ]]; then
app_source_4;
app_source_5;
fi
} | \
merge_sources | \
+7
View File
@@ -27,6 +27,12 @@ bundle_id_source_1 () {
'while (m{<pkg-info.*?\sid(?:entifier)?\s*=\s*"([^"]*?)"}sg) { print "$1\n" }'
}
bundle_id_source_2 () {
/usr/bin/find "$pkgdir" -name Info.plist -print0 | \
/usr/bin/xargs -0 /usr/bin/perl -0777 -ne \
'while (m{<key>\s*CFBundleIdentifier\s*</key>\s*<string>([^<]+?)</string>}sg) { print "$1\n" }'
}
merge_sources () {
/usr/bin/sort | /usr/bin/uniq
}
@@ -60,6 +66,7 @@ _list_ids_in_pkg () {
{
# emit strings that look like bundle ids
bundle_id_source_1;
bundle_id_source_2;
} | \
merge_sources | \
clean_sources | \