parallel: implemented /etc/parallel/config. Passes testsuite.

This commit is contained in:
Ole Tange 2011-02-21 02:31:30 +01:00
parent b7d707b346
commit c535c25450
8 changed files with 77 additions and 18 deletions

View file

@ -147,12 +147,19 @@ at: http://ftp.gnu.org/gnu/parallel/
New in this release:
* --tollef to be switch compatible with Tollef's parallel.
* Site wide config file: /etc/parallel/config
* Opscode Cookbook for Chef. Thanks to Joshua Timberman.
https://github.com/opscode/cookbooks/tree/master/gnu_parallel
* The examples translated into Japanese. Thanks to Koshigoe.
* Man page examples translated into Japanese. Thanks to Koshigoe.
http://w.koshigoe.jp/study/?%5Bsystem%5D+GNU+parallel+%BB%C8%CD%D1%CE%E3#l13
* Review with examples in German. Thanks to M. Nieberg.
http://kenntwas.de/2011/linux/gnu-parallel/
* A review of the --pipe option in German. Thanks to Mathias Huber.
http://www.linux-magazin.de/NEWS/GNU-Parallel-20110205-stueckelt-Daten

View file

@ -574,7 +574,9 @@ sub read_options {
# Add options from .parallel/config and other profiles
my @ARGV_profile = ();
my @ARGV_env = ();
my @config_profiles = ($ENV{'HOME'}."/.parallel/config",
my @config_profiles = (
"/etc/parallel/config",
$ENV{'HOME'}."/.parallel/config",
$ENV{'HOME'}."/.parallelrc");
my @profiles = @config_profiles;
if($::opt_profile) {

View file

@ -6,8 +6,8 @@ echo '### Test -p --interactive'
cat >/tmp/parallel-script-for-expect <<_EOF
#!/bin/bash
seq 1 3 | parallel -k -p echo opt-p
seq 1 3 | parallel -k --interactive echo opt--interactive
seq 1 3 | parallel -k -p "sleep 0.1; echo opt-p"
seq 1 3 | parallel -k --interactive "sleep 0.1; echo opt--interactive"
_EOF
chmod 755 /tmp/parallel-script-for-expect

View file

@ -78,13 +78,13 @@ echo 12a34b45a6 |
parallel -k --pipe --recend 'b' --rrs 'echo -n "$PARALLEL_SEQ>"; cat; echo; sleep 0.1'
echo '### Test -N even'
seq 1 10 | parallel -j2 -k -N 2 --pipe cat";echo ole;sleep 0.1"
seq 1 10 | parallel -j2 -k -N 2 --pipe cat";echo ole;sleep 0.\$PARALLEL_SEQ"
echo '### Test -N odd'
seq 1 11 | parallel -j2 -k -N 2 --pipe cat";echo ole;sleep 0.1"
seq 1 11 | parallel -j2 -k -N 2 --pipe cat";echo ole;sleep 0.\$PARALLEL_SEQ"
echo '### Test -N even+2'
seq 1 12 | parallel -j2 -k -N 2 --pipe cat";echo ole;sleep 0.1"
seq 1 12 | parallel -j2 -k -N 2 --pipe cat";echo ole;sleep 0.\$PARALLEL_SEQ"
echo '### Test --recstart + --recend'
cat /tmp/blocktest | parallel -k --recstart 44 --recend "44" -j10 --pipe sort -n |md5sum

View file

@ -1,10 +1,20 @@
#!/bin/bash
echo '### Test --tollef'
parallel --tollef echo -- 1 2 3
parallel -k --tollef echo -- 1 2 3 ::: a b c
echo '### Test --tollef --gnu'
parallel --tollef --gnu echo ::: 1 2 3
parallel -k --tollef --gnu echo ::: 1 2 3 -- a b c
echo '### Test --gnu'
parallel --gnu echo ::: 1 2 3
parallel -k --gnu echo ::: 1 2 3 -- a b c
echo "### test global config"
echo /etc/parallel/config | sudo parallel "echo --tollef > "
parallel -k echo -- 1 2 3 ::: a b c
parallel -k --gnu echo ::: 1 2 3 -- a b c
echo --gnu > ~/.parallel/config
parallel -k echo ::: 1 2 3 -- a b c
parallel -k --gnu echo ::: 1 2 3 -- a b c
sudo rm /etc/parallel/config
rm ~/.parallel/config

View file

@ -1,14 +1,14 @@
### Test -p --interactive
spawn /tmp/parallel-script-for-expect
echo opt-p 1 ?...y
echo opt-p 2 ?...n
sleep 0.1; echo opt-p 1 ?...y
sleep 0.1; echo opt-p 2 ?...n
sleep 0.1; echo opt-p 3 ?...y
opt-p 1
echo opt-p 3 ?...y
opt-p 3
echo opt--interactive 1 ?...y
echo opt--interactive 2 ?...n
sleep 0.1; echo opt--interactive 1 ?...y
sleep 0.1; echo opt--interactive 2 ?...n
sleep 0.1; echo opt--interactive 3 ?...y
opt--interactive 1
echo opt--interactive 3 ?...y
opt--interactive 3
### Test -L -l and --max-lines
a_b

View file

@ -132,7 +132,6 @@ ole
9
10
ole
ole
### Test -N odd
1
2

View file

@ -2,11 +2,52 @@
1
2
3
:::
a
b
c
### Test --tollef --gnu
1
2
3
--
a
b
c
### Test --gnu
1
2
3
--
a
b
c
### test global config
1
2
3
:::
a
b
c
1
2
3
--
a
b
c
1
2
3
--
a
b
c
1
2
3
--
a
b
c