Package: dfsbuild
Version: 0.99.2
Followup-For: Bug #404555

Hi,
the attached patch uses the file "Release" first and (if it fails) falls
back to "_dists_._Release". It works for me.

I hope, this fix is appropriate.

regards,
Lars

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages dfsbuild depends on:
ii  cdebootstrap              0.3.15         Bootstrap a Debian system
ii  cramfsprogs               1.1-6          Tools for CramFs (Compressed ROM F
ii  debconf [debconf-2.0]     1.5.11         Debian configuration management sy
ii  grub                      0.97-20        GRand Unified Bootloader
ii  libc6                     2.3.6.ds1-8    GNU C Library: Shared libraries
ii  libgmp3c2                 2:4.2.1+dfsg-4 Multiprecision arithmetic library
ii  mkisofs                   9:1.1.0-1      Dummy transition package for genis
ii  reprepro                  1.3.1-1        debian package repository producer
ii  ucf                       2.0017         Update Configuration File: preserv

dfsbuild recommends no packages.

-- no debconf information
diff -ru dfsbuild.orig/dfsbuild-0.99.2/Actions/Mirror.hs 
dfsbuild/dfsbuild-0.99.2/Actions/Mirror.hs
--- dfsbuild.orig/dfsbuild-0.99.2/Actions/Mirror.hs     2006-04-20 
00:10:11.000000000 +0200
+++ dfsbuild/dfsbuild-0.99.2/Actions/Mirror.hs  2007-01-01 22:09:26.000000000 
+0100
@@ -33,7 +33,7 @@
                   archargs ++ debugargs ++ ["-d", suite, targetdir env, mirror]
        -- Next, copy them into the mirror.
        codename <- getCodeName 
-                   (targetdir env ++ "/var/cache/bootstrap/Release")
+                   (targetdir env ++ "/var/cache/bootstrap/")
        dm $ "Codename for this is " ++ codename
        mapM_ (\x -> handle (\_ -> return ()) (createDirectory x 0o755))
                  [mirrordir, mirrordir ++ "/conf"]
diff -ru dfsbuild.orig/dfsbuild-0.99.2/Utils.hs 
dfsbuild/dfsbuild-0.99.2/Utils.hs
--- dfsbuild.orig/dfsbuild-0.99.2/Utils.hs      2006-04-20 00:10:11.000000000 
+0200
+++ dfsbuild/dfsbuild-0.99.2/Utils.hs   2007-01-01 22:40:34.000000000 +0100
@@ -16,6 +16,7 @@
 import MissingH.ConfigParser
 import MissingH.Cmd
 import System.IO.Unsafe
+import System.IO.Error
 import Text.Regex
 import MissingH.Path.FilePath
 import System.Directory(doesFileExist)
@@ -72,7 +73,11 @@
 
 getCodeName :: FilePath -> IO String
 getCodeName fp =
-    do c <- readFile fp
+    do c_old <- System.IO.Error.catch (readFile (fp ++ "Release"))
+              (\e -> if System.IO.Error.isDoesNotExistError e then return "" 
else ioError e)
+       c_new <- System.IO.Error.catch (readFile (fp ++ "_dists_._Release"))
+              (\e -> if System.IO.Error.isDoesNotExistError e then return "" 
else ioError e)
+       c <- if length(c_old) > 0 then return c_old else return c_new   
        let cr = mkRegex "Codename: ([a-z]+)"
        case matchRegex cr c of
          Just [cn] -> return cn

Reply via email to