aboutsummaryrefslogtreecommitdiff
path: root/package.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2018-05-21 03:38:34 +0700
committerShulhan <ms@kilabit.info>2018-05-21 03:38:34 +0700
commit8f01bf679c2bec9b514f4ea2d0f3d5c4eca9e953 (patch)
treea821f2bfae8afcf6d0d500849473a13288257ea7 /package.go
parent10ab9cedefd713ad49a62c0b03d73963da21c904 (diff)
downloadbeku-8f01bf679c2bec9b514f4ea2d0f3d5c4eca9e953.tar.xz
Set environment as dirty after sync operation than add or update a package
Diffstat (limited to 'package.go')
-rw-r--r--package.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/package.go b/package.go
index 0c0550a..4c03efc 100644
--- a/package.go
+++ b/package.go
@@ -467,7 +467,10 @@ func (pkg *Package) Update(newPkg *Package) (err error) {
// (2) add it as one of package dependencies of current package, and,
// (3) add current package as required by new package.
//
-func (pkg *Package) UpdateMissingDep(newPkg *Package) {
+// It will return true if new package solve the missing deps on current
+// package, otherwise it will return false.
+//
+func (pkg *Package) UpdateMissingDep(newPkg *Package) (updated bool) {
var missing []string
for x := 0; x < len(pkg.DepsMissing); x++ {
if !strings.HasPrefix(pkg.DepsMissing[x], newPkg.ImportPath) {
@@ -477,9 +480,14 @@ func (pkg *Package) UpdateMissingDep(newPkg *Package) {
pkg.pushDep(newPkg.ImportPath)
newPkg.pushRequiredBy(pkg.ImportPath)
+ updated = true
+ }
+
+ if updated {
+ pkg.DepsMissing = missing
}
- pkg.DepsMissing = missing
+ return
}
//