[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnu-arch-users] patch: automatic remove the corrupt revlib revision, se
From: |
Derek Zhou |
Subject: |
[Gnu-arch-users] patch: automatic remove the corrupt revlib revision, second try |
Date: |
Wed, 30 Nov 2005 17:00:09 -0800 |
Addressing Matthieu's concern. Now it prints a warning message. Also does
a rename before the rm.
Derek
--- orig/libarch/libraries.c
+++ mod/libarch/libraries.c
@@ -314,10 +314,21 @@
{
if (check_inode_sigs) {
if (!arch_valid_inode_sig (rel_peek_str (revision_dirs, 0, 0),
archive, revision))
- {
- safe_printfmt (2, "corrupt library (failed inode signature
validation)\n archive: %s\n revision: %s\nYou should remove this revision
from your library.\n",
- archive, revision);
- exit (2);
+ {
+ t_uchar * junk_dir = str_save(0, rel_peek_str (revision_dirs,
0, 0));
+ t_uchar * dest_dir_dir = file_name_directory_file (0,
junk_dir);
+ t_uchar * tmp_dir = 0;
+
+ safe_printfmt (2, "tla: corrupt library (failed inode
signature validation) archive: %s revision: %s. \nAutomatically removed.\n",
archive, revision);
+ ensure_directory_exists (dest_dir_dir);
+ tmp_dir = tmp_file_name (dest_dir_dir, ",,to-be-deleted");
+ safe_rename (junk_dir, tmp_dir);
+ rmrf_file(tmp_dir);
+
+ lim_free (0, dest_dir_dir);
+ lim_free (0, tmp_dir);
+ lim_free (0, junk_dir);
+ continue;
}
}
answer = str_save (0, rel_peek_str (revision_dirs, 0, 0));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnu-arch-users] patch: automatic remove the corrupt revlib revision, second try,
Derek Zhou <=