diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-07-15 16:57:55 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-07-15 16:57:55 +0100 |
commit | d51c68f705afde2313e4f8bc7a1a58ab7602bb27 (patch) | |
tree | c4c002f1bb8fb3ab5c5c7fbfd69475e43790323c /febootstrap.ml | |
parent | 474de2b96272435bb94945fd53462481d366dd46 (diff) | |
download | febootstrap-d51c68f705afde2313e4f8bc7a1a58ab7602bb27.tar.gz febootstrap-d51c68f705afde2313e4f8bc7a1a58ab7602bb27.tar.xz febootstrap-d51c68f705afde2313e4f8bc7a1a58ab7602bb27.zip |
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.
Diffstat (limited to 'febootstrap.ml')
-rw-r--r-- | febootstrap.ml | 14 |
1 files changed, 14 insertions, 0 deletions
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 |