-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a little script to generate an arbitrarily sized (with dummy small ha…
…ndles) dummy collection
- Loading branch information
1 parent
b8a4f6d
commit f1b73ae
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
# This generates arbitrarily large bogus collection with the specified in the command line number of handles | ||
# which have some random very short description, author and license | ||
|
||
set -eu | ||
|
||
n=$1 | ||
|
||
rword() { | ||
WORDLINE=$((($RANDOM * $RANDOM) % $(wc -w /usr/share/dict/words | awk '{print $1}')))"p" && sed -n $WORDLINE /usr/share/dict/words | ||
} | ||
|
||
c=bogus-${n}_collection | ||
datalad create-collection $c | ||
|
||
for i in `seq 1 $n`; do | ||
h=bogus$i-$n | ||
datalad create-handle $h | ||
( cd $h; | ||
git annex addurl "http://www.onerussian.com/tmp/banner.png" --file "Banner for $h" | ||
git commit -m "Our banner for $h" | ||
|
||
datalad describe \ | ||
--author "`rword` `rword`" \ | ||
--license "`rword`" \ | ||
--description "`rword` `rword` | ||
`rword` | ||
`rword` `rword` `rword` | ||
" | ||
cd .. | ||
# add | ||
datalad add-handle $h $c | ||
) | ||
done |