mirror of the now-defunct rocklinux.org
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.

38 lines
960 B

  1. --- ./rocket.sh
  2. +++ ./rocket.sh
  3. @@ -20,6 +20,7 @@
  4. rocket remove <pkg> ........ remove package
  5. rocket search <regex> ...... search packge descriptions for this regex
  6. +rocket fsearch <regex> ..... search packge file list for this regex
  7. rocket list <regex> ........ list all packages with a name matching the regex
  8. rocket info <pkg> .......... print package details
  9. @@ -148,6 +149,27 @@
  10. fi
  11. ;;
  12. + fsearch)
  13. + matches=0;
  14. + if [ "${2#^}" != "$2" ]; then
  15. + regex="^[^ ]+ [^ ]+ ${2#^}"
  16. + else
  17. + regex="^[^ ]+ [^ ]+ .*$2"
  18. + fi
  19. + while read f; do
  20. + echo
  21. + if [ -f "/var/adm/packages/${f##*/}" ]; then
  22. + echo "Match #$((matches++)) ${f##*/} (installed):"
  23. + else
  24. + echo "Match #$((matches++)) ${f##*/} (not installed):"
  25. + fi
  26. + egrep -i "$regex" $f | cut -f3- -d' '
  27. + done < <( egrep -lir "$regex" /var/adm/rocket/cksums | sort; )
  28. + if [ $matches -gt 0 ]; then
  29. + echo
  30. + fi
  31. + ;;
  32. +
  33. list)
  34. while read p; do
  35. if [ -f "/var/adm/packages/$p" ]