Description: swap the explicit disabling behavior for DFSG compliance
Forwarded: not-needed
Author: Tianon Gravi <tianon@debian.org>

--- a/README.md
+++ b/README.md
@@ -17,6 +17,10 @@
 CHECKPOINT_DISABLE=1 packer build 
 ```
 
+In the Debian package, this behavior is swapped so that the service is disabled
+by default, and only enabled with an explicit `CHECKPOINT_ENABLE=1` due to DFSG
+compliance.
+
 **Note:** This repository is probably useless outside of internal HashiCorp
 use. It is open source for disclosure and because our open source projects
 must be able to link to it.
--- a/checkpoint.go
+++ b/checkpoint.go
@@ -201,7 +201,7 @@
 
 // Check checks for alerts and new version information.
 func Check(p *CheckParams) (*CheckResponse, error) {
-	if disabled := os.Getenv("CHECKPOINT_DISABLE"); disabled != "" && !p.Force {
+	if enabled := os.Getenv("CHECKPOINT_ENABLE"); enabled == "" && !p.Force {
 		return &CheckResponse{}, nil
 	}
 
@@ -305,7 +305,7 @@
 func CheckInterval(p *CheckParams, interval time.Duration, cb func(*CheckResponse, error)) chan struct{} {
 	doneCh := make(chan struct{})
 
-	if disabled := os.Getenv("CHECKPOINT_DISABLE"); disabled != "" {
+	if enabled := os.Getenv("CHECKPOINT_ENABLE"); enabled == "" {
 		return doneCh
 	}
 
--- a/checkpoint_test.go
+++ b/checkpoint_test.go
@@ -11,6 +11,10 @@
 	"time"
 )
 
+func init() {
+	os.Setenv("CHECKPOINT_ENABLE", "1")
+}
+
 func TestCheck(t *testing.T) {
 	expected := &CheckResponse{
 		Product:             "test",
@@ -54,8 +58,8 @@
 }
 
 func TestCheck_disabled(t *testing.T) {
-	os.Setenv("CHECKPOINT_DISABLE", "1")
-	defer os.Setenv("CHECKPOINT_DISABLE", "")
+	os.Setenv("CHECKPOINT_ENABLE", "")
+	defer os.Setenv("CHECKPOINT_ENABLE", "1")
 
 	expected := &CheckResponse{}
 
@@ -183,8 +187,8 @@
 }
 
 func TestCheckInterval_disabled(t *testing.T) {
-	os.Setenv("CHECKPOINT_DISABLE", "1")
-	defer os.Setenv("CHECKPOINT_DISABLE", "")
+	os.Setenv("CHECKPOINT_ENABLE", "")
+	defer os.Setenv("CHECKPOINT_ENABLE", "1")
 
 	params := &CheckParams{
 		Product: "test",
