summaryrefslogtreecommitdiffstats
path: root/idtest
diff options
context:
space:
mode:
authorGreg McGary <greg@mcgary.org>1997-04-18 06:38:38 +0000
committerGreg McGary <greg@mcgary.org>1997-04-18 06:38:38 +0000
commit8c13e09279f361e18173f9e237c454af0ab33299 (patch)
treef66f1ed48a98145460da6a01926017825cebbdf2 /idtest
parent509a418a05787df17f1e942593541798facb5acf (diff)
downloadidutils-r3_0_8_2.tar.gz
idutils-r3_0_8_2.tar.bz2
idutils-r3_0_8_2.zip
imported from mkid-3.0.9r3_0_8_2
Diffstat (limited to 'idtest')
-rwxr-xr-xidtest27
1 files changed, 15 insertions, 12 deletions
diff --git a/idtest b/idtest
index bf2262e..a60a75f 100755
--- a/idtest
+++ b/idtest
@@ -2,6 +2,12 @@
export LANG; LANG=C
+: ${TMP=/tmp}
+ID_idx=$TMP/ID.idx
+ID_lid=$TMP/ID.lid
+tmp_idx=$TMP/$$.idx
+tmp_fid=$TMP/$$.fid
+
case $# in
0) 1>&2 echo Usage: $0 files...; exit 1;;
esac
@@ -11,29 +17,26 @@ esac
errors=
-if idx "$@" |sort -u >ID.idx &&
- lid $idfile_arg |sed -e 's/[ ].*//' |sort -u >ID.lid &&
- cmp -s ID.idx ID.lid
+if idx "$@" |sort -u >$ID_idx &&
+ lid $idfile_arg |sed -e 's/[ ].*//' |sort -u >$ID_lid &&
+ cmp -s $ID_idx $ID_lid
then
- rm -f ID.idx ID.lid
+ rm -f $ID_idx $ID_lid
echo "Good. idx and lid agree."
else
- 1>&2 echo "Oops! idx and lid disagree--look in ID.idx and ID.lid"
+ 1>&2 echo "Oops! idx and lid disagree--look at $ID_idx and $ID_lid"
errors=t
fi
-idx_file=$$.idx
-fid_file=$$.fid
-
for file
do
case x$file in
x-*) scan_args="$scan_args $file"
continue;;
esac
- if fid $idfile_arg $file >$fid_file &&
- idx $scan_args $file |sort -u >$idx_file &&
- cmp -s $idx_file $fid_file;
+ if fid $idfile_arg $file >$tmp_fid &&
+ idx $scan_args $file |sort -u >$tmp_idx &&
+ cmp -s $tmp_idx $tmp_fid;
then
echo "Good. idx and fid agree for $file"
else
@@ -41,7 +44,7 @@ do
errors=t
fi
done
-rm -f $idx_file $fid_file
+rm -f $tmp_idx $tmp_fid
case x$errors in
xt) echo "Some checks failed."