Package: dfsbuild
Version: 1.0.2.0
Severity: normal

Hello,

dfsbuild doesn't delete the files and directories in delete_files, with the error messages that they are wrong type (files or directories). This is because dfsbuild deletes the files in deleteit in Utils.hs, which only calls removeLink on the files.

A solution would be to define the deleteit function like that:

deleteit :: FilePath -> IO ()
deleteit fn =
    do dm $ "Deleting: " ++ fn
       handle delfile
              (removeLink fn)
    where
      delfile ex =
       handle deldirrec
              (removeFile fn)
      deldirrec ex =
       handle (\e -> wm ("Delete failed: " ++ show e))
        (do
         files <- getDirectoryContents fn
         (foldM doDelete () files))
      doDelete _ "." = return ()
      doDelete _ ".." = return ()
      doDelete _ fp = deleteit (fn ++ "/" ++ fp)

However, this doesn't delete the directory structure (only files in it), and, I admit, it is quite ugly. I would be wise if someone wrote it more Haskell-wise :-)

Regards
    Jiri Palecek

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.23.9-debug (PREEMPT)
Locale: LANG=cs_CZ, LC_CTYPE=cs_CZ (charmap=ISO-8859-2) (ignored: LC_ALL set to cs_CZ)
Shell: /bin/sh linked to /bin/dash

Versions of packages dfsbuild depends on:
ii cdebconf [debconf-2.0] 0.116 Debian Configuration Management Sy
ii  cdebootstrap              0.4.7          Bootstrap a Debian system
ii cramfsprogs 1.1-6 Tools for CramFs (Compressed ROM F ii debconf [debconf-2.0] 1.5.13 Debian configuration management sy
ii  grub                      0.97-28        GRand Unified Bootloader
ii libc6 2.7-3 GNU C Library: Shared libraries ii libgmp3c2 2:4.2.1+dfsg-4 Multiprecision arithmetic library ii mkisofs 9:1.1.6-1 Dummy transition package for genis ii reprepro 3.3.0-1 Debian package repository producer ii ucf 3.001 Update Configuration File: preserv

dfsbuild recommends no packages.

-- no debconf information


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


Reply via email to