+ /* compare the date of the history element with the most recent date
+ * for this level. If they match, then this is the last dump at this
+ * level, and we checked above for more recent lower-level dumps, so
+ * the dump is not outdated. */
+ if (info.history[matching_hist_idx].date ==
+ info.inf[info.history[matching_hist_idx].level].date) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+static int
+remove_holding_file_from_catalog(
+ char *filename)
+{
+ static int warnings_printed; /* only print once per invocation */
+ dumpfile_t file;
+ info_t info;
+ int matching_hist_idx = -1;
+ history_t matching_hist; /* will be a copy */
+ int i;
+
+ if (!holding_file_get_dumpfile(filename, &file)) {
+ g_printf(_("Could not read holding file %s\n"), filename);
+ return 0;
+ }
+
+ if (get_info(file.name, file.disk, &info) == -1) {
+ g_printf(_("WARNING: No curinfo record for %s:%s\n"), file.name, file.disk);
+ return 1; /* not an error */
+ }
+
+ matching_hist_idx = holding_file_find_history(&info, &file);
+
+ if (matching_hist_idx == -1) {
+ g_printf(_("WARNING: No dump matching %s found in curinfo.\n"), filename);
+ return 1; /* not an error */
+ }
+
+ /* make a copy */
+ matching_hist = info.history[matching_hist_idx];
+