From d51c68f705afde2313e4f8bc7a1a58ab7602bb27 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 15 Jul 2011 16:57:55 +0100 Subject: [PATCH] De-duplicate directories with the same name, like "/etc" and "/etc/" In Rawhide there are two patches which create /etc/pam.d and /etc/pam.d/ febootstrap was trying to treat these as two separate directories. Add a de-duplication step so that these names are considered the same. We could go further than this patch (eg. removing multiple // characters), but this patch is sufficient to fix Fedora builds. --- febootstrap.ml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/febootstrap.ml b/febootstrap.ml index dc44d3d..7e48206 100644 --- a/febootstrap.ml +++ b/febootstrap.ml @@ -72,6 +72,20 @@ let () = ) packages ) in + (* Canonicalize the name of directories, so that /a and /a/ are the same. *) + let files = + List.map ( + fun (filename, ft, pkg) -> + let len = String.length filename in + let filename = + if len > 1 (* don't rewrite "/" *) && ft.ft_dir + && filename.[len-1] = '/' then + String.sub filename 0 (len-1) + else + filename in + (filename, ft, pkg) + ) files in + (* Sort and combine duplicate files. *) let files = let files = List.sort compare files in -- 1.8.3.1