New Upstream Release - ratt
Ready changes
Summary
Merged new upstream version: 0.0~git20220805.e6b9cb4 (was: 0.0~git20190123.9e77a6d).
Resulting package
Built on 2022-11-10T05:58 (took 4m32s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases ratt
Lintian Result
Diff
diff --git a/README.md b/README.md
index 1a9a29d..ff55768 100644
--- a/README.md
+++ b/README.md
@@ -6,24 +6,25 @@ The intended use-case is, for example, to package a new snapshot of a Go library
# Installation (from git, for hacking on ratt)
-Please install ratt from Debian. In case you want to hack on ratt, you can use the following commands to install Go, download ratt from git and compile/install it into your `$GOPATH`:
+Please install ratt from Debian. In case you want to hack on ratt, you can use the following commands to install Go, download ratt from git and compile/install it:
```bash
sudo apt-get install golang-go
-export GOPATH=~/gocode
-go get -u github.com/Debian/ratt
+git clone https://github.com/Debian/ratt
+cd ratt
+go install
```
-Start the resulting binary in `~/gocode/bin/ratt`:
+Start the resulting binary in `~/go/bin/ratt`:
```bash
-~/gocode/bin/ratt -help
+~/go/bin/ratt -help
```
After making changes to the code, to recompile and install it again, use:
```bash
-go install github.com/Debian/ratt
+go install
```
# Usage
@@ -73,6 +74,7 @@ The most direct solution is to add sid to your `/etc/apt/sources.list` file, the
```
# echo 'deb http://deb.debian.org/debian sid main' >> /etc/apt/sources.list
+# echo 'deb-src http://deb.debian.org/debian sid main' >> /etc/apt/sources.list
# echo 'APT::Default-Release "stable";' >> /etc/apt/apt.conf
# apt update
$ ratt ...
@@ -83,3 +85,21 @@ An alternative solution is to use `chdist(1)`, a tool that allows to create and
```
APT_CONFIG=~/.chdist/sid/etc/apt/apt.conf ratt ...
```
+
+# Restricting the set of packages that will be built
+
+In some cases there are many build dependencies; to focus on a smaller set of packages, invoke ratt with the `-include` / `-exclude` options.
+
+To only build selected packages, use:
+
+```
+ratt -recheck -include '^(hwloc|fltk1.3|wcslib|ccfits|qevercloud|libstxxl|caffe|frobby|starpu)$' ../doxygen_1.8.17-1_amd64.changes
+```
+
+To exclude certain packages (for example those with longer build times):
+
+```
+ratt -recheck -exclude '^(gcc-9|gcc-8|llvm-toolchain-10|libreoffice|trilinos|llvm-toolchain-9|llvm-toolchain-8|llvm-toolchain-7|gcc-snapshot|gcc-10|deal.ii|kodi|vg|qgis|openms|siconos|ball|gtg-trace|libsbml|dcmtk|gromacs|gudhi|kicad|libpwiz)$' ../doxygen_1.8.17-1_amd64.changes
+```
+
+**Note**: you need to escape the `+` sign in package names as in `dbus-c\+\+` to avoid messing up the regexp expression.
diff --git a/debian/changelog b/debian/changelog
index e8cd91e..0833dce 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ratt (0.0~git20220805.e6b9cb4-1) UNRELEASED; urgency=low
+
+ * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk> Thu, 10 Nov 2022 05:54:15 -0000
+
ratt (0.0~git20190123.9e77a6d-1) unstable; urgency=medium
[ Debian Janitor ]
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..60032e3
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,10 @@
+module github.com/Debian/ratt
+
+go 1.18
+
+require pault.ag/go/debian v0.12.0
+
+require (
+ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect
+ pault.ag/go/topsort v0.0.0-20160530003732-f98d2ad46e1a // indirect
+)
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..d511cfd
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,14 @@
+github.com/DataDog/zstd v1.4.8/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
+github.com/kjk/lzma v0.0.0-20161016003348-3fd93898850d/go.mod h1:phT/jsRPBAEqjAibu1BurrabCBNTYiVI+zbmyCZJY6Q=
+github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
+golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+pault.ag/go/debian v0.12.0 h1:b8ctSdBSGJ98NE1VLn06aSx70EUpczlP2qqSHEiYYJA=
+pault.ag/go/debian v0.12.0/go.mod h1:UbnMr3z/KZepjq7VzbYgBEfz8j4+Pyrm2L5X1fzhy/k=
+pault.ag/go/topsort v0.0.0-20160530003732-f98d2ad46e1a h1:WwS7vlB5H2AtwKj1jsGwp2ZLud1x6WXRXh2fXsRqrcA=
+pault.ag/go/topsort v0.0.0-20160530003732-f98d2ad46e1a/go.mod h1:INqx0ClF7kmPAMk2zVTX8DRnhZ/yaA/Mg52g8KFKE7k=
diff --git a/ratt.go b/ratt.go
index 5ed4194..5c4137c 100644
--- a/ratt.go
+++ b/ratt.go
@@ -25,6 +25,16 @@ import (
"pault.ag/go/debian/version"
)
+func filter(m map[string][]version.Version, f func(string) bool) map[string][]version.Version {
+ mf := make(map[string][]version.Version, 0)
+ for k, v := range m {
+ if f(k) {
+ mf[k] = v
+ }
+ }
+ return mf
+}
+
type buildResult struct {
src string
version *version.Version
@@ -43,6 +53,14 @@ var (
false,
"Print sbuild command lines, but do not actually build the reverse-build-dependencies")
+ include = flag.String("include",
+ "",
+ "Only build packages which match the supplied regex")
+
+ exclude = flag.String("exclude",
+ "",
+ "Do not build packages which match the supplied regex")
+
sbuildDist = flag.String("sbuild_dist",
"",
"sbuild --dist= value (e.g. \"sid\"). Defaults to the Distribution: entry from the specified .changes file")
@@ -292,6 +310,28 @@ func main() {
if err != nil {
log.Fatal(err)
}
+ log.Printf("Found %d reverse build dependencies\n", len(rebuild))
+
+ if *include != "" {
+ filtered, err := regexp.Compile(*include)
+ if err != nil {
+ log.Fatal(err)
+ }
+ rebuild = filter(rebuild, func(v string) bool {
+ return filtered.MatchString(v)
+ })
+ log.Printf("Based on the supplied include filter, will only build %d reverse build dependencies\n", len(rebuild))
+ }
+ if *exclude != "" {
+ filtered, err := regexp.Compile(*exclude)
+ if err != nil {
+ log.Fatal(err)
+ }
+ rebuild = filter(rebuild, func(v string) bool {
+ return !filtered.MatchString(v)
+ })
+ log.Printf("Based on the supplied exclude filter, will only build %d reverse build dependencies\n", len(rebuild))
+ }
// TODO: add -recursive flag to also cover dependencies which are not DIRECT dependencies. use http://godoc.org/pault.ag/go/debian/control#OrderDSCForBuild (topsort) to build dependencies in the right order (saving CPU time).
@@ -326,6 +366,16 @@ func main() {
buildresults[src] = result
}
+ var toInclude []string
+ for src, result := range buildresults {
+ if result.err != nil {
+ toInclude = append(toInclude, strings.ReplaceAll(src, "+", "\\+"))
+ }
+ }
+ if len(toInclude) > 0 {
+ log.Printf("%d packages failed the first pass; you can rerun ratt only for them passing the option -include '^(%s)$'\n", len(toInclude), strings.Join(toInclude, "|"))
+ }
+
if *dryRun {
return
}
@@ -340,15 +390,18 @@ func main() {
if err := os.MkdirAll(recheckBuilder.logDir, 0755); err != nil {
log.Fatal(err)
}
+ cnt := 1
for src, result := range buildresults {
if result.err == nil {
continue
}
+ log.Printf("Rebuilding package %d of %d: %s \n", cnt, len(toInclude), src)
+ cnt++
recheckResult := recheckBuilder.build(src, result.version)
result.recheckErr = recheckResult.err
result.recheckLogFile = recheckResult.logFile
if recheckResult.err != nil {
- log.Printf("rebuilding %s without new packages failed: %v\n", src, recheckResult.err)
+ log.Printf("rebuilding %s without new changes failed: %v\n", src, recheckResult.err)
}
}
}
Debdiff
File lists identical (after any substitutions)
Control files: lines which differ (wdiff format)
Built-Using: golang-go.crypto (= 1:0.4.0-1), 1:0.1.0-1), golang-pault-go-debian (= 0.9-2), golang-pault-go-topsort (= 0.0~git20160529.f98d2ad-3~jan+lint1) 0.0~git20160529.f98d2ad-1)