#!/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