Try to remove dirs when rolling back

This commit is contained in:
Steve McIntyre 2021-12-06 23:50:22 +00:00
parent a35ad1b9dc
commit 6b61e01f15
1 changed files with 3 additions and 0 deletions

View File

@ -1534,6 +1534,9 @@ sub add_packages {
unlink ("$dir/$file") || msg_ap(0, "Couldn't delete file $dir/$file\n"); unlink ("$dir/$file") || msg_ap(0, "Couldn't delete file $dir/$file\n");
msg_ap(0, " Rollback: removed $dir/$file\n"); msg_ap(0, " Rollback: removed $dir/$file\n");
} }
# Try to remove the directory; will silently fail if there
# are still files there, which is OK.
rmdir ($dir);
} else { } else {
$total_blocks += add_Packages_entry($dir, $arch, $in_backports, $package_info); $total_blocks += add_Packages_entry($dir, $arch, $in_backports, $package_info);
$total_blocks += add_md5_entry($dir, $arch, $in_backports, $package_info); $total_blocks += add_md5_entry($dir, $arch, $in_backports, $package_info);