summaryrefslogtreecommitdiff
path: root/pkg/packages.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/packages.go')
-rw-r--r--pkg/packages.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/packages.go b/pkg/packages.go
index 7ed8584..dea8f7c 100644
--- a/pkg/packages.go
+++ b/pkg/packages.go
@@ -19,7 +19,7 @@ func Package(names ...string) *PackagePromise {
chain: nil,
err: nil,
names: names,
- status: PROMISED,
+ status: DECLARED,
}
}
@@ -36,7 +36,10 @@ func (p *PackagePromise) IfRepaired(ps ...Promise) Promise {
}
func (p *PackagePromise) Promise() *PackagePromise {
- packages = append(packages, p)
+ if p.status == DECLARED {
+ p.status = PROMISED
+ packages = append(packages, p)
+ }
return p
}