Skip to content

Commit f5edd23

Browse files
author
Federico Fissore
committed
Avoid warning about SCCS folders in libraries, just ignore them. Fixes arduino#70
Signed-off-by: Federico Fissore <[email protected]>
1 parent e70010b commit f5edd23

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Diff for: src/arduino.cc/builder/libraries_loader.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ func makeNewLibrary(libraryFolder string, debugLevel int, logger i18n.Logger) (*
152152
if debugLevel > 0 {
153153
for _, subFolder := range subFolders {
154154
if utils.IsSCCSOrHiddenFile(subFolder) {
155-
logger.Fprintln(os.Stderr, constants.MSG_WARNING_SPURIOUS_FILE_IN_LIB, filepath.Base(subFolder.Name()), properties[constants.LIBRARY_NAME])
155+
if !utils.IsSCCSFile(subFolder) && utils.IsHiddenFile(subFolder) {
156+
logger.Fprintln(os.Stderr, constants.MSG_WARNING_SPURIOUS_FILE_IN_LIB, filepath.Base(subFolder.Name()), properties[constants.LIBRARY_NAME])
157+
}
156158
}
157159
}
158160
}

Diff for: src/arduino.cc/builder/utils/utils.go

+11
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,22 @@ func FilterFilesWithExtension(extension string) filterFiles {
184184
var SOURCE_CONTROL_FOLDERS = map[string]bool{"CVS": true, "RCS": true, ".git": true, ".svn": true, ".hg": true, ".bzr": true}
185185

186186
func IsSCCSOrHiddenFile(file os.FileInfo) bool {
187+
return IsSCCSFile(file) || IsHiddenFile(file)
188+
}
189+
190+
func IsHiddenFile(file os.FileInfo) bool {
187191
name := filepath.Base(file.Name())
188192

189193
if name[0] == '.' {
190194
return true
191195
}
196+
197+
return false
198+
}
199+
200+
func IsSCCSFile(file os.FileInfo) bool {
201+
name := filepath.Base(file.Name())
202+
192203
if SOURCE_CONTROL_FOLDERS[name] {
193204
return true
194205
}

0 commit comments

Comments
 (0)