Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: From: Bas van Gompel Subject: What depends on less and what man depends on. Reply-To: cygwin mailing-list Organisation: Ehm... MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=====Cut=====" User-Agent: slrn/0.9.8.1 (Win32) Hamster/2.0.6.0 Korrnews/4.2 To: cygwin AT cygwin DOT com Lines: 100 Date: Sun, 5 Dec 2004 08:13:34 +0100 (MET) X-IsSubscribed: yes --=====Cut===== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8Bit No, I'm not getting filosofical here. ;) Hallo all, Sometimes one wants to know what depends on a package or vice versa. To find out, using the local setup.inis, I wrote following script. It uses make to recursively find and display all dependencies in either direction. To find out what needs less: cyg-deps less To find out what man needs: cyg-deps -r man Insert a '-v' after the script's name to see any messages from make. (e.g. about circular dependencies.) This script requires /bin/sh, cat, sed, cygpath, (g)awk, make, a package-dir left by setup, /etc/setup/last-mirror and /etc/setup/last-cache. I hope anyone likes and/or can find a use for it. L8r, Buzz. -- ) | | ---/ ---/ Yes, this | This message consists of true | I do not -- | | / / really is | and false bits entirely. | mail for ) | | / / a 72 by 4 +-------------------------------+ any1 but -- \--| /--- /--- .sigfile. | |perl -pe "s.u(z)\1.as." | me. 4^re --=====Cut===== Content-Type: text/plain; name="cyg-deps" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="cyg-deps" #!/bin/sh # Copyright (C) Bas van Gompel 2004. # All rights reserved. No warranties. # This software may not be used for aggressive purposes. RCS_ID='$Id: cyg-deps,v 1.6 2004/12/05 06:54:56 Buzz Exp Buzz $' this_one='p' op=' ": " ' the_others='gensub (/^requires: /, "", 1)' relation="${the_others}${op}${this_one}" exec 6>/dev/null while test "$1"x = "-v"x -o "$1"x = "-r"x; do if test "$1"x = "-v"x; then exec 6>&2 shift fi if test "$1"x = "-r"x; then relation="${this_one}${op}${the_others}" shift fi done if test -f /etc/setup/last-mirror; then for f in $(cat /etc/setup/last-mirror); do cache_file="$(cygpath -u $(cat /etc/setup/last-cache))/$(\ echo "$f"|sed 's,:,%3a,g;s,/,%2f,g')/setup.ini" if test -f "$cache_file"; then awk -f - ${cache_file} <<-EOA \ |make -f - "$@" 2>&6 BEGIN {print "all:"} /^@/ {ib=1;p=\$2;l=l " " p;next} /^requires: / { print ${relation} print p ":" print " @echo " p } END {print ".PHONY: all" l} EOA break fi echo "$0: Can not read cache-file ${cache_file}" >&2 done else echo "$0: Can not read mirror-file /etc/setup/last-mirror" >&2 fi --=====Cut===== Content-Type: text/plain; charset=us-ascii -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ --=====Cut=====--