[Pkg-haskell-commits] [tools] 01/01: Clean out tools repository
Joachim Breitner
nomeata at moszumanska.debian.org
Sun Jun 14 08:19:23 UTC 2015
This is an automated email from the git hooks/post-receive script.
nomeata pushed a commit to branch master
in repository tools.
commit b0587dfbb36dc21a7d6b541fbff7f627777dc388
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Sun Jun 14 10:18:51 2015 +0200
Clean out tools repository
by removing scripts that are obsolete or possibly broken.
---
.gitignore | 4 +
buildd-stats.py | 448 --------------------------------------------
deploy-binNMU-to-wuiet.sh | 5 +
haskell-pkg-debcheck-exp.hs | 380 -------------------------------------
haskell-pkg-debcheck.hs | 420 -----------------------------------------
haskell-pkg-debcheck.py | 214 ---------------------
haskell-pkg-infos.py | 306 ------------------------------
pkg-haskell-uupdate | 73 --------
8 files changed, 9 insertions(+), 1841 deletions(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0d14013
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.hi
+*.o
+reasons
+binNMUs
diff --git a/buildd-stats.py b/buildd-stats.py
deleted file mode 100755
index def6a4f..0000000
--- a/buildd-stats.py
+++ /dev/null
@@ -1,448 +0,0 @@
-#!/usr/bin/python
-
-# (c) 2013 Joachim Breitner
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-
-import cgi
-import cgitb; cgitb.enable()
-import psycopg2
-import psycopg2.extras
-import re
-
-conn = psycopg2.connect("service=wanna-build")
-cur = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
-
-ARCH = 'i386'
-
-DAYS_QUERY = '''SELECT (SELECT min(timestamp) FROM %(arch)s.pkg_histor '1' day * generate_series(0, (SELECT extract(day from max(timestamp)-min(timestamp)) FROM %(arch)s.pkg_history)::integer))''' % {'arch': ARCH}
-
-pattern =re.compile('^([-_a-zA-Z0-9]*)\s*.*pkg-haskell-maintainers at lists.alioth.debian.org.*$')
-pkgs = []
-for line in file('/srv/buildd.debian.org/etc/Maintainers'):
- m = pattern.match(line)
- if m:
- pkgs.append(m.group(1))
-
-QUERY = '''
- WITH allp AS (
- SELECT COUNT(*) as pkgs,
- timestamp :: date AS day,
- sum(build_time) as total_build_time
- FROM %(arch)s_public.pkg_history
- WHERE timestamp > '2010-01-01'
- GROUP BY day
- ORDER BY day
- ), haskell as (
- SELECT COUNT(*) as haskell_pkgs,
- timestamp :: date AS day,
- sum(build_time) as haskell_total_build_time
- FROM %(arch)s_public.pkg_history
- WHERE package IN (%(pkgs)s)
- AND timestamp > '2010-01-01'
- GROUP BY day
- ORDER BY day
- )
- SELECT *
- FROM allp FULL OUTER JOIN haskell USING (day);''' % \
- { 'arch': ARCH,
- 'pkgs': ",".join(map(lambda s: "'%s'"%s, pkgs)) }
-
-cur.execute(QUERY)
-
-print 'Content-Type: text/html\n\n'
-print '''
- <html>
- <head><title>Haskell Buildd exposure stats</title></head>
- <style type="text/css">
- #placeholder { width: 900px; height: 300 }
- #placeholder2 { width: 900px; height: 300 }
- #overview { width: 900px; height: 100px }
-
- .stats {
- border: 1px solid #DFDFDF;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- font-family: sans-serif;
- }
- .stats td, .stats th {
- border-top-color: white;
- border-bottom: 1px solid #DFDFDF;
- }
- .stats thead th {
- text-align: center;
- }
- .stats th {
- font-weight: bold;
- padding: 7px 7px 8px;
- text-align: left;
- line-height: 1.3em;
- }
- .stats td {
- padding: 4px 7px 2px;
- vertical-align: top;
- text-align: right;
- }
-
- </style>
- <script language="javascript" type="text/javascript" src="flot/jquery.js"></script>
- <script language="javascript" type="text/javascript" src="flot/jquery.flot.js"></script>
- <script language="javascript" type="text/javascript" src="flot/jquery.flot.time.js"></script>
- <script language="javascript" type="text/javascript" src="flot/jquery.flot.selection.js"></script>
- <script type="text/javascript">
- $(function() {
- function percFormatter(perc, axis) {
- return perc.toFixed(axis.tickDecimals) + "%";
- }
- function timespanFormatter(period, axis) {
- var timespan = 1;
- var format = 's';
- if (period > 31556926) {
- // More than one year
- format = 'y';
- timespan = (period / 31556926).toFixed(2);
- }
- else if (period > 2629744) {
- // More than one month
- format = 'm';
- timespan = (period / 2629744).toFixed(2);
- }
- else if (period > 604800) {
- // More than one week
- format = 'w';
- timespan = (period / 604800).toFixed(2);
- }
- else if (period > 86400) {
- // More than one day
- format = 'd';
- timespan = (period / 86400).toFixed(2);
- }
- else if (period > 3600) {
- // More than one hour
- format = 'h';
- timespan = (period / 3600).toFixed(2);
- }
- else if (period > 60) {
- // More than one minute
- format = 'm';
- timespan = (period / 60).toFixed(2);
- } else {
- timespan = period.toFixed(2);
- }
-
- /*
- // Remove the s
- if(timespan == 1) {
- format = format.substr(0, format.length-1);
- }
- */
-
- return timespan + '' + format;
- }
-
- var d_pkgs = [];
- var d_haskell_pkgs = [];
- var d_pkgs_perc = [];
- var d_buildtime = [];
- var d_haskell_buildtime = [];
- var d_buildtime_perc = [];
- '''
-for rec in cur:
- timestamp = int(rec['day'].strftime('%s'))*1000 + 1000*60*60*12
- print "d_pkgs.push([%s, %s])\n" % (timestamp, rec['pkgs']);
- print "d_haskell_pkgs.push([%s, %s])\n" % (timestamp, rec['haskell_pkgs'] or 'null');
- print "d_pkgs_perc.push([%s, %s])\n" % (timestamp,
- float(rec['haskell_pkgs'] or 0)/float(rec['pkgs']) * 100);
-
- print "d_buildtime.push([%s, %s])\n" % (timestamp, rec['total_build_time'] or 0);
- print "d_haskell_buildtime.push([%s, %s])\n" % (timestamp, rec['haskell_total_build_time'] or 'null');
- print "d_buildtime_perc.push([%s, %s])\n" % (timestamp,
- float(rec['haskell_total_build_time'] or 0)/float(rec['total_build_time'] or 1) * 100);
-
-print '''
- var d = [
- {
- data: d_pkgs,
- label: "# uploads",
- lines: {
- fill: true,
- lineWidth: 0,
- },
- }, {
- data: d_haskell_pkgs,
- label: "# haskell uploads",
- lines: {
- fill: 1,
- lineWidth: 0,
- },
- }, {
- data: d_pkgs_perc,
- label: "percentage",
- yaxis: 2,
- lines: { lineWidth: 1, },
- shadowSize: 0
- } ];
-
- var d2 = [
- {
- data: d_buildtime,
- label: "buildtime",
- lines: {
- fill: true,
- lineWidth: 0,
- },
- }, {
- data: d_haskell_buildtime,
- label: "haskell buildtime",
- fill: 1,
- lines: {
- fill: 1,
- lineWidth: 0,
- },
- }, {
- data: d_buildtime_perc,
- label: "percentage",
- yaxis: 2,
- lines: { lineWidth: 1, },
- shadowSize: 0
- } ];
-
- var options = {
- xaxis: {
- mode: "time",
- minTickSize: [1, "day"],
- },
- legend: { position: 'nw'},
- yaxes: [
- {
- min: 0,
- labelWidth: 100,
- }, {
- min: 0,
- max: 100,
- tickFormatter: percFormatter,
- position: 'right',
- } ],
- selection: {mode: "x"},
- };
- var options2 = {
- xaxis: {
- mode: "time",
- minTickSize: [1, "day"],
- },
- legend: { position: 'nw'},
- yaxes: [{
- min: 0,
- labelWidth: 100,
- tickFormatter: timespanFormatter,
- max: 60*60*24,
- }, {
- min: 0,
- max: 100,
- tickFormatter: percFormatter,
- position: 'right',
- } ],
- selection: {mode: "x"},
- };
- var plot = $.plot("#placeholder", d, options);
- var plot2 = $.plot("#placeholder2", d2, options2);
- var overview = $.plot("#overview", [d[0], d[1]], {
- xaxis: {
- mode: "time",
- minTickSize: [1, "year"],
- },
- yaxes: [ { show: false}, { show: false} ],
- selection: {mode: "x"},
- series: {
- lines: {
- show: true,
- lineWidth: 1
- },
- shadowSize: 0
- },
- legend: { show: false },
- });
-
- function setRange(ranges) {
- // do the zooming
- plot = $.plot("#placeholder", d, $.extend(true, {}, options, {
- xaxis: {
- min: ranges.xaxis.from,
- max: ranges.xaxis.to
- }
- }));
- plot2 = $.plot("#placeholder2", d2, $.extend(true, {}, options2, {
- xaxis: {
- min: ranges.xaxis.from,
- max: ranges.xaxis.to
- }
- }));
-
- // don't fire event on the overview to prevent eternal loop
- overview.setSelection(ranges, true);
-
- // Calculate stats
- function sumup(array) {
- var sum = 0;
- for (var i = 0; i < array.length; i++) {
- if(ranges.xaxis.from <= array[i][0] && array[i][0] <= ranges.xaxis.to) {
- if (array[i][1]) sum += array[i][1];
- }
- }
- return sum;
- }
- var alluploads = sumup(d_pkgs);
- var haskelluploads = sumup(d_haskell_pkgs);
- $("#alluploads").text(alluploads);
- $("#haskelluploads").text(haskelluploads);
- if (alluploads> 0) {
- $("#uploadsperc").text((haskelluploads/alluploads * 100).toFixed() + "%%");
- } else {
- $("#uploadsperc").text("\u2014");
- }
-
- var allbuildtime = sumup(d_buildtime);
- var haskellbuildtime = sumup(d_haskell_buildtime);
- $("#allbuildtime").text(timespanFormatter(allbuildtime));
- $("#haskellbuildtime").text(timespanFormatter(haskellbuildtime));
- if (allbuildtime > 0) {
- $("#buildtimeperc").text((haskellbuildtime/allbuildtime * 100).toFixed() + "%%");
- } else {
- $("#buildtimeperc").text("\u2014");
- }
-
- if (alluploads > 0) {
- var allavgbuildtime = allbuildtime / alluploads
- $("#allavgbuildtime").text(timespanFormatter(allavgbuildtime));
- } else {
- $("#allavgbuildtime").text("\u2014");
- }
- if (haskelluploads > 0) {
- var haskellavgbuildtime = haskellbuildtime / haskelluploads
- $("#haskellavgbuildtime").text(timespanFormatter(haskellavgbuildtime));
- } else {
- $("#haskellavgbuildtime").text("\u2014");
- }
-
- var wattage = 472; // http://www.vertatique.com/average-power-use-server
- var kgco2perkwh = 0.5925; // http://www.carbonfund.org/how-we-calculate
- var allco2 = ((allbuildtime / (60*60)) * wattage / 1000) * kgco2perkwh;
- var haskellco2 = ((haskellbuildtime / (60*60)) * wattage / 1000) * kgco2perkwh;
- $("#allco2").text(allco2.toFixed()+ "kg");
- $("#haskellco2").text(haskellco2.toFixed()+ "kg");
- $("#wattage").text(wattage);
- $("#kgco2perkwh").text(kgco2perkwh);
- }
-
-
- $("#placeholder").bind("plotselected", function (event, ranges) {
- setRange(ranges);
- });
-
- $("#placeholder2").bind("plotselected", function (event, ranges) {
- plot.setSelection(ranges);
- });
- $("#overview").bind("plotselected", function (event, ranges) {
- plot.setSelection(ranges);
- });
-
- function setRangeFromNow(days) {
- var now = new Date().getTime();
- var then = now - 1000*60*60*24*days;
- setRange({xaxis:{from: then, to: now}});
- }
-
- $("#lastweek").click(function(){setRangeFromNow(7)});
- $("#lastmonth").click(function(){setRangeFromNow(31)});
- $("#lastyear").click(function(){setRangeFromNow(266)});
- setRangeFromNow(7);
-
- function checkPerc(){
- d[2].lines.lineWidth = ($("#toggle-perc").is(':checked')? 1 : 0);
- plot.setData(d);
- plot.draw();
- d2[2].lines.lineWidth = ($("#toggle-perc").is(':checked')? 1 : 0);
- plot2.setData(d2);
- plot2.draw();
- }
- checkPerc();
- $("#toggle-perc").change(checkPerc);
-
- $("#flotversion").text($.plot.version);
- });
- </script>
- </head>
- <body>
- <table>
- <tr>
- <td>
- <div id="placeholder" class="demo-placeholder"></div>
- <div id="placeholder2" class="demo-placeholder"></div>
- <div id="overview" class="demo-placeholder"></div>
- </td>
- <td valign="top">
- <h3>What is this?</h3>
- <p>
- This plots the number and buildtimes of uploads to the Debian buildd database
- on architecture %(arch)s, with special emphasis on packages by the Debian Haskell
- Group. The statistics below combine the data from the selected range; you can
- select ranges by dragging in the graphs, or by using the buttons below.
- </p>
- <p>
- This was created by Joachim Breitner <<a
- href="mailto:nomeata at debian.org">nomeata at debian.org</a>>, and the source can
- be found in the Debian Haskell Group's <a
- href="http://darcs.debian.org/pkg-haskell/tools/buildd-stats.py">tools
- repo</a>. Improvements are welcome, especially with regard to the HTML styling.
- </p>
- <p>
- The graphs are generated with <a href="http://www.flotcharts.org/">Flot</a> version <span id="flotversion"></span>.
- </p>
-
- <h3>Control</h3>
- <input checked="checked" type='checkbox' id="toggle-perc" name='toggle-perc'/><label for='toggle-perc'>Show percentages</label><br/>
- Select range:
- <button id="lastweek" type="button">Last week</button>
- <button id="lastmonth" type="button">Last month</button>
- <button id="lastyear" type="button">Last year</button>
-
- <h3>Statistics</h3>
-
- <table class="stats">
- <thead><th> </th><th>All</th><th colspan="2">Haskell</th></thead>
- <tbody>
- <tr><th># uploads:</th><td id="alluploads"/><td id="haskelluploads"/><td id="uploadsperc"/></tr>
- <tr><th>buildtime:</th><td id="allbuildtime"/><td id="haskellbuildtime"/><td id="buildtimeperc"/></tr>
- <tr><th>avg. buildtime:</th><td id="allavgbuildtime"/><td id="haskellavgbuildtime"/><td> </td></tr>
- <tr><th>CO<sub>2</sub>:<sup>*</sup></th><td id="allco2"/><td id="haskellco2"/><td> </td></tr>
- </tbody>
- </table>
- <div style="font-size:small; text-align:right">
- <sup>*</sup>CO<sub>2</sub> production based on <a href="http://www.vertatique.com/average-power-use-server"><span id="wattage"></span> Watt</a> and <a href="http://www.carbonfund.org/how-we-calculate"><span id="kgco2perkwh"></span> kg CO<sub>2</sub>/kWh</a>.
- </div>
- </td>
- </tr>
- </table>
- ''' % { 'arch': ARCH }
-
-print '''
- </body>
- </html>
- '''
diff --git a/deploy-binNMU-to-wuiet.sh b/deploy-binNMU-to-wuiet.sh
new file mode 100755
index 0000000..4a7a3ba
--- /dev/null
+++ b/deploy-binNMU-to-wuiet.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+set -e
+schroot -c wheezy-haskell -- /opt/ghc/7.6.3/bin/ghc -DSQL -pgmP cpphs -optP --cpp -no-user-package-db -package-db=wheezy-sandbox/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/ --make -O binNMUs
+rsync -i binNMUs wuiet:
+rsync -i binNMUs paradis:
diff --git a/haskell-pkg-debcheck-exp.hs b/haskell-pkg-debcheck-exp.hs
deleted file mode 100644
index 415c799..0000000
--- a/haskell-pkg-debcheck-exp.hs
+++ /dev/null
@@ -1,380 +0,0 @@
-{-# LANGUAGE PatternGuards #-}
-
-import System.Directory
-import System.Process
-import Control.Monad
-import Control.Applicative
-import Data.Functor.Identity
-import Data.Maybe
-import Data.List
-import Data.List.Split
-import Data.Hashable
-import System.IO
-import Text.XML.HaXml hiding ((!),when)
-import Text.XML.HaXml.Posn (noPos)
-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.GZip as GZip
-import Debian.Control
-import Debian.Control.ByteString
-import Debian.Relation
-import Debian.Relation.ByteString
-import Debian.Version
-import Debian.Version.ByteString
-import qualified Data.HashMap.Lazy as M
--- import Data.Map ((!))
-import qualified Data.HashSet as S
-import Debug.Trace
-import Text.Printf
-import Text.PrettyPrint.ANSI.Leijen (displayS, renderCompact)
-
-m ! k = case M.lookup k m of
- Just x -> x
- Nothing -> error $ "Could not find " ++ show k ++ " in map " ++ take 50 (show m) ++ "..."
-
-type Arch = String
-
-arches :: [Arch]
-arches = ["amd64", "i386"]
---arches = words "amd64 armel armhf hurd-i386 i386 mips mipsel powerpc s390 s390x sparc kfreebsd-amd64 kfreebsd-i386"
-
-
--- File locations
-sourcesFile = "data/experimental-main-Sources.gz"
-binariesFiles arch = "data/experimental-main-binary-" ++ arch ++ "-Packages.gz"
-unstableBinariesFiles arch = "data/unstable-main-binary-" ++ arch ++ "-Packages.gz"
--- wbDump arch = "data/wanna-build-dump-" ++ arch ++ ".gz"
-
-instance Show DebianVersion where showsPrec _ = displayS . renderCompact . prettyDebianVersion
-instance Show Relation where showsPrec _ = displayS . renderCompact . prettyRelation
-
-data SourceInfo = SourceInfo
- { siName :: SrcPkgName
- , siVersion :: DebianVersion
- , siBinaries :: [BinPkgName]
- , siBuildDepends :: Relations
- }
- deriving Show
-
-main = do
- checkFiles
-
- hPutStr stderr "# Reading sources..."
- sourcesMap <-
- toSourcesMap <$>
- (either (error.show) id) <$>
- parseControl "Sources" <$>
- BS.concat <$>
- LB.toChunks <$>
- GZip.decompress <$>
- LB.readFile (sourcesFile)
- hPutStrLn stderr $ show (M.size sourcesMap) ++ " sources selected."
-
- -- Invert the map for easy binary → source lookup
- let bToS = M.fromList $ concat $ map (\(_,si) -> map (\p -> (p,siName si)) (siBinaries si)) $ M.toList sourcesMap
-
- hPutStr stderr "# Reading binaries..."
- binaryMap <-
- fmap unions $
- forM arches $ \arch ->
- toBinaryMap arch bToS <$>
- (either (error.show) id) <$>
- parseControl "Binary" <$>
- BS.concat <$>
- LB.toChunks <$>
- GZip.decompress <$>
- LB.readFile (binariesFiles arch)
- hPutStrLn stderr $ show (M.size binaryMap) ++ " binary/arch tuples selected."
-
- hPutStr stderr "# Reading Wanna-Build-State..."
- wbMap <-
- fmap unions $
- forM arches $ \arch ->
- toWBMap arch sourcesMap <$>
- (either (error.show) id) <$>
- parseControl "Wanna-Build" <$> do
- (_, Just wbOut, _, _) <- createProcess $ (proc "wanna-build" ["-A",arch,"--export","/dev/fd/1","-d", "experimental"]) { std_out = CreatePipe }
- BS.hGetContents wbOut
- hPutStrLn stderr $ show (M.size wbMap) ++ " source/arch tuples selected."
-
- hPutStr stderr "# Reading edos-debcheck output..."
- problems <- removeArchAll <$> collectEdosOutput (filter isNotIgnored (M.keys bToS))
- hPutStrLn stderr $ show (length problems) ++ " problems detected."
-
- let outdatedSources = M.fromListWith mergeArches $ do -- list monad
- ((s,a),(st,dw)) <- M.toList wbMap
- guard $ st /= "Installed"
- let sv = siVersion (sourcesMap ! s)
- return (s::SrcPkgName,(S.singleton a, sv, "dummy"))
-
- let nmus = M.fromListWith mergeArches $ do
- (p,a,v,x) <- problems
- guard $ (p,a) `member` binaryMap
- let s = bToS ! p :: SrcPkgName
- si = sourcesMap ! s
- (bv,bsv) = binaryMap ! (p,a)
- sv = siVersion si
- -- Do not schedule binNMUs for problems in older packages (e.g. in unstable)
- guard (bv == v)
- -- Do not schedule binNMUs for outdated sources
- guard (bsv == sv)
- --guard (not (s `member` outdatedSources))
-
- -- Do not scheulde binNMUs if not in Installed state
- guard (fst (wbMap ! (s,a)) == "Installed")
- return (s,(S.singleton a, sv, formatReason x))
-
- forM (M.toList nmus) $ \(s,(as,sv,exp)) -> putStrLn $ "nmu " ++ unSrcPkgName s ++ "_" ++ show sv ++ " . " ++ unwords (S.toList as) ++ " . experimental . -m '" ++ exp ++ "'"
-
- {-
- let buildingSources = unionWith mergeArches outdatedSources nmus
-
- let depwaits = filterExistingDepWaits wbMap $
- M.fromListWith (unionWith mergeRelations) $ do
- (s,(as,sv,_)) <- M.toList buildingSources
- a <- S.toList as
- bdep <- flattenRelations (siBuildDepends (sourcesMap ! s))
- guard (isNotIgnored bdep)
- guard (bdep `member` bToS)
- let dsi = sourcesMap ! (bToS ! bdep)
- dw <-
- (do
- -- DepWait upon packages that are yet to be built
- guard $ siName dsi `member` outdatedSources
- -- on this architecute
- guard $ a `S.member` (let (as,_,_) = outdatedSources ! siName dsi in as)
- -- unless this package is non-existant on this architecture
- guard $ (bdep,a) `member` binaryMap
- let dwv = siVersion dsi
- return $ [[(Rel bdep (Just (GRE dwv)) Nothing )]]
- ) ++
- (do
- guard $ siName dsi `member` nmus
- guard $ a `S.member` (let (as,_,_) = nmus ! siName dsi in as)
- guard $ (bdep,a) `member` binaryMap
- let dwv = fst (binaryMap ! (bdep,a))
- return $ [[(Rel bdep (Just (SGR dwv)) Nothing)]]
- )
- return ((s,sv),M.singleton a dw)
-
- forM (M.toList depwaits) $ \((s,sv),m) -> do
- -- Reorder to collapse dw lines with identical depwait command
- let m2 = M.fromListWith S.union $ do
- (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 "# "
- -}
- when f $ putStrLn $ "dw " ++ s ++ "_" ++ show sv ++ " . " ++ unwords (S.toList as) ++ " . -m '" ++ showRelations dws ++ "'"
- -}
-
-interestingSource si = BinPkgName "haskell-devscripts" `elem` (flattenRelations (siBuildDepends si)) &&
- BinPkgName "ghc6" `notElem` (flattenRelations (siBuildDepends si))
-
-mergeArches n1@(as1, v1, x1) n2@(as2, v2, x2)
- | v1 == v2 = (as1 `S.union` as2, v1, x1)
- | v1 > v2 = n1
- | v1 < v2 = n2
-
-toSourcesMap =
- M.fromListWith higherSourceVersion .
- mapMaybe (\para -> do -- Maybe monad
- p <- SrcPkgName . BS.unpack <$> fieldValue "Package" para
- a <- BS.unpack <$> fieldValue "Architecture" para
- guard (a /= "all")
- v <- parseDebianVersion <$>
- fieldValue "Version" para
- bins <-
- flattenRelations <$>
- (either (error.show) id) <$>
- parseRelations <$>
- fieldValue "Binary" para
- bd <-
- (either (error.show) id) <$>
- parseRelations <$>
- fieldValue "Build-Depends" para
- let si = SourceInfo p v bins bd
- guard (interestingSource si)
- return (p, si)
- ) .
- unControl
-
-toBinaryMap arch bToS =
- M.fromList .
- mapMaybe (\para -> do -- Maybe monad
- p <- BinPkgName . BS.unpack <$>
- fieldValue "Package" para
- guard (p `member` bToS)
- guard (isNotIgnored p)
- v <- parseDebianVersion <$>
- fieldValue "Version" para
- sf <- BS.unpack <$>
- fieldValue "Source" para
- -- extract the source name and version if both are given
- let (s,sv) = case words sf of
- [s,('(':sv)] -> (s, parseDebianVersion (init sv))
- [s] -> (s,v)
- guard (SrcPkgName s == bToS ! p)
- return ((p,arch), (v,sv))
- ) .
- unControl
-
-toWBMap :: Arch -> M.HashMap SrcPkgName SourceInfo -> Control' (BS.ByteString) -> M.HashMap (SrcPkgName, Arch) ([Char], Relations)
-toWBMap arch sourcesMap =
- M.fromList .
- mapMaybe (\para -> do -- Maybe monad
- s <- SrcPkgName . BS.unpack <$>
- fieldValue "package" para
- guard (s `member` sourcesMap)
- v <- parseDebianVersion <$>
- fieldValue "version" para
- st <- BS.unpack <$>
- fieldValue "state" para
- -- Consider all the posibilities here: What if wanna-build is newer,
- -- what if it is older?
- when (v /= siVersion (sourcesMap ! s)) $
- unless (st `elem` ["Failed-Removed", "Not-For-Us"]) $
- trace (printf "Version difference for %s on %s in state %s: \
- \wb knows %s and Sources knows %s"
- (unSrcPkgName s)
- arch
- st
- (show v)
- (show (siVersion (sourcesMap ! s)))) $
- return ()
- guard (v == siVersion (sourcesMap ! s))
- dw <- (
- (either (error.show) id) <$>
- parseRelations <$>
- fieldValue "depends" para
- ) `mplus` Just []
- return ((s,arch), (st,dw))
- ) .
- unControl
-
-flattenRelations :: Relations -> [BinPkgName]
-flattenRelations = map (\(Rel p _ _) -> p) . concat
-
-higherSourceVersion si1 si2 = if siVersion si1 > siVersion si2 then si1 else si2
-
-checkFiles :: IO ()
-checkFiles =
- forM_ (sourcesFile : map binariesFiles arches ++ map unstableBinariesFiles arches {- ++ map wbDump arches -}) $ \file -> do
- ex <- doesFileExist file
- unless ex $ do
- hPutStrLn stderr $ "# Missing expected file: " ++ file
-
-collectEdosOutput :: [BinPkgName] -> IO [(BinPkgName, Arch, DebianVersion, String)]
-collectEdosOutput pkgs = fmap concat $ forM arches $ \arch -> do
- --(_, Just zcatOut, _, _) <- createProcess $ (proc "zcat" [binariesFiles arch]) { std_out = CreatePipe }
- (Just edosIn, Just edosOut, _, _) <- createProcess $ (proc "edos-debcheck" ["-xml","-failures","-explain","-checkonly", intercalate "," (map unBinPkgName pkgs)]) { std_in = CreatePipe, std_out = CreatePipe }
- LB.readFile (unstableBinariesFiles arch) >>= LB.hPutStr edosIn . GZip.decompress
- LB.readFile (binariesFiles arch) >>= LB.hPutStr edosIn . GZip.decompress
- hClose edosIn
- 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)
- return $ map (\((((p,a),v),s),_) -> (BinPkgName p, a, parseDebianVersion v, s)) (filter (CElem root noPos))
-
-removeArchAll :: [(BinPkgName, Arch, DebianVersion, String)] -> [(BinPkgName, Arch, DebianVersion, String)]
-removeArchAll = filter (\(_,a,_,_) -> a /= "all")
-
-isNotIgnored :: BinPkgName -> Bool
-isNotIgnored pkg = not ("-doc" `isSuffixOf` unBinPkgName pkg || "-prof" `isSuffixOf` unBinPkgName pkg)
-
-formatReason :: String -> String
-formatReason s = "Dependency " ++ packageName ++ " not available any more"
- where lastLine = last (lines s)
- packageName = drop 4 lastLine
-
-filterExistingDepWaits wbMap = mapWithKey $ \(s,v) -> mapWithKey $ \a dw ->
- case (s,a) `M.lookup` wbMap of
- Just (_,cdw@(_:_)) -> if cdw `impliesRelations` dw
- then (False, dw)
- else (True, dw)
- _ -> (True, dw)
-
--- This needs to be improved:
-mergeRelations :: AndRelation -> AndRelation -> AndRelation
-mergeRelations r1 r2 = sort (go r1 r2)
- where go rel1 [] = rel1
- go rel1 ([r]:rs) = go (sortIn rel1 r) rs
- go rel1 (r:rs) = r : go rel1 rs -- Do not merge OrRelations
-
- sortIn :: AndRelation -> Relation -> AndRelation
- sortIn [] r2 = [[r2]]
- sortIn (r1s:rs) r2
- | length r1s > 1
- = r1s : sortIn rs r2
- sortIn ([r1]:rs) r2
- | not (samePkg r1 r2)
- = [r1] : sortIn rs r2
- | Rel _ _ (Just _) <- r1
- = [r1] : sortIn rs r2
- | Rel _ _ (Just _) <- r2
- = [r1] : sortIn rs r2
- | Rel _ Nothing Nothing <- r1
- = [ r2 ] : rs
- | Rel _ Nothing Nothing <- r2
- = [ r1 ] : rs
- | Rel p1 (Just v1) Nothing <- r1,
- Rel p2 (Just v2) Nothing <- r2
- = [ Rel p1 (Just v) Nothing | v <- mergeVersion v1 v2 ] : rs
-
- mergeVersion (SLT v1) (SLT v2) = [SLT (min v1 v2)]
- mergeVersion (LTE v1) (LTE v2) = [LTE (min v1 v2)]
- mergeVersion (LTE v1) (SLT v2) | v1 < v2 = [LTE v1]
- | otherwise = [SLT v2]
- mergeVersion (SLT v2) (LTE v1) | v1 < v2 = [LTE v1]
- | otherwise = [SLT v2]
- mergeVersion (SGR v1) (SGR v2) = [SGR (max v1 v2)]
- mergeVersion (GRE v1) (GRE v2) = [GRE (max v1 v2)]
- mergeVersion (GRE v1) (SGR v2) | v1 > v2 = [GRE v1]
- | otherwise = [SGR v2]
- mergeVersion (SGR v2) (GRE v1) | v1 > v2 = [GRE v1]
- | otherwise = [SGR v2]
- mergeVersion (EEQ v1) (EEQ v2) | v1 == v2 = [EEQ v1]
- mergeVersion v1 v2 = [v1,v2]
-
--- This is a bit shaky, I hope it wokrs.:
-impliesRelations rs1 rs2 = mergeRelations rs1 rs2 == sort rs1
-
-samePkg (Rel p1 _ _) (Rel p2 _ _) = p1 == p2
-
-showRelations :: [[Relation]] -> [Char]
-showRelations = intercalate ", " . map (intercalate " | " . map show)
-
--- Functions from Data.Map missing in Data.HashMap
-unions :: (Eq k, Hashable k) => [M.HashMap k v] -> M.HashMap k v
-unions = foldl M.union M.empty
-member k = isJust . M.lookup k
-unionWith f m1 m2 = M.foldrWithKey (M.insertWith f) m1 m2
-mapWithKey f = runIdentity . M.traverseWithKey (\k v -> Identity (f k v))
-
-instance Hashable DebianVersion where
- hashWithSalt s = hashWithSalt s . evr
-instance Hashable Relation where
- hashWithSalt s (Rel n r a) = hashWithSalt s (n,r,a)
-instance Hashable ArchitectureReq where
- hashWithSalt s (ArchOnly as) = hashWithSalt s (1::Int,as)
- hashWithSalt s (ArchExcept as) = hashWithSalt s (2::Int,as)
-instance Hashable VersionReq where
- hashWithSalt s (SLT v) = hashWithSalt s (1::Int,v)
- hashWithSalt s (LTE v) = hashWithSalt s (2::Int,v)
- hashWithSalt s (EEQ v) = hashWithSalt s (3::Int,v)
- hashWithSalt s (GRE v) = hashWithSalt s (4::Int,v)
- hashWithSalt s (SGR v) = hashWithSalt s (5::Int,v)
-instance Hashable SrcPkgName where
- hashWithSalt s = hashWithSalt s . unSrcPkgName
-instance Hashable BinPkgName where
- hashWithSalt s = hashWithSalt s . unBinPkgName
-
-
---instance Show a => Show (S.HashSet a) where
--- show s = "fromList " ++ show (S.toList s)
diff --git a/haskell-pkg-debcheck.hs b/haskell-pkg-debcheck.hs
deleted file mode 100644
index 53ac588..0000000
--- a/haskell-pkg-debcheck.hs
+++ /dev/null
@@ -1,420 +0,0 @@
-{-# LANGUAGE PatternGuards, StandaloneDeriving, GeneralizedNewtypeDeriving, DeriveGeneric, ScopedTypeVariables, OverloadedStrings #-}
-
-import System.Directory
-import System.Process
-import Control.Monad
-import Control.Applicative
-import Data.Functor.Identity
-import Data.Maybe
-import Data.List
-import Data.List.Split
-import Data.Hashable
-import System.IO
-import qualified Data.ByteString.Char8 as BS
-import qualified Data.ByteString.Lazy as LB
---import qualified Codec.Compression.BZip as BZip
-import Data.Yaml
-import qualified Codec.Compression.GZip as GZip
-import Debian.Control
-import Debian.Control.ByteString
-import Debian.Relation hiding (Arch)
-import Debian.Relation.ByteString
-import Debian.Version
-import Debian.Version.ByteString
-import qualified Debian.Arch
-import qualified Data.HashMap.Strict as M
-import Debian.Pretty (pretty)
--- import Data.Map ((!))
-import qualified Data.HashSet as S
-import Debug.Trace
-import GHC.Generics
-import Text.Printf
-import qualified Data.Vector as V
-import qualified Data.Text as T
-import Data.Function
-
-m ! k = case M.lookup k m of
- Just x -> x
- Nothing -> error $ "Could not find " ++ show k ++ " in map " ++ take 250 (show m) ++ "..."
-
-type Arch = String
-
-
---arches :: [Arch]
---arches = ["amd64", "i386"]
-arches = words "amd64 armel armhf hurd-i386 i386 mips mipsel powerpc s390x sparc kfreebsd-amd64 kfreebsd-i386"
-
--- File locations
-sourcesFile = "data/unstable-main-Sources.gz"
-binariesFiles arch = "data/unstable-main-binary-" ++ arch ++ "-Packages.gz"
-wbDump arch = "data/wanna-build-dump-" ++ arch ++ ".gz"
-
---instance Show DebianVersion where show v = render (prettyDebianVersion v)
---instance Show Relation where show v = render (prettyRelation v)
-
-data SourceInfo = SourceInfo
- { siName :: SrcPkgName
- , siVersion :: DebianVersion
- , siBinaries :: [BinPkgName]
- , siBuildDepends :: Relations
- }
- deriving Show
-
-type SourcesMap = M.HashMap SrcPkgName SourceInfo
-type BinaryMap = M.HashMap (BinPkgName, Arch) (DebianVersion, DebianVersion)
-type BToS = M.HashMap BinPkgName SrcPkgName
-type WBMap = M.HashMap (SrcPkgName, Arch) (String, [OrRelation])
-type CFile = Control' BS.ByteString
-
-main = do
- checkFiles
-
- hPutStr stderr "# Reading sources..."
- (sourcesMap :: SourcesMap) <-
- toSourcesMap <$>
- (either (error.show) id) <$>
- parseControl "Sources" <$>
- BS.concat <$>
- LB.toChunks <$>
- GZip.decompress <$>
- LB.readFile (sourcesFile)
- hPutStrLn stderr $ show (M.size sourcesMap) ++ " sources selected."
-
- -- Invert the map for easy binary → source lookup
- let bToS = M.fromList $ concat $ map (\(_,si) -> map (\p -> (p,siName si)) (siBinaries si)) $ M.toList sourcesMap
-
- hPutStr stderr "# Reading binaries..."
- (binaryMap :: BinaryMap) <-
- fmap unions $
- forM arches $ \arch ->
- toBinaryMap arch bToS <$>
- (either (error.show) id) <$>
- parseControl "Binary" <$>
- BS.concat <$>
- LB.toChunks <$>
- GZip.decompress <$>
- LB.readFile (binariesFiles arch)
- hPutStrLn stderr $ show (M.size binaryMap) ++ " binary/arch tuples selected."
-
- hPutStr stderr "# Reading Wanna-Build-State..."
- (wbMap :: WBMap) <-
- fmap unions $
- forM arches $ \arch ->
- toWBMap arch sourcesMap <$>
- (either (error.show) id) <$>
- parseControl "Wanna-Build" <$>
- BS.concat <$>
- LB.toChunks <$>
- GZip.decompress <$>
- LB.readFile (wbDump arch)
- hPutStrLn stderr $ show (M.size wbMap) ++ " source/arch tuples selected."
-
- hPutStr stderr "# Reading dose-debcheck output..."
- problems <- removeArchAll <$> collectEdosOutput (filter isNotIgnored (M.keys bToS))
- hPutStrLn stderr $ show (length problems) ++ " problems detected."
-
- let outdatedSources = M.fromListWith mergeArches $ do -- list monad
- ((s,a),(st,dw)) <- M.toList wbMap
- guard $ st /= "Installed"
- let sv = siVersion (sourcesMap ! s)
- return (s,(S.singleton a, sv, "dummy"))
-
- let nmus = M.fromListWith mergeArches $ do
- (p,a,_,x) <- problems
- guard $ (p,a) `member` binaryMap
- let s = bToS ! p
- si = sourcesMap ! s
- (_,bsv) = binaryMap ! (p,a)
- sv = siVersion si
- -- Do not schedule binNMUs for outdated sources
- guard (bsv == sv)
- --guard (not (s `member` outdatedSources))
-
- -- Do not scheulde binNMUs if not in Installed state
- guard (fst (wbMap ! (s,a)) == "Installed")
- return (s,(S.singleton a, sv, x))
-
- forM (sortBy (compare `on` fst) $ M.toList nmus) $
- \(s,(as,sv,exp)) -> putStrLn $ "nmu " ++ show (pretty s) ++ "_" ++ show (prettyDebianVersion sv) ++ " . " ++ unwords (S.toList as) ++ " . -m '" ++ exp ++ "'"
-
- let buildingSources = unionWith mergeArches outdatedSources nmus
-
- let depwaits = filterExistingDepWaits wbMap $
- M.fromListWith (unionWith mergeRelations) $ do
- (s,(as,sv,_)) <- M.toList buildingSources
- a <- S.toList as
- bdep <- flattenRelations (siBuildDepends (sourcesMap ! s))
- guard (isNotIgnored bdep)
- guard (bdep `member` bToS)
- let dsi = sourcesMap ! (bToS ! bdep)
- dw <-
- (do
- -- DepWait upon packages that are yet to be built
- guard $ siName dsi `member` outdatedSources
- -- on this architecute
- guard $ a `S.member` (let (as,_,_) = outdatedSources ! siName dsi in as)
- -- unless this package is non-existant on this architecture
- guard $ (bdep,a) `member` binaryMap
- let dwv = siVersion dsi
- return $ [[(Rel bdep (Just (GRE dwv)) Nothing )]]
- ) ++
- (do
- guard $ siName dsi `member` nmus
- guard $ a `S.member` (let (as,_,_) = nmus ! siName dsi in as)
- guard $ (bdep,a) `member` binaryMap
- let dwv = fst (binaryMap ! (bdep,a))
- return $ [[(Rel bdep (Just (SGR dwv)) Nothing)]]
- )
- return ((s,sv),M.singleton a dw)
-
- forM (M.toList depwaits) $ \((s,sv),m) -> do
- -- Reorder to collapse dw lines with identical depwait command
- let m2 = M.fromListWith S.union $ do
- (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 "# "
- -}
- when f $ putStrLn $ "dw " ++ show (pretty s) ++ "_" ++ show (prettyDebianVersion sv) ++ " . " ++ unwords (S.toList as) ++ " . -m '" ++ showRelations dws ++ "'"
-
-interestingSource si = BinPkgName "haskell-devscripts" `elem` (flattenRelations (siBuildDepends si)) &&
- BinPkgName "ghc6" `notElem` (flattenRelations (siBuildDepends si))
-
-mergeArches n1@(as1, v1, x1) n2@(as2, v2, x2)
- | v1 == v2 = (as1 `S.union` as2, v1, x1)
- | v1 > v2 = n1
- | v1 < v2 = n2
-
-toSourcesMap :: CFile -> SourcesMap
-toSourcesMap =
- M.fromListWith higherSourceVersion .
- mapMaybe (\para -> do -- Maybe monad
- p <- (SrcPkgName . BS.unpack) <$> fieldValue "Package" para
- guard (p /= SrcPkgName "clisp")
- a <- BS.unpack <$> fieldValue "Architecture" para
- guard (a /= "all")
- v <- parseDebianVersion <$>
- fieldValue "Version" para
- bins <-
- flattenRelations <$>
- (either (error.show) id) <$>
- parseRelations <$>
- fieldValue "Binary" para
- bd <-
- (either (error.show) id) <$>
- parseRelations <$>
- fieldValue "Build-Depends" para
- let si = SourceInfo p v bins bd
- guard (interestingSource si)
- return (p, si)
- ) .
- unControl
-
-toBinaryMap :: Arch -> BToS -> CFile -> BinaryMap
-toBinaryMap arch bToS =
- M.fromList .
- mapMaybe (\para -> do -- Maybe monad
- p <- (BinPkgName . BS.unpack) <$>
- fieldValue "Package" para
- guard (p `member` bToS)
- guard (isNotIgnored p)
- v <- parseDebianVersion <$>
- fieldValue "Version" para
- sf <- BS.unpack <$>
- fieldValue "Source" para
- -- extract the source name and version if both are given
- let (s,sv) = case words sf of
- [s,('(':sv)] -> (SrcPkgName s, parseDebianVersion (init sv))
- [s] -> (SrcPkgName s,v)
- guard (s == bToS ! p)
- return ((p,arch), (v,sv))
- ) .
- unControl
-
-toWBMap :: Arch -> SourcesMap -> CFile -> WBMap
-toWBMap arch sourcesMap =
- M.fromList .
- mapMaybe (\para -> do -- Maybe monad
- s <- (SrcPkgName . BS.unpack) <$>
- fieldValue "package" para
- guard (s `member` sourcesMap)
- v <- parseDebianVersion <$>
- fieldValue "version" para
- st <- BS.unpack <$>
- fieldValue "state" para
- -- Consider all the posibilities here: What if wanna-build is newer,
- -- what if it is older?
- when (v /= siVersion (sourcesMap ! s)) $
- unless (st `elem` ["Failed-Removed", "Not-For-Us"]) $
- trace (printf "Version difference for %s on %s in state %s: \
- \wb knows %s and Sources knows %s"
- (show (pretty s))
- arch
- st
- (show (prettyDebianVersion v))
- (show (prettyDebianVersion (siVersion (sourcesMap ! s))))) $
- return ()
- guard (v == siVersion (sourcesMap ! s))
- dw <- (
- (either (error.show) id) <$>
- parseRelations <$>
- fieldValue "depends" para
- ) `mplus` Just []
- return ((s,arch), (st,dw))
- ) .
- unControl
-
-flattenRelations :: Relations -> [BinPkgName]
-flattenRelations = map (\(Rel p _ _) -> p) . concat
-
-higherSourceVersion si1 si2 = if siVersion si1 > siVersion si2 then si1 else si2
-
-checkFiles :: IO ()
-checkFiles =
- forM_ (sourcesFile : map binariesFiles arches ++ map wbDump arches ) $ \file -> do
- ex <- doesFileExist file
- unless ex $ do
- hPutStrLn stderr $ "# Missing expected file: " ++ file
-
-collectEdosOutput :: [BinPkgName] -> IO [(BinPkgName, Arch, DebianVersion, String)]
-collectEdosOutput pkgs = fmap concat $ forM arches $ \arch -> do
- (_, doseOut, _) <- readProcessWithExitCode "dose-debcheck" ["--failures","--explain","--checkonly", intercalate "," (map unBinPkgName pkgs), binariesFiles arch] ""
- Object o <- case decodeEither (BS.pack doseOut) of
- Left e -> fail $ "Failed to parse dose output: " ++ show e
- Right v -> return v
- let reports = case M.lookup "report" o of Just (Array v) -> V.toList v
- _ -> []
- return $ map fromReport reports
- where
- fromReport (Object o) = ( BinPkgName $ str "package"
- , str "architecture"
- , parseDebianVersion $ str "version"
- , formatReason (o M.! "reasons")
- )
- where str n = let String s = o M.! n in T.unpack s
-
-removeArchAll :: [(BinPkgName, Arch, DebianVersion, String)] -> [(BinPkgName, Arch, DebianVersion, String)]
-removeArchAll = filter (\(_,a,_,_) -> a /= "all")
-
-isNotIgnored :: BinPkgName -> Bool
-isNotIgnored pkg = not ("-doc" `isSuffixOf` unBinPkgName pkg || "-prof" `isSuffixOf` unBinPkgName pkg)
-
-formatReason :: Value -> String
-formatReason (Array rs) =
- intercalate ", " $
- [ "missing " ++ T.unpack dep
- | Object r <- V.toList rs
- , Just (Object m) <- return $ M.lookup "missing" r
- , let Object p = m ! "pkg"
- , let String dep = p ! "unsat-dependency"
- ] ++
- [ printf "conflict between %s-%s and %s-%s"
- (T.unpack p1) (T.unpack v1) (T.unpack p2) (T.unpack v2)
- | Object r <- V.toList rs
- , Just (Object c) <- return $ M.lookup "conflict" r
- , let Object pk1 = c ! "pkg1"
- , let Object pk2 = c ! "pkg2"
- , let String p1 = pk1 ! "package"
- , let String v1 = pk1 ! "version"
- , let String p2 = pk2 ! "package"
- , let String v2 = pk2 ! "version"
- ]
-
-filterExistingDepWaits wbMap = mapWithKey $ \(s,v) -> mapWithKey $ \a dw ->
- case (s,a) `M.lookup` wbMap of
- Just (_,cdw@(_:_)) -> if cdw `impliesRelations` dw
- then (False, dw)
- else (True, dw)
- _ -> (True, dw)
-
--- This needs to be improved:
-mergeRelations :: AndRelation -> AndRelation -> AndRelation
-mergeRelations r1 r2 = sort (go r1 r2)
- where go rel1 [] = rel1
- go rel1 ([r]:rs) = go (sortIn rel1 r) rs
- go rel1 (r:rs) = r : go rel1 rs -- Do not merge OrRelations
-
- sortIn :: AndRelation -> Relation -> AndRelation
- sortIn [] r2 = [[r2]]
- sortIn (r1s:rs) r2
- | length r1s > 1
- = r1s : sortIn rs r2
- sortIn ([r1]:rs) r2
- | not (samePkg r1 r2)
- = [r1] : sortIn rs r2
- | Rel _ _ (Just _) <- r1
- = [r1] : sortIn rs r2
- | Rel _ _ (Just _) <- r2
- = [r1] : sortIn rs r2
- | Rel _ Nothing Nothing <- r1
- = [ r2 ] : rs
- | Rel _ Nothing Nothing <- r2
- = [ r1 ] : rs
- | Rel p1 (Just v1) Nothing <- r1,
- Rel p2 (Just v2) Nothing <- r2
- = [ Rel p1 (Just v) Nothing | v <- mergeVersion v1 v2 ] : rs
-
- mergeVersion (SLT v1) (SLT v2) = [SLT (min v1 v2)]
- mergeVersion (LTE v1) (LTE v2) = [LTE (min v1 v2)]
- mergeVersion (LTE v1) (SLT v2) | v1 < v2 = [LTE v1]
- | otherwise = [SLT v2]
- mergeVersion (SLT v2) (LTE v1) | v1 < v2 = [LTE v1]
- | otherwise = [SLT v2]
- mergeVersion (SGR v1) (SGR v2) = [SGR (max v1 v2)]
- mergeVersion (GRE v1) (GRE v2) = [GRE (max v1 v2)]
- mergeVersion (GRE v1) (SGR v2) | v1 > v2 = [GRE v1]
- | otherwise = [SGR v2]
- mergeVersion (SGR v2) (GRE v1) | v1 > v2 = [GRE v1]
- | otherwise = [SGR v2]
- mergeVersion (EEQ v1) (EEQ v2) | v1 == v2 = [EEQ v1]
- mergeVersion v1 v2 = [v1,v2]
-
--- This is a bit shaky, I hope it wokrs.:
-impliesRelations rs1 rs2 = mergeRelations rs1 rs2 == sort rs1
-
-samePkg (Rel p1 _ _) (Rel p2 _ _) = p1 == p2
-
-showRelations = intercalate ", " . map (intercalate " | " . map (show.pretty))
-
--- Functions from Data.Map missing in Data.HashMap
-unions :: (Hashable k, Eq k) => [M.HashMap k v] -> M.HashMap k v
-unions = foldl M.union M.empty
-member k = isJust . M.lookup k
-unionWith f m1 m2 = M.foldrWithKey (M.insertWith f) m1 m2
-mapWithKey f = runIdentity . M.traverseWithKey (\k v -> Identity (f k v))
-
-deriving instance Hashable SrcPkgName
-deriving instance Hashable BinPkgName
-instance Hashable DebianVersion where
- hashWithSalt s = hashWithSalt s . evr
-instance Hashable Relation where
- hashWithSalt s r = hashWithSalt s (show r)
-{-
-instance Hashable ArchitectureReq where
- hashWithSalt s (ArchOnly as) = hashWithSalt s (1::Int,as)
- hashWithSalt s (ArchExcept as) = hashWithSalt s (2::Int,as)
-instance Hashable VersionReq where
- hashWithSalt s (SLT v) = hashWithSalt s (1::Int,v)
- hashWithSalt s (LTE v) = hashWithSalt s (2::Int,v)
- hashWithSalt s (EEQ v) = hashWithSalt s (3::Int,v)
- hashWithSalt s (GRE v) = hashWithSalt s (4::Int,v)
- hashWithSalt s (SGR v) = hashWithSalt s (5::Int,v)
--}
-
-{-
-deriving instance Generic Debian.Arch.Arch
-deriving instance Generic Debian.Arch.ArchOS
-deriving instance Generic Debian.Arch.ArchCPU
-instance Hashable Debian.Arch.ArchOS
-instance Hashable Debian.Arch.ArchCPU
-instance Hashable Debian.Arch.Arch
-deriving instance Hashable BinPkgName
--}
-
---instance Show a => Show (S.HashSet a) where
--- show s = "fromList " ++ show (S.toList s)
diff --git a/haskell-pkg-debcheck.py b/haskell-pkg-debcheck.py
deleted file mode 100755
index 3f61937..0000000
--- a/haskell-pkg-debcheck.py
+++ /dev/null
@@ -1,214 +0,0 @@
-#!/usr/bin/python
-# encoding:utf8
-#
-# Copyright (C) 2009, Joachim Breitner <nomeata at debian.org>
-#
-# Inspired by debian-ocaml-status.py written by Stefano Zacchiroli <zack at debian.org>
-#
-# This program is free software: you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free Software
-# Foundation, either version 2 of the License, or (at your option) any later
-# version.
-
-import bz2
-import datetime
-import gzip
-import os
-import re
-import string
-import sys
-from itertools import *
-
-from debian_bundle import debian_support
-from debian_bundle.debian_support import version_compare
-from debian_bundle.deb822 import PkgRelation, Deb822
-#from genshi.template import TemplateLoader
-
-ghc6_dep_RE = \
- re.compile(r'(^|,)\s*ghc6(\s*\(\s*>=\s*(?P<version>\d+([\.\-+~]\d+)*)\s*\))?')
-
-#arches = ['i386','amd64','powerpc']
-arches = 'amd64 armel hppa i386 ia64 mips mipsel powerpc s390 sparc kfreebsd-amd64 kfreebsd-i386'.split()
-def patch_pkg_dict(entry):
- if not isinstance(entry, dict): # backward compatibility for debian_support
- entry = dict(map(lambda (x, y): (x.lower(), y), entry))
- return entry
-
-def normalize_src(src_value):
- """'Source' field values of binNMU-ed packages are of the form 'src
- (source_version)'. Remove the source_version part so that we can use the
- field as a key in the source package namespace.
-
- E.g. "pxp (1.1.96-8)" -> "pxp"
- """
-
- return src_value.split()[0]
-
-def smart_open(fname):
- """Transparently open a compressed (or not) file."""
-
- f = None
- if fname.endswith('.gz'):
- f = gzip.GzipFile(fname)
- elif fname.endswith('.bz2'):
- f = bz2.BZ2File(fname)
- else:
- f = open(fname)
- return f
-
-# A non-in-place-sort
-def sort(list):
- list.sort()
- return list
-
-class HaskellInfo:
- def is_interesting_source(self, src):
- return (src['package'] == 'ghc6' or self.is_haskell_lib_src(src))
-
- def is_haskell_lib_src(self,src):
- if 'build-depends' in src:
- for rel in PkgRelation.parse_relations(src['build-depends']):
- for opt in rel:
- if opt['name'] == 'ghc6':
- return True
- return False
-
- def is_haskell_lib(self,src):
- if 'build-depends' in src:
- for rel in PkgRelation.parse_relations(src['build-depends']):
- for opt in rel:
- if opt['name'] == 'ghc6':
- return True
- return False
-
- def is_buildable(self,src):
- rels = PkgRelation.parse_relations(src['build-depends'])
- for rel in rels:
- ok = False
- for opt in rel:
- if opt['name'] == 'ghc6':
- if opt['version']:
- (relop,v) = opt['version']
- #print "Comparing %s %s %s" % (self.ghc6version, relop, v)
- cmp = version_compare(self.ghc6version, v)
- if relop == ">=":
- ok = cmp >= 0
- elif relop == "<<":
- ok = cmp < 0
- elif relop == "=":
- ok = cmp == 0
- else:
- print "Do not handle %s yet" % relop
- else:
- #print "%s has an unversioned build-dependency on ghc6." % src['package']
- ok = True
- else:
- # we only consider ghc6 depenencies here
- ok = True
- if not ok: return False
- return True
-
-
-
- def add_incoming_info(status):
- # TODO
- return status
-
- def main(self):
- # sources will contian haskell libraries + ghc6
- self.sources = {}
- f = smart_open("data/unstable-main-Sources.bz2")
- srcfile = debian_support.PackageFile('', file_obj=f)
- try:
- for src in filter(self.is_interesting_source, imap(patch_pkg_dict,srcfile)):
- if src['package'] in self.sources:
- if version_compare(src['version'], self.sources[src['package']]['version']) > 0:
- self.sources[src['package']] = src
- else:
- self.sources[src['package']] = src
- except Exception, e:
- print "E: error while parsing %s, ignoring it." % "data/unstable-main-Sources.bz2"
- print " exception: %s" % e
- f.close()
-
- # Finding ghc6 version
- self.ghc6version = self.sources['ghc6']['version']
- print "# Found ghc6 version %s" % self.ghc6version
-
- # Filter out those with unsatisfiable build dependencies on ghc6
- buildable = set()
- unbuildable = set()
- for src in self.sources.itervalues():
- if self.is_buildable(src):
- buildable.add(src['package'])
- else:
- unbuildable.add(src['package'])
- print "# Found %d haskell library source packages" % len(self.sources)
- print "# ... of which %d are buildable and %d are not buildable." % (len(buildable), len(unbuildable))
-
- if 'ghc6' in unbuildable:
- print "Warning: ghc6 is not buildable!"
-
- for arch in arches:
- print
- print "# Architecture: %s" % arch
- # Create dict of all binaries
- self.packages = {}
- f = smart_open("data/unstable-main-binary-%s-Packages.bz2" % 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 " exception: %s" % e
- f.close()
-
- self.haskell_lib_to_source = {}
-
- # Go through all buildable sources and collect the names of the binaries
- for srcname in buildable:
- src = self.sources[srcname]
- for binary_name in src['binary'].split(", "):
- # Ignore missing packages
- if binary_name not in self.packages: continue
- binary = self.packages[binary_name]
- # Ignore arch-independent packages
- if binary['architecture'] == 'all': continue
-
- self.haskell_lib_to_source[binary_name] = src
- #print "Source %s has binary %s" % (src['package'],binary_name)
-
- self.wannabuild = {}
- f = smart_open("data/wanna-build-dump-%s.gz" % arch)
- try:
- for entry in Deb822.iter_paragraphs(f):
- if 'package' in entry:
- if entry['package'] in self.sources:
- self.wannabuild[entry['package']] = entry
- except Exception, e:
- print "E: error while parsing %s, ignoring it." % ("data/wanna-buid-dump-%s.gz" % arch)
- print " exception: %s" % e
- f.close()
-
- #print self.wannabuild
-
- installed_sources = []
- for srcname in buildable:
- if srcname not in self.wannabuild or \
- self.wannabuild[srcname]['state'] == 'Installed':
- installed_sources.append(srcname)
-
- os.system("cat data/unstable-main-binary-%s-Packages.bz2 | "
- "edos-debcheck -failures -explain -checkonly %s | "
- "tee data/edos-debcheck-%s.txt" % (
- arch,
- ",".join(map(lambda p: "src:"+p, installed_sources)),
- arch))
-
-
-
-
-if __name__ == '__main__':
- HaskellInfo().main()
-
diff --git a/haskell-pkg-infos.py b/haskell-pkg-infos.py
deleted file mode 100755
index fdcb1d4..0000000
--- a/haskell-pkg-infos.py
+++ /dev/null
@@ -1,306 +0,0 @@
-#!/usr/bin/python
-# encoding:utf8
-#
-# Copyright (C) 2009, Joachim Breitner <nomeata at debian.org>
-#
-# Inspired by debian-ocaml-status.py written by Stefano Zacchiroli <zack at debian.org>
-#
-# This program is free software: you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free Software
-# Foundation, either version 2 of the License, or (at your option) any later
-# version.
-
-import bz2
-import datetime
-import gzip
-import os
-import re
-import string
-import sys
-from itertools import *
-
-from debian_bundle import debian_support
-from debian_bundle.debian_support import version_compare
-from debian_bundle.deb822 import PkgRelation, Deb822
-#from genshi.template import TemplateLoader
-
-ghc6_dep_RE = \
- re.compile(r'(^|,)\s*ghc6(\s*\(\s*>=\s*(?P<version>\d+([\.\-+~]\d+)*)\s*\))?')
-
-#arches = ['i386','amd64','powerpc']
-arches = 'amd64 armel hppa i386 ia64 mips mipsel powerpc s390 sparc kfreebsd-amd64 kfreebsd-i386'.split()
-def patch_pkg_dict(entry):
- if not isinstance(entry, dict): # backward compatibility for debian_support
- entry = dict(map(lambda (x, y): (x.lower(), y), entry))
- return entry
-
-def normalize_src(src_value):
- """'Source' field values of binNMU-ed packages are of the form 'src
- (source_version)'. Remove the source_version part so that we can use the
- field as a key in the source package namespace.
-
- E.g. "pxp (1.1.96-8)" -> "pxp"
- """
-
- return src_value.split()[0]
-
-def smart_open(fname):
- """Transparently open a compressed (or not) file."""
-
- f = None
- if fname.endswith('.gz'):
- f = gzip.GzipFile(fname)
- elif fname.endswith('.bz2'):
- f = bz2.BZ2File(fname)
- else:
- f = open(fname)
- return f
-
-# A non-in-place-sort
-def sort(list):
- list.sort()
- return list
-
-class HaskellInfo:
- def is_interesting_source(self, src):
- return (src['package'] == 'ghc6' or self.is_haskell_lib_src(src))
-
- def is_haskell_lib_src(self,src):
- if 'build-depends' in src:
- for rel in PkgRelation.parse_relations(src['build-depends']):
- for opt in rel:
- if opt['name'] == 'ghc6':
- return True
- return False
-
- def is_haskell_lib(self,src):
- if 'build-depends' in src:
- for rel in PkgRelation.parse_relations(src['build-depends']):
- for opt in rel:
- if opt['name'] == 'ghc6':
- return True
- return False
-
- def is_buildable(self,src):
- rels = PkgRelation.parse_relations(src['build-depends'])
- for rel in rels:
- ok = False
- for opt in rel:
- if opt['name'] == 'ghc6':
- if opt['version']:
- (relop,v) = opt['version']
- #print "Comparing %s %s %s" % (self.ghc6version, relop, v)
- cmp = version_compare(self.ghc6version, v)
- if relop == ">=":
- ok = cmp >= 0
- elif relop == "<<":
- ok = cmp < 0
- elif relop == "=":
- ok = cmp == 0
- else:
- print "Do not handle %s yet" % relop
- else:
- #print "%s has an unversioned build-dependency on ghc6." % src['package']
- ok = True
- else:
- # we only consider ghc6 depenencies here
- ok = True
- if not ok: return False
- return True
-
-
- def is_installable(self,pkg):
- """
- Checks whether a package is uninstallable or can be expcted to be uninstallable soon
- Returns a list of triples: (updated dependency, available version, dependency string)
- """
- reasons = []
- if 'depends' not in pkg:
- #print "# %s has no dependencies." % pkg['package']
- return reasons
- rels = PkgRelation.parse_relations(pkg['depends'])
- for rel in rels:
- if len(rel) != 1:
- continue # the dependencies we care about are not optional
- opt = rel[0]
- if opt['name'] in self.haskell_lib_to_source:
- if opt['version']:
- (relop,v) = opt['version']
- bin_available = self.packages[opt['name']]['version']
- src_available = self.haskell_lib_to_source[opt['name']]['version']
- cmp = version_compare(bin_available, src_available)
- available = src_available if cmp < 0 else bin_available
- cmp = version_compare(available, v)
- #print "Comparing %s %s %s, result %d" % (available, relop, v, cmp)
- ok = False
- if relop == ">=":
- ok = cmp >= 0
- elif relop == "<<":
- ok = cmp < 0
- elif relop == "=":
- ok = cmp == 0
- else:
- print "Can not handle %s yet" % relop
- if not ok:
- reasons.append((opt['name'],available, relop +" "+ v))
- return reasons
-
- def add_incoming_info(status):
- # TODO
- return status
-
- def main(self):
- # sources will contian haskell libraries + ghc6
- self.sources = {}
- f = smart_open("data/unstable-main-Sources.bz2")
- srcfile = debian_support.PackageFile('', file_obj=f)
- try:
- for src in filter(self.is_interesting_source, imap(patch_pkg_dict,srcfile)):
- if src['package'] in self.sources:
- if version_compare(src['version'], self.sources[src['package']]['version']) > 0:
- self.sources[src['package']] = src
- else:
- self.sources[src['package']] = src
- except Exception, e:
- print "E: error while parsing %s, ignoring it." % "data/unstable-main-Sources.bz2"
- print " exception: %s" % e
- f.close()
-
- # Finding ghc6 version
- self.ghc6version = self.sources['ghc6']['version']
- print "# Found ghc6 version %s" % self.ghc6version
-
-
- # Filte out those with unsatisfiable build dependencies on ghc6
- buildable = set()
- unbuildable = set()
- for src in self.sources.itervalues():
- if self.is_buildable(src):
- buildable.add(src['package'])
- else:
- unbuildable.add(src['package'])
- print "# Found %d haskell library source packages" % len(self.sources)
- print "# ... of which %d are buildable and %d are not buildable." % (len(buildable), len(unbuildable))
-
- if 'ghc6' in unbuildable:
- print "Warning: ghc6 is not buildable!"
-
- # Collect all depwaits and nmus here, to merge them for the arches
- self.nmus = []
- self.dws = []
-
- for arch in arches:
- print
- print "# Architecture: %s" % arch
- # Create dict of all binaries
- self.packages = {}
- f = smart_open("data/unstable-main-binary-%s-Packages.bz2" % 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 " exception: %s" % e
- f.close()
-
- self.haskell_lib_to_source = {}
-
- # Go through all buildable sources and collect the names of the binaries
- for srcname in buildable:
- src = self.sources[srcname]
- for binary_name in src['binary'].split(", "):
- # Ignore missing packages
- if binary_name not in self.packages: continue
- binary = self.packages[binary_name]
- # Ignore arch-independent packages
- if binary['architecture'] == 'all': continue
-
- self.haskell_lib_to_source[binary_name] = src
- #print "Source %s has binary %s" % (src['package'],binary_name)
-
- # Key: source name, Value: reason (textual)
- self.sources_to_rebuild = {}
- # Now go again through all binaries and see if they are installable
- # but ignore out-of-date binary versions
- for binary_name in self.haskell_lib_to_source:
- binary = self.packages[binary_name]
- #if version_compare(binary['version'],src['version']) < 0:
- # continue
- problems = self.is_installable(binary)
- if problems:
- srcname = self.haskell_lib_to_source[binary_name]['package']
- if srcname not in self.sources_to_rebuild:
- self.sources_to_rebuild[srcname] = []
- self.sources_to_rebuild[srcname] += problems
-
- if self.sources_to_rebuild:
- print "# These sources need to be build:\n# %s" % ", ".join(self.sources_to_rebuild.keys())
- else:
- print "# Nothing to be done for this arch"
-
- # Now we need to plan the re-building. Packages need to dep-wait on any
- # build dependency, unless it’s already in it’s current version
-
- self.wannabuild = {}
- f = smart_open("data/wanna-build-dump-%s.gz" % arch)
- try:
- for entry in Deb822.iter_paragraphs(f):
- if 'package' in entry:
- if entry['package'] in self.sources:
- self.wannabuild[entry['package']] = entry
- except Exception, e:
- print "E: error while parsing %s, ignoring it." % ("data/wanna-buid-dump-%s.gz" % arch)
- print " exception: %s" % e
- f.close()
-
- #print self.wannabuild
-
- # write NMU lines
- for srcname in self.sources_to_rebuild:
- # ignore unbuildable packages
- if srcname in unbuildable:
- print "# ignoring %s, as it is not buildable" % srcname
- continue
- src = self.sources[srcname]
- # only write NMU for packages in state Installed
- if self.wannabuild[srcname]['state'] == 'Installed':
- reason = "Updated dependencies: "
- for (package, available, dep) in self.sources_to_rebuild[srcname]:
- reason += ""
- reason += ", ".join(sort(map(lambda p: "%s (%s available, but dependency %s)" % p, self.sources_to_rebuild[srcname])))
- self.nmus.append(
- (src['package'], src['version'], arch, reason)
- )
- self.dws.append(
- (src['package'], src['version'], arch,
- ", ".join(sort(map(lambda p: "%s (>= %s)" % p[0:2], self.sources_to_rebuild[srcname])))))
- else:
- print "# Not scheduling %s, it is in w-b state %s" % (srcname, self.wannabuild[srcname]['state'])
-
- print
- # now merge the self.dws and self.nmus
- # self.nmus: tuples of sourcename, version, arch, comment
- # self.dws: tuples of sourcename, version, arch, debwaits
- self.sorted_actions = {}
- for (src,v,arch,comment) in self.nmus:
- tuple = (src,v,0,'nmu',comment)
- if tuple not in self.sorted_actions:
- self.sorted_actions[tuple] = ""
- self.sorted_actions[tuple] += "%s " % arch
- for (src,v,arch,dw) in self.dws:
- tuple = (src,v,1,'dw',dw)
- if tuple not in self.sorted_actions:
- self.sorted_actions[tuple] = ""
- self.sorted_actions[tuple] += "%s " % arch
-
- self.sorted_actions = self.sorted_actions.items()
- self.sorted_actions.sort()
- for ((src,v,_,action,comment),thearches) in self.sorted_actions:
- print "%s %s_%s . %s . -m '%s'" % \
- (action,src,v,thearches,comment)
-
-
-if __name__ == '__main__':
- HaskellInfo().main()
-
diff --git a/pkg-haskell-uupdate b/pkg-haskell-uupdate
deleted file mode 100755
index 52c5e8b..0000000
--- a/pkg-haskell-uupdate
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2009 Marco Túlio Gontijo e Silva <marcot at holoscopio.com>
-# 2009-2011 Joachim Breitner <nomeata at debian.org>
-
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-# Usage:
-# pkg-haskell-uupdate [PACKAGE ...]
-
-set -e
-
-PACKAGE="$1"
-VERSION="$2"
-
-if [ -z "$PACKAGE" ]
-then
- echo "Usage: $0 package [version]"
-fi
-
-if [ -e $PACKAGE-debian ]
-then
- echo "Temporary directory $PACKAGE-debian already exists, aborting"
- exit 1
-fi
-
-darcs get darcs.debian.org:/darcs/pkg-haskell/$PACKAGE $PACKAGE-debian
-
-if [ ! -e $PACKAGE-debian/control -o ! -e $PACKAGE-debian/changelog ]
-then
- echo "Did not find $PACKAGE-debian/control or $PACKAGE-debian/changelog."
- echo "Is the repository in the debian/-only format?"
- exit 1
-fi
-
-cd $PACKAGE-debian
-
-if [ -z "$VERSION" ]
-then
- UPSTREAM_VERSION="$(uscan --dehs --upstream-version 0 --watchfile watch --package $PACKAGE --report-status|xpath -e 'dehs/upstream-version/text()' -q)"
- if [ -n "$UPSTREAM_VERSION" ]
- then
- VERSION="$UPSTREAM_VERSION-1"
- echo "Detected Version number $VERSION."
- else
- echo "could not detect version."
- exit 1
- fi
-fi
-
-debchange --changelog changelog --newversion="$VERSION" 'New upstream release'
-debcommit
-darcs push -av
-cd ..
-
-rm -rf $PACKAGE-debian $WANTED_PACKAGEDIR/debian
-
-echo "Successfully updated $PACKAGE to $VERSION"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/tools.git
More information about the Pkg-haskell-commits
mailing list