Skip to content

Commit e291897

Browse files
committed
Merge branch 'pack-cmd'
2 parents 398d1ac + ec20e9f commit e291897

File tree

5 files changed

+15
-16
lines changed

5 files changed

+15
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ recent /// not yet released
22
---------------------------
33

44
- *your changes here!*
5+
- Change: `repeatr scan` is now known as `repeatr pack`, because that's a much more accurate description of what it does.
56
- Bugfix: Results in a RunRecord are serialized in a consistent order again as they should be. This was a regression introduced when we moved from "outputs" to the slightly terser "results" structs.
67
- Feature: Errors got a facelift and consistency rework. Many errors are now reported more tersely and helpfully at the command line. And errors in the API are properly serializable.
78
- All of these new error types are exported in the `def` package and are easily serializable, with strongly-typed fields.

cmd/repeatr/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"go.polydawn.net/repeatr/cmd/repeatr/bhv"
1414
"go.polydawn.net/repeatr/cmd/repeatr/cfg"
1515
"go.polydawn.net/repeatr/cmd/repeatr/examine"
16+
"go.polydawn.net/repeatr/cmd/repeatr/pack"
1617
"go.polydawn.net/repeatr/cmd/repeatr/run"
17-
"go.polydawn.net/repeatr/cmd/repeatr/scan"
1818
"go.polydawn.net/repeatr/cmd/repeatr/twerk"
1919
"go.polydawn.net/repeatr/cmd/repeatr/unpack"
2020
"go.polydawn.net/repeatr/cmd/repeatr/version"
@@ -127,8 +127,8 @@ func Main(
127127
Action: unpackCmd.Unpack(stderr),
128128
},
129129
{
130-
Name: "scan",
131-
Usage: "Scan a local filesystem, optionally packing the data into a warehouse",
130+
Name: "pack",
131+
Usage: "Scan a local filesystem reporting the hash, and (optionally) packing the data into snapshot form to save in a warehouse",
132132
Flags: []cli.Flag{
133133
cli.StringFlag{
134134
Name: "place",
@@ -148,7 +148,7 @@ func Main(
148148
Usage: "Optional. Filters to apply when scanning. If not provided, reasonable defaults (flattening uid, gid, and mtime) will be used.",
149149
},
150150
},
151-
Action: scanCmd.Scan(stdout, stderr),
151+
Action: packCmd.Pack(stdout, stderr),
152152
},
153153
{
154154
Name: "examine",

cmd/repeatr/scan/scan.go renamed to cmd/repeatr/pack/pack.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package scanCmd
1+
package packCmd
22

33
import (
44
"github.com/inconshreveable/log15"
@@ -12,7 +12,7 @@ import (
1212
Returns an output specification complete with hash, which can be
1313
flipped around and used as an `Input` specification in a `Formula`.
1414
*/
15-
func scan(outputSpec def.Output, log log15.Logger) def.Output {
15+
func pack(outputSpec def.Output, log log15.Logger) def.Output {
1616
// TODO validate MountPath exists, give nice errors
1717

1818
// todo: create validity checking api for URIs, check them all before launching anything
@@ -21,8 +21,6 @@ func scan(outputSpec def.Output, log log15.Logger) def.Output {
2121
warehouses[i] = rio.SiloURI(wh)
2222
}
2323

24-
// So, this CLI command is *not* in its rights to change the subject area,
25-
// so take that as a pretty strong hint that filters are going to have to pass down *into* transmats.
2624
commitID := util.DefaultTransmat().Scan(
2725
// All of this stuff that's type-coercing?
2826
// Yeah these are hints that this stuff should be facing data validation.

cmd/repeatr/scan/scanCmd.go renamed to cmd/repeatr/pack/packCmd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package scanCmd
1+
package packCmd
22

33
import (
44
"fmt"
@@ -13,7 +13,7 @@ import (
1313
"go.polydawn.net/repeatr/cmd/repeatr/bhv"
1414
)
1515

16-
func Scan(stdout, stderr io.Writer) cli.ActionFunc {
16+
func Pack(stdout, stderr io.Writer) cli.ActionFunc {
1717
return func(ctx *cli.Context) error {
1818
// args parse
1919
var warehouses def.WarehouseCoords
@@ -49,7 +49,7 @@ func Scan(stdout, stderr io.Writer) cli.ActionFunc {
4949
// invoke
5050
var output def.Output
5151
meep.Try(func() {
52-
output = scan(outputSpec, log)
52+
output = pack(outputSpec, log)
5353
}, cmdbhv.TryPlanToExit)
5454
// output
5555
if err := codec.NewEncoder(stdout, &codec.JsonHandle{Indent: -1}).Encode(output); err != nil {

demo.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ echo -e "${clblue} ----------------------------${cnone}\n\n"
3939
awaitack
4040

4141

42-
echo -e "${clblue}# To suck in data, use the scan command:${cnone}"
42+
echo -e "${clblue}# To suck in data, use the pack command:${cnone}"
4343
echo
4444
(
45-
tellRunning "repeatr scan --help"
46-
time repeatr scan --help
47-
tellRunning "repeatr scan --kind=tar"
48-
time repeatr scan --kind=tar
45+
tellRunning "repeatr pack --help"
46+
time repeatr pack --help
47+
tellRunning "repeatr pack --kind=tar"
48+
time repeatr pack --kind=tar
4949
)
5050
echo
5151
echo -e "${clblue}# This determines the data identity,${cnone}"

0 commit comments

Comments
 (0)