[Pkg-haskell-commits] darcs: tools: Switch to .gz, remove ia64, other changes
Joachim Breitner
mail at joachim-breitner.de
Tue Jul 13 08:57:01 UTC 2010
Tue Jul 13 08:53:55 UTC 2010 Joachim Breitner <mail at joachim-breitner.de>
* Switch to .gz, remove ia64, other changes
Ignore-this: ae9dd50ef9a2ec7d8d854da64aa7858e
M ./getdata.sh -9 +15
M ./haskell-pkg-debcheck.hs -10 +15
M ./haskell-pkg-graph.py -5 +10
M ./haskell-pkg-links.py -2 +2
Tue Jul 13 08:53:55 UTC 2010 Joachim Breitner <mail at joachim-breitner.de>
* Switch to .gz, remove ia64, other changes
Ignore-this: ae9dd50ef9a2ec7d8d854da64aa7858e
diff -rN -u old-tools/getdata.sh new-tools/getdata.sh
--- old-tools/getdata.sh 2010-07-13 08:57:01.432471494 +0000
+++ new-tools/getdata.sh 2010-07-13 08:57:01.440471913 +0000
@@ -10,20 +10,26 @@
cd data/
for distro in $distributions ; do
for comp in $components ; do
- fname="$distro-$comp-Sources.bz2"
- echo "Getting $fname..."
- curl -o $fname -z $fname $base/$distro/$comp/source/Sources.bz2
- for arch in $architectures ; do
- fname="$distro-$comp-binary-$arch-Packages.bz2"
+ fname="$distro-$comp-Sources.gz"
+ if ! test -L $fname
+ then
echo "Getting $fname..."
- curl -o $fname -z $fname $base/$distro/$comp/binary-$arch/Packages.bz2
- done
+ curl -o $fname -z $fname $base/$distro/$comp/source/Sources.gz
+ for arch in $architectures ; do
+ fname="$distro-$comp-binary-$arch-Packages.gz"
+ echo "Getting $fname..."
+ curl -o $fname -z $fname $base/$distro/$comp/binary-$arch/Packages.gz
+ done
+ fi
done
done
for arch in $architectures ; do
fname="wanna-build-dump-$arch.gz"
- echo "Getting $fname..."
- curl -o $fname -z $fname https://buildd.debian.org/stats/$arch-dump.txt.gz
+ if ! test -L $fname
+ then
+ echo "Getting $fname..."
+ curl -o $fname -z $fname https://buildd.debian.org/stats/$arch-dump.txt.gz
+ fi
done
diff -rN -u old-tools/haskell-pkg-debcheck.hs new-tools/haskell-pkg-debcheck.hs
--- old-tools/haskell-pkg-debcheck.hs 2010-07-13 08:57:01.432471494 +0000
+++ new-tools/haskell-pkg-debcheck.hs 2010-07-13 08:57:01.436471704 +0000
@@ -11,7 +11,7 @@
import Text.XML.HaXml hiding ((!),when)
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy as LB
-import qualified Codec.Compression.BZip as BZip
+--import qualified Codec.Compression.BZip as BZip
import qualified Codec.Compression.GZip as GZip
import Debian.Control
import Debian.Control.ByteString
@@ -29,12 +29,13 @@
arches :: [Arch]
--arches = ["amd64","i386"]
-arches = words "amd64 armel hppa i386 ia64 mips mipsel powerpc s390 sparc kfreebsd-amd64 kfreebsd-i386"
+--arches = words "amd64 armel hppa i386 ia64 mips mipsel powerpc s390 sparc kfreebsd-amd64 kfreebsd-i386"
+arches = words "alpha amd64 armel hppa i386 mips mipsel powerpc s390 sparc kfreebsd-amd64 kfreebsd-i386"
-- File locations
-sourcesFile = "data/unstable-main-Sources.bz2"
-binariesFiles arch = "data/unstable-main-binary-" ++ arch ++ "-Packages.bz2"
+sourcesFile = "data/unstable-main-Sources.gz"
+binariesFiles arch = "data/unstable-main-binary-" ++ arch ++ "-Packages.gz"
wbDump arch = "data/wanna-build-dump-" ++ arch ++ ".gz"
data SourceInfo = SourceInfo
@@ -55,7 +56,7 @@
parseControl "Sources" <$>
BS.concat <$>
LB.toChunks <$>
- BZip.decompress <$>
+ GZip.decompress <$>
LB.readFile (sourcesFile)
hPutStrLn stderr $ show (M.size sourcesMap) ++ " sources selected."
@@ -71,7 +72,7 @@
parseControl "Binary" <$>
BS.concat <$>
LB.toChunks <$>
- BZip.decompress <$>
+ GZip.decompress <$>
LB.readFile (binariesFiles arch)
hPutStrLn stderr $ show (M.size binaryMap) ++ " binary/arch tuples selected."
@@ -105,7 +106,9 @@
si = sourcesMap ! s
(_,bsv) = binaryMap ! (p,a)
sv = siVersion si
- guard (bsv == sv) -- Do not schedule binNMUs for outdated sources
+ -- Do not schedule binNMUs for outdated sources
+ guard (bsv == sv)
+ guard (not (s `M.member` outdatedSources))
return (s,(S.singleton a, sv, formatReason x))
forM (M.toList nmus) $ \(s,(as,sv,exp)) -> putStrLn $ "nmu " ++ s ++ "_" ++ show sv ++ " . " ++ unwords (S.toList as) ++ " . -m '" ++ exp ++ "'"
@@ -141,12 +144,14 @@
(a,fdws) <- M.toList m
return (fdws, S.singleton a)
forM (M.toList m2) $ \((f,dws),as) -> do
+ {-
forM (S.toList as) $ \a ->
do case (s, a) `M.lookup` wbMap of
Just (_,cdw@(_:_)) -> putStrLn $ "# Current Dep-Wait on " ++ a ++ ": " ++ showRelations cdw
_ -> return ()
when (not f) $ putStr "# "
- putStrLn $ "dw " ++ s ++ "_" ++ show sv ++ " . " ++ unwords (S.toList as) ++ " . -m '" ++ showRelations dws ++ "'"
+ -}
+ when f $ putStrLn $ "dw " ++ s ++ "_" ++ show sv ++ " . " ++ unwords (S.toList as) ++ " . -m '" ++ showRelations dws ++ "'"
interestingSource si = "haskell-devscripts" `elem` (flattenRelations (siBuildDepends si))
@@ -236,8 +241,8 @@
collectEdosOutput :: [PkgName] -> IO [(PkgName, Arch, DebianVersion, String)]
collectEdosOutput pkgs = fmap concat $ forM arches $ \arch -> do
- (_, Just bzcatOut, _, _) <- createProcess $ (proc "bzcat" [binariesFiles arch]) { std_out = CreatePipe }
- (_, Just edosOut, _, _) <- createProcess $ (proc "edos-debcheck" ["-xml","-failures","-explain","-checkonly", intercalate "," pkgs]) { std_in = UseHandle bzcatOut, std_out = CreatePipe }
+ (_, Just zcatOut, _, _) <- createProcess $ (proc "zcat" [binariesFiles arch]) { std_out = CreatePipe }
+ (_, Just edosOut, _, _) <- createProcess $ (proc "edos-debcheck" ["-xml","-failures","-explain","-checkonly", intercalate "," pkgs]) { std_in = UseHandle zcatOut, std_out = CreatePipe }
Document _ _ root _ <- xmlParse "edos output" <$> hGetContents edosOut
-- How do you actually use this HaXmL? This can not be the correct way:
let filter = concatMap ((attributed "package" `x` attributed "architecture" `x` attributed "version" `x` extracted (concat . mapMaybe fst . textlabelled (txt `o` children)) ) keep) . (elm `o` children)
diff -rN -u old-tools/haskell-pkg-graph.py new-tools/haskell-pkg-graph.py
--- old-tools/haskell-pkg-graph.py 2010-07-13 08:57:01.428471284 +0000
+++ new-tools/haskell-pkg-graph.py 2010-07-13 08:57:01.440471913 +0000
@@ -13,6 +13,7 @@
# Suggested usage: ./haskell-pkg-graph.py | tred | unflatten | dot -Tpdf -o haskell-pkg-graph.pdf
import bz2
+import gzip
import datetime
import gzip
import os
@@ -47,7 +48,7 @@
def debcheck(binary_src_map):
arch = "i386"
- f = smart_open("data/unstable-main-binary-%s-Packages.bz2" % arch)
+ f = smart_open("data/unstable-main-binary-%s-Packages.gz" % arch)
p = Popen(['edos-debcheck','-quiet','-xml','-failures','-checkonly', ','.join(binary_src_map.keys())], stdin=PIPE,stdout=PIPE)
(out, err) = p.communicate(f.read())
@@ -153,13 +154,13 @@
def main(self):
# sources will contian haskell libraries + ghc6
self.sources = {}
- f = smart_open("data/unstable-main-Sources.bz2")
+ f = smart_open("data/unstable-main-Sources.gz")
srcfile = debian_support.PackageFile('', file_obj=f)
try:
for src in filter(self.is_interesting_source, imap(patch_pkg_dict,srcfile)):
self.sources[src['package']] = src
except Exception, e:
- print "E: error while parsing %s, ignoring it." % "data/unstable-main-Sources.bz2"
+ print "E: error while parsing %s, ignoring it." % "data/unstable-main-Sources.gz"
print " exception: %s" % e
f.close()
@@ -167,13 +168,13 @@
# Create dict of all binaries
self.packages = {}
- f = smart_open("data/unstable-main-binary-%s-Packages.bz2" % arch)
+ f = smart_open("data/unstable-main-binary-%s-Packages.gz" % arch)
binfile = debian_support.PackageFile('', file_obj=f)
try:
for pkg in imap(patch_pkg_dict, binfile):
self.packages[pkg['package']] = pkg
except Exception, e:
- print "E: error while parsing %s, ignoring it." % ("data/unstable-main-binary-%s-Packages.bz2" % arch)
+ print "E: error while parsing %s, ignoring it." % ("data/unstable-main-binary-%s-Packages.gz" % arch)
print " exception: %s" % e
f.close()
@@ -219,6 +220,10 @@
if opt['name'] in ('alex','c2hs','cpphs','happy','hscolour','haddock'):
continue
+ # avoid cpphs, haddock etc.
+ #if opt['name'] in ('ghc6','ghc6-doc','ghc6-prof'):
+ # continue
+
edge = (hash(self.haskell_lib_to_source[opt['name']]['package']), hash(src['package']))
if edge not in seen_edges:
print '%s -> %s;' % edge
diff -rN -u old-tools/haskell-pkg-links.py new-tools/haskell-pkg-links.py
--- old-tools/haskell-pkg-links.py 2010-07-13 08:57:01.428471284 +0000
+++ new-tools/haskell-pkg-links.py 2010-07-13 08:57:01.440471913 +0000
@@ -60,13 +60,13 @@
def main(self):
# sources will contian haskell libraries + ghc6
self.sources = {}
- f = smart_open("data/unstable-main-Sources.bz2")
+ f = smart_open("data/unstable-main-Sources.gz")
srcfile = debian_support.PackageFile('', file_obj=f)
try:
for src in filter(self.is_interesting_source, imap(patch_pkg_dict,srcfile)):
self.sources[src['package']] = src
except Exception, e:
- print "E: error while parsing %s, ignoring it." % "data/unstable-main-Sources.bz2"
+ print "E: error while parsing %s, ignoring it." % "data/unstable-main-Sources.gz"
print " exception: %s" % e
f.close()
More information about the Pkg-haskell-commits
mailing list