This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

hooks/pre-commit: check for deps repetitions

A dep should only be listed once in .topdeps, force this.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
  • Loading branch information...
bertwesarg authored and Uwe Kleine-König committed Oct 4, 2010
1 parent eff4bed commit 8b0f1f9d215d767488542a7853320d1789838d92
Showing with 12 additions and 0 deletions.
  1. +12 −0 hooks/pre-commit.sh
View
@@ -93,3 +93,15 @@ BEGIN { in_hunk = 0; }
# therefore no endless loop in the cycle-check
no_remotes=1 recurse_deps check_cycle_name "$newly_added"
done
+
+# check for repetitions of deps
+depdir="$(mktemp -t -d tg-depdir.XXXXXX)" ||
+ die "Can't check for multiple occurrences of deps"
+trap "rm -rf '$depdir'" 0
+cat_file "(i):.topdeps" |
+ while read dep; do
+ [ ! -d "$depdir/$dep" ] ||
+ die "Multiple occurrences of the same dep: $dep"
+ mkdir -p "$depdir/$dep" ||
+ die "Can't check for multiple occurrences of deps"
+ done

0 comments on commit 8b0f1f9

Please sign in to comment.