From 67b51b6ead62fe77bcdfa4d935db15ca1a48f60b Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 5 Sep 2019 02:39:23 +0200 Subject: [PATCH] initial --- Makefile | 27 +++++++++++++++++++++++++++ README.md | 9 +++++++++ 2 files changed, 36 insertions(+) create mode 100644 Makefile create mode 100644 README.md diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a1ba2b8 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +VERSION := $(shell git rev-parse --short HEAD) +BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ') +BUILDUSER := $(shell whoami) +BUILDHOST := $(shell hostname -s) +BUILDARCH := $(shell uname -m) + +GOLDFLAGS += -X main.Version=$(VERSION) +GOLDFLAGS += -X main.Buildtime=$(BUILDTIME) +GOLDFLAGS += -X main.Builduser=$(BUILDUSER)@$(BUILDHOST) +GOLDFLAGS += -X main.Buildarch=$(BUILDARCH) +GOFLAGS = -ldflags "$(GOLDFLAGS)" + +default: rundebug + +rundebug: build + DEBUG=1 ./xsum + +run: build + ./xsum + +build: ./xsum + +./xsum: *.go */*.go + go build -o $@ $(GOFLAGS) . + +fmt: + go fmt *.go diff --git a/README.md b/README.md new file mode 100644 index 0000000..aee5a10 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# xsum + +this stores a file mtime and cryptographically secure content checksum +in an xattr, so that you can verify that your files aren't corrupted +on filesystems that are dumb and don't include data checksums (e.g. apfs) + +# author + +sneak