fix collection dependencies : install subparts of collection, even if the collec file itself exists
@@ -574,6 +574,7 @@ func DisableItem(target Item, tdir string, hdir string, purge bool) (Item, error
}
func EnableItem(target Item, tdir string, hdir string) (Item, error) {
+ var err error
parent_dir := filepath.Clean(tdir + "/" + target.Type + "/" + target.Stage + "/")
/*create directories if needed*/
if target.Installed {
@@ -583,7 +584,8 @@ func EnableItem(target Item, tdir string, hdir string) (Item, error) {
if target.Local {
return target, fmt.Errorf("%s is local, won't enable", target.Name)
}
- if target.UpToDate {
+ /* if it's a collection, check sub-items even if the collection file itself is up-to-date */
+ if target.UpToDate && target.Type != COLLECTIONS {
log.Debugf("%s is installed and up-to-date, skip.", target.Name)
return target, nil
}
@@ -594,7 +596,7 @@ func EnableItem(target Item, tdir string, hdir string) (Item, error) {
return target, fmt.Errorf("unable to create parent directories")
}
}
- if _, err := os.Lstat(parent_dir + "/" + target.FileName); os.IsNotExist(err) {
+
/*install sub-items if it's a collection*/
if target.Type == COLLECTIONS {
var tmp = [][]string{target.Parsers, target.PostOverflows, target.Scenarios, target.Collections}
@@ -614,6 +616,8 @@ func EnableItem(target Item, tdir string, hdir string) (Item, error) {
}
}
}
+
+ if _, err := os.Lstat(parent_dir + "/" + target.FileName); os.IsNotExist(err) {
//tdir+target.RemotePath
srcPath, err := filepath.Abs(hdir + "/" + target.RemotePath)
if err != nil {
