From: Richard W.M. Jones Date: Fri, 15 Jul 2011 15:57:55 +0000 (+0100) Subject: De-duplicate directories with the same name, like "/etc" and "/etc/" X-Git-Tag: 3.7~1 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=d51c68f705afde2313e4f8bc7a1a58ab7602bb27;p=febootstrap.git 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. --- 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