~mdw
/
distorted-keys
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f8e6a4a
)
cryptop.list: Report an absence of keys rather than failing messily.
author
Mark Wooding
<mdw@distorted.org.uk>
Thu, 20 Sep 2012 00:08:04 +0000
(
01:08
+0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Thu, 20 Sep 2012 00:10:18 +0000
(
01:10
+0100)
cryptop.list
patch
|
blob
|
blame
|
history
diff --git
a/cryptop.list
b/cryptop.list
index
7051bbe
..
96f9a65
100755
(executable)
--- a/
cryptop.list
+++ b/
cryptop.list
@@
-131,7
+131,18
@@
while getopts "HaC:u:" opt; do
done
shift $(( $OPTIND - 1 ))
case $# in 0) set "*" ;; esac
done
shift $(( $OPTIND - 1 ))
case $# in 0) set "*" ;; esac
+
+## Find where to look for keys, and check that there might be some.
+case $all in
+ t) dir=store ;;
+ nil) dir=store/$user ;;
+esac
+if [ ! -d $KEYS/$dir ]; then echo >&2 "$quis: no keys"; exit 1; fi
+
+## Find the metadata files. This tells us where the keys are.
cd $KEYS
cd $KEYS
+metas=$(find $dir -type f -name meta | sort)
+case "x$metas" in x) echo >&2 "$quis: no keys"; exit 1 ;; esac
## First pass: validate the column specifications. Translate all bare column
## names into explicit `NAME+0' forms. Decide whether we need a width-
## First pass: validate the column specifications. Translate all bare column
## names into explicit `NAME+0' forms. Decide whether we need a width-
@@
-181,13
+192,6
@@
while :; do
## passes, because it may contribute to width.)
doheader=$header
## passes, because it may contribute to width.)
doheader=$header
- ## Find the metadata files. This tells us where the keys are.
- case $all in
- t) dir=store ;;
- nil) dir=store/$user ;;
- esac
- metas=$(find $dir -type f -name meta | sort)
-
## Work through the keys we found.
while :; do
## Work through the keys we found.
while :; do