File: disable.sh

package info (click to toggle)
darcs 2.18.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,960 kB
  • sloc: haskell: 47,748; sh: 13,466; ansic: 447; perl: 134; makefile: 8
file content (37 lines) | stat: -rw-r--r-- 936 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
. lib

rm -rf temp1
mkdir temp1
cd temp1
darcs init
all_commands=$(darcs --commands | grep -v -- --)

for cmd in $all_commands; do
  # --disable works on command line
  not darcs $cmd --disable 2> log
  grep disable log
  rm log
  # --disable works from defaults
  sub_commands="$(darcs $cmd --list-options | grep -v -- -- | cut -f ';' -f 1 || true)"
  # disabling super commands in the defaults file is broken
  if test -z "$sub_commands"; then
    echo "$cmd --disable" > _darcs/prefs/defaults
    not darcs $cmd 2> log
    rm _darcs/prefs/defaults
    grep disable log
    rm log
  elif test $cmd != "setpref" -a $cmd != "help"; then
    # setpref and help are not proper super commands
    for scmd in $sub_commands; do
      echo "$cmd $scmd --disable" > _darcs/prefs/defaults
      not darcs $cmd 2> log
      rm _darcs/prefs/defaults
      grep disable log
      rm log
    done
  fi
done

cd ..
rm -rf temp1