Skip to content

Commit

Permalink
bump version to v0.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
xorpaul committed Nov 13, 2018
1 parent 3882154 commit e7f5d6a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 27 deletions.
12 changes: 11 additions & 1 deletion config.go
Expand Up @@ -154,6 +154,7 @@ func readPuppetfile(pf string, sshKey string, source string, forceForgeVersions
n = preparePuppetfile(pf)
}

reEmptyLine := regexp.MustCompile("^\\s*$")
reModuledir := regexp.MustCompile("^\\s*(?:moduledir)\\s+['\"]?([^'\"]+)['\"]?")
reForgeCacheTTL := regexp.MustCompile("^\\s*(?:forge.cache(?:TTL|Ttl))\\s+['\"]?([^'\"]+)['\"]?")
reForgeBaseURL := regexp.MustCompile("^\\s*(?:forge.base(?:URL|Url))\\s+['\"]?([^'\"]+)['\"]?")
Expand All @@ -169,7 +170,10 @@ func readPuppetfile(pf string, sshKey string, source string, forceForgeVersions

lines := strings.Split(n, "\n")
for i, line := range lines {
//fmt.Println("found line ---> ", line)
//fmt.Println("found line ---> ", line, "$")
if m := reEmptyLine.FindStringSubmatch(line); len(m) > 0 {
continue
}
if strings.Count(line, ":git") > 1 || strings.Count(line, ":tag") > 1 || strings.Count(line, ":branch") > 1 || strings.Count(line, ":ref") > 1 || strings.Count(line, ":link") > 1 {
Fatalf("Error: trailing comma found in " + pf + " somewhere here: " + line)
}
Expand Down Expand Up @@ -364,6 +368,12 @@ func readPuppetfile(pf string, sshKey string, source string, forceForgeVersions
}
puppetFile.gitModules[gitModuleName] = gm
}
} else {
// for now only in dry run mode
if dryRun {
Fatalf("Error: Could not interpret line: " + line + " In " + pf)
}

}

}
Expand Down
50 changes: 25 additions & 25 deletions forge.go
Expand Up @@ -798,35 +798,35 @@ func syncForgeToModuleDir(name string, m ForgeModule, moduleDir string, correspo
}

Infof("Need to sync " + targetDir)
targetDir = checkDirAndCreate(targetDir, "as targetDir for module "+name)
var targetDirDevice, workDirDevice uint64
if fileInfo, err := os.Stat(targetDir); err == nil {
if fileInfo.Sys() != nil {
targetDirDevice = uint64(fileInfo.Sys().(*syscall.Stat_t).Dev)
if !dryRun {
targetDir = checkDirAndCreate(targetDir, "as targetDir for module "+name)
var targetDirDevice, workDirDevice uint64
if fileInfo, err := os.Stat(targetDir); err == nil {
if fileInfo.Sys() != nil {
targetDirDevice = uint64(fileInfo.Sys().(*syscall.Stat_t).Dev)
}
} else {
Fatalf(funcName + "(): Error while os.Stat file " + targetDir)
}
} else {
Fatalf(funcName + "(): Error while os.Stat file " + targetDir)
}
if fileInfo, err := os.Stat(workDir); err == nil {
if fileInfo.Sys() != nil {
workDirDevice = uint64(fileInfo.Sys().(*syscall.Stat_t).Dev)
if fileInfo, err := os.Stat(workDir); err == nil {
if fileInfo.Sys() != nil {
workDirDevice = uint64(fileInfo.Sys().(*syscall.Stat_t).Dev)
}
} else {
Fatalf(funcName + "(): Error while os.Stat file " + workDir)
}
} else {
Fatalf(funcName + "(): Error while os.Stat file " + workDir)
}

if targetDirDevice != workDirDevice {
Fatalf("Error: Can't hardlink Forge module files over different devices. Please consider changing the cachdir setting. ForgeCachedir: " + config.ForgeCacheDir + " target dir: " + targetDir)
}
if targetDirDevice != workDirDevice {
Fatalf("Error: Can't hardlink Forge module files over different devices. Please consider changing the cachdir setting. ForgeCachedir: " + config.ForgeCacheDir + " target dir: " + targetDir)
}

mutex.Lock()
needSyncDirs = append(needSyncDirs, targetDir)
if _, ok := needSyncEnvs[correspondingPuppetEnvironment]; !ok {
needSyncEnvs[correspondingPuppetEnvironment] = struct{}{}
}
needSyncForgeCount++
mutex.Unlock()
if !dryRun {
mutex.Lock()
needSyncDirs = append(needSyncDirs, targetDir)
if _, ok := needSyncEnvs[correspondingPuppetEnvironment]; !ok {
needSyncEnvs[correspondingPuppetEnvironment] = struct{}{}
}
needSyncForgeCount++
mutex.Unlock()
hardlink := func(path string, info os.FileInfo, err error) error {
if filepath.Base(path) != filepath.Base(workDir) { // skip the root dir
target, err := filepath.Rel(workDir, path)
Expand Down
2 changes: 1 addition & 1 deletion g10k.go
Expand Up @@ -203,7 +203,7 @@ func main() {
version := *versionFlag

if version {
fmt.Println("g10k version 0.5.5 Build time:", buildtime, "UTC")
fmt.Println("g10k version 0.5.6 Build time:", buildtime, "UTC")
os.Exit(0)
}

Expand Down

0 comments on commit e7f5d6a

Please sign in to comment.