check-plist 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/sh
  2. # $OpenBSD: check-plist,v 1.9 2011/11/28 12:59:50 sthen Exp $
  3. # Copyright (c) 2001
  4. # Marc Espie. All rights reserved.
  5. # Redistribution and use in source and binary forms, with or without
  6. # modification, are permitted provided that the following conditions
  7. # are met:
  8. # 1. Redistributions of code must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. # 2. Neither the name of OpenBSD nor the names of its contributors
  11. # may be used to endorse or promote products derived from this software
  12. # without specific prior written permission.
  13. #
  14. # THIS SOFTWARE IS PROVIDED BY ITS AUTHOR AND THE OpenBSD project ``AS IS'' AND
  15. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  16. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  17. # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  18. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  19. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  20. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  21. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  22. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  23. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  24. # SUCH DAMAGE.
  25. # starting from an initial list, check package dependencies, and build
  26. # derived updated lists.
  27. # list.depends: all package dependencies
  28. # list.dirs: corresponding extended directories
  29. # list.pkgs: corresponding package names
  30. if [ $# -ne 1 ]; then
  31. echo "This script takes exactly one parameter"
  32. exit 1
  33. fi
  34. initial=$1
  35. case "$initial" in
  36. /*);;
  37. *)initial=`pwd`"/$initial";;
  38. esac
  39. depends="$initial.depends"
  40. list="$initial.dirs"
  41. packages="$initial.pkgs"
  42. trimmed="$initial.trimmed"
  43. : ${PORTSDIR:=/usr/ports}
  44. cd ${PORTSDIR}
  45. make ECHO_MSG='echo >&2' SUBDIRLIST=$initial show=FULLPKGPATH >$trimmed
  46. echo databases/pkglocatedb >>$trimmed
  47. echo devel/quirks >>$trimmed
  48. make ECHO_MSG='echo >&2' SUBDIRLIST=$trimmed run-dir-depends >$depends
  49. tsort -h $trimmed -r $depends >$list
  50. make ECHO_MSG='echo >&2' show='FULLPKGNAME${SUBPACKAGE}' SUBDIRLIST=$list|perl -ne 'print unless $h{$_}++'|sed -e 's,$,.tgz,' >$packages
  51. echo "Packages with distribution problems:"
  52. echo "------------------------------------"
  53. make ECHO_MSG='echo -n' show=PERMIT_PACKAGE_CDROM SUBDIRLIST=$list|\
  54. grep -v -i 'Yes$'