You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.6 KiB

  1. #!/bin/bash
  2. #
  3. # bash feeds/packages/lang/ruby/ruby_missingfiles staging_dir/target-i386_i486_musl-1.1.11/ bin/x86/packages/packages/*ruby*_2.3.0*
  4. #
  5. function list_staging_files {
  6. cd "$1"; find \
  7. \( \( -name "root-*" -or -name "packages" -or -name "stamp" -or -name "pkginfo" -or -name "host" -or -name man \) -prune \) -or -true \
  8. \( -path "*ruby*" -or -name "erb" -or -name "gem" -or -name "irb" -or -name "rake" -or -name "rdoc" -or -name "ri" -or -name "testrb" -or -name "racc" -or -name "racc2y" -or -name "y2racc" \) \
  9. -not -path "*/usr/lib/ruby/gems/*/cache/*" \
  10. -not -name "*test_case.rb" \
  11. -not -name "*.rdoc" \
  12. -not -name "*.doc" \
  13. -not -name "*.md" \
  14. -not -name "*.txt" \
  15. -not -name "*.travis.yml" \
  16. -not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/benchmark/.*" \
  17. -not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/evaluation/.*" \
  18. -not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/sample/.*" \
  19. -not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/test/.*" \
  20. -not -regex ".*/usr/lib/ruby/gems/[^/]*/gems/[^/]*/doc/.*" \
  21. -not -type d \
  22. -print | sort
  23. }
  24. function list_ipkg_files {
  25. for OPKG; do
  26. tar --to-stdout -xzf "$OPKG" ./data.tar.gz | tar tzv | grep -v ^d | sed -e 's,.* \./,./,;s/ -> .*//'
  27. done | sort -u | grep -v ./usr/lib/ruby/ruby...-bin
  28. }
  29. set -e
  30. : ${1:?First arg is staging_dir}
  31. : ${2:?Second and following args are ruby ipkg packages}
  32. STAGING_DIR=$1; shift
  33. (cd "$STAGING_DIR" )
  34. if ! [ -e "$1" ]; then
  35. echo "$1 does not exist!"
  36. exit 1
  37. fi
  38. printf '%-62s %-62s\n' "Installed in Staging" "From Packages Files"
  39. diff -d -y <(list_staging_files "$STAGING_DIR") <(list_ipkg_files "$@")