commit 3c2c0d24e1116b5ea60b70bf5a093c9b88886927
parent 25e32f1d101ca4275fa10704722c44fab13b7db1
Author: Daniel Bainton <dpb@driftaway.org>
Date: Sun, 9 Mar 2014 17:14:11 +0200
Add deps of a package to the fetch targets also
Diffstat:
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/mkfile b/mkfile
@@ -23,9 +23,11 @@ fetch-all fetch-world:VQ: ${fetchpkgs}
`{ mkdir -p src }
`{ mkdir -p .cache }
`{ printf '# auto-generated file, do not edit\n' > pkgs.mk }
-`{ cd pkgs && for pkg in *; do cat $pkg/build ../stuff/fetch-pkg.mk |\
+`{ cd pkgs && for pkg in *; do \
+ fdeps=`$top/stuff/get-fetch-deps $pkg` &&\
+ cat $pkg/build ../stuff/fetch-pkg.mk |\
sed -e "s,^build:,$pkg:QP./stuff/cmp-pkgs: $pkg-fetch pkgs/$pkg/build," |\
- sed -e "s,^fetch-target:,$pkg-fetch:," |\
+ sed -e "s,^fetch-target:,$pkg-fetch:QP./stuff/cmp-fetch: $fdeps," |\
sed -e "s,^v=,_${pkg}_v=," |\
sed -e "s,^pkgdir=,_${pkg}_pkgdir=$top/pkgs/$pkg," |\
sed -e "s,\$v,\${_${pkg}_v},g" |\
diff --git a/stuff/fetch-pkg.mk b/stuff/fetch-pkg.mk
@@ -2,7 +2,7 @@
pkgdir=
-fetch-target:QP./stuff/cmp-fetch: .
+fetch-target:
cd src
pkg=`echo $target | sed -e 's,-fetch$,,'`
eval url=$url
diff --git a/stuff/get-fetch-deps b/stuff/get-fetch-deps
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+deps=$(cat $1/build | sed -n '1{x;d};${H;x;s/\\\n\t/ /g;p};{H}' | grep ^build: | cut -d ':' -f 2-)
+for d in $deps; do echo -n "$d-fetch "; done