cookutils rev 1040
modules/deps: provide `cook <pkg> --deps --quiet` quiet mode; cooker: provide `cooker autodeps`
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Mar 22 05:14:32 2018 +0200 (2018-03-22) |
parents | 5a63ab7642f2 |
children | 9ea2c08af3ef |
files | cooker modules/deps |
line diff
1.1 --- a/cooker Wed Mar 21 14:05:08 2018 +0200 1.2 +++ b/cooker Thu Mar 22 05:14:32 2018 +0200 1.3 @@ -45,6 +45,7 @@ 1.4 -T | tasks List existing cooker tasks. 1.5 -t | task <task> Executing specified task. 1.6 -o | outgoing Find changes in wok that we can move to wok-hg. 1.7 + autodeps Find dependencies for all packages in wok. 1.8 1.9 EOT 1.10 exit 0 1.11 @@ -581,6 +582,14 @@ 1.12 compare_wok 1.13 ;; 1.14 1.15 + autodeps) 1.16 + # Find dependencies for all packages in wok 1.17 + cd $WOK 1.18 + for pkg in *; do 1.19 + cook $pkg --deps --quiet 1.20 + done | tee $cache/autodeps 1.21 + ;; 1.22 + 1.23 *) 1.24 # Default is to cook all commits if not yet running. 1.25 [ -n "$1" ] && usage
2.1 --- a/modules/deps Wed Mar 21 14:05:08 2018 +0200 2.2 +++ b/modules/deps Thu Mar 22 05:14:32 2018 +0200 2.3 @@ -337,12 +337,22 @@ 2.4 unset IFS 2.5 . $WOK/$1/receipt 2.6 2.7 +if [ -n "$quiet" ]; then 2.8 + sub='\n' 2.9 +else 2.10 + sub=' ' 2.11 +fi 2.12 + 2.13 for pkg in $(all_names); do 2.14 title 'Dependencies for "%s"' "$pkg" 2.15 + [ -n "$quiet" ] && echo -n "$pkg: " 2.16 IFS=$'\n' 2.17 while read file; do 2.18 tp_ldd "$WOK/$1/taz/$pkg-$VERSION/fs$file" 2.19 - done < $WOK/$1/taz/$pkg-$VERSION/files.list | sort -u | grep -v "^$pkg$" | sed '/^$/d' 2.20 + done < $WOK/$1/taz/$pkg-$VERSION/files.list \ 2.21 + | sort -u | grep -v "^$pkg$" | sed '/^$/d' \ 2.22 + | tr "$sub" ' ' 2.23 + [ -n "$quiet" ] && echo 2.24 done 2.25 2.26 newline