summaryrefslogtreecommitdiffstats
path: root/lang/ruby/ruby_missingfiles
blob: 19a88e2b7a5b67fdae6b90390be32a4550e43e44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
#
# bash feeds/packages/lang/ruby/ruby_missingfiles staging_dir/target-x86_64_musl/ bin/packages/x86_64/packages/*ruby*_3.1.2*
#

function list_staging_files {
	cd "$1"; find \
		\( \( -name "root-*" -or -name "packages" -or -name "stamp" -or -name "pkginfo" -or -name "host" -or -name man \) -prune \) -or -true \
		\( \
			-path "*ruby*" -or \
			-name "bundle" -or \
			-name "bundler" -or \
			-name "erb" -or \
			-name "gem" -or \
			-name "irb" -or \
			-name "racc" -or \
			-name "racc2y" -or \
			-name "rake" -or \
			-name "rbs" -or \
			-name "rdbg" -or \
			-name "rdoc" -or \
			-name "ri" -or \
			-name "syntax_suggest" -or \
			-name "testrb" -or \
			-name "typeprof" -or \
			-name "y2racc" \
		\) \
		-not -path "*/usr/lib/ruby/gems/*/cache/*" \
		-not -name "*test_case.rb" \
		-not -name "*.rdoc" \
		-not -name "*.md" \
		-not -name "*.mk" \
		-not -name "*.doc" \
		\( -name "LICENSE.txt" -or -not -name "*.txt" \) \
		-not -name "*.travis.yml" \
		-not -name "Rakefile" \
		-not -path "*/ext/java/*" \
		-not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/benchmark/.*" \
		-not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/evaluation/.*" \
		-not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/sample/.*" \
		-not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/test/.*" \
		-not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/doc/.*" \
		-not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/fiddle[^/]*/ext/.*" \
		-not -type d \
		-print | sort | sed -e 's,^\./,/,'
}

function list_ipkg_files {
	for OPKG; do
		tar --to-stdout -xzf "$OPKG" ./data.tar.gz | tar tzv | grep -v ^d | sed -e 's,.* \./,./,;s/ -> .*//'
	done | sort -u | grep -v ./usr/lib/ruby/ruby...-bin
}

function list_apk_file {
	local pkg
	$HOST_STAGING_DIR/bin/apk adbdump --allow-untrusted "$@" |
	sed -e '/|$/{N;s/|\n *//}' |
	awk '/^  - name: / { dir=$3 } /^      - name:/ { printf "%s/%s\n", dir, $3}' |
	grep -v ^lib/apk/packages | sort -u | sed -e 's,^,/,' | grep -v /usr/lib/ruby/ruby...-bin

}



set -e
: ${1:?First arg is staging_dir}
: ${2:?Second and following args are ruby ipkg packages}
STAGING_DIR=$1; shift
HOST_STAGING_DIR=$STAGING_DIR/../host
(cd "$STAGING_DIR" )
if ! [ -e "$1" ]; then
	echo "$1 does not exist!"
	exit 1
fi
printf '%-62s %-62s\n' "Installed in Staging" "From Packages Files"
#diff -d -y <(list_staging_files "$STAGING_DIR") <(list_ipkg_files "$@") -W $COLUMNS
diff -d -y <(list_staging_files "$STAGING_DIR") <(list_apk_file "$@") -W $COLUMNS