+}
+
+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];