Ticket #156: diff.mindi.handle_bad_tempdir

File diff.mindi.handle_bad_tempdir, 1.6 KB (added by Scott Cummings, 13 years ago)

patch to mindi

Line 
1Notes on this:
2
3- mkdir at line ~100 - Doesn't '-d' option on mktemp do this?
4
5
6
7*** /usr/sbin/mindi.orig2   2007-04-13 23:33:35.000000000 -0500
8--- /usr/sbin/mindi.handle_bad_tempdir  2007-04-25 06:33:42.000000000 -0500
9***************
10*** 96,104 ****
11    . $MINDI_CONFIG
12  fi
13 
14! # Now we can create what we nedd
15  MINDI_TMP=`mktemp -d $TMPDIR/mindi.XXXXXXXXXX`
16- mkdir -p $MINDI_TMP
17 
18  # Purge from potential old run
19  rm -rf $CACHE_LOC/* 2> /dev/null
20--- 96,103 ----
21    . $MINDI_CONFIG
22  fi
23 
24! # Now we can create what we need
25  MINDI_TMP=`mktemp -d $TMPDIR/mindi.XXXXXXXXXX`
26 
27  # Purge from potential old run
28  rm -rf $CACHE_LOC/* 2> /dev/null
29***************
30*** 2913,2920 ****
31        MONDO_TMP=$2
32        # Change MINDI_TMP for the one provided by mondo
33        # So that it can get back the built files
34!       mv $MINDI_TMP/* $MINDI_TMP/.??* $MONDO_TMP 2> /dev/null
35!       rmdir $MINDI_TMP
36        MINDI_TMP=$MONDO_TMP
37        mkdir -p $MINDI_TMP
38        # This is the scratch dir in mondo
39--- 2912,2918 ----
40        MONDO_TMP=$2
41        # Change MINDI_TMP for the one provided by mondo
42        # So that it can get back the built files
43!       rmdir $MINDI_TMP  # If this fails (non-empty for some reason, or not successfully created above) it's OK.
44        MINDI_TMP=$MONDO_TMP
45        mkdir -p $MINDI_TMP
46        # This is the scratch dir in mondo
47***************
48*** 2992,2997 ****
49--- 2990,2998 ----
50        MindiExit -1
51    fi
52  fi
53+
54+ [ -d "$MINDI_TMP" ] || Die "Don't have a MINDI_TMP directory, $MINDI_TMP.  Please check /etc/mindi/mindi.conf or Mondo options"
55+
56  #ScanCDandTape
57  [ "$CDRECOVERY" = "yes" ] || CDRECOVERY=no
58  if [ "$CDRECOVERY" = "yes" ] ; then