try {
var file_enum = dir.enumerate_children(
- GLib.FileAttribute.STANDARD_DISPLAY_NAME,
+ "standard::*",
GLib.FileQueryInfoFlags.NONE,
null
);
while ((next_file = file_enum.next_file(null)) != null) {
var fn = next_file.get_display_name();
-
- if (!GLib.FileUtils.test(in_path + "/" + fn, GLib.FileTest.IS_REGULAR)) {
- GLib.debug("SKIP %s not regular %s", fn);
+ if (next_file.get_file_type () == GLib.FileType.DIRECTORY) {
+
+ GLib.debug("SKIP %s not regular ", fn);
continue;
}
- GLib.debug("SCAN ADD %s ", fn);
+ if (!Regex.match_simple("^text", next_file.get_content_type())) {
+ continue;
+ }
+ GLib.debug("SCAN ADD %s : %s", fn, next_file.get_content_type());
ret.add(in_path + "/" + fn);
// any other valid types???
for (var i = 0; i < allfiles.size; i ++) {
var fn = allfiles.get(i);
+ var bn = GLib.Path.get_basename(fn);
try {
if (Regex.match_simple("\\.vala\\.c$", fn)) {
GLib.debug("SKIP %s - .bjs",fn);
continue;
}
- if (Regex.match_simple("\\.o$", fn)) {
+
+ if (Regex.match_simple("\\~$", fn)) {
+ GLib.debug("SKIP %s - ~",fn);
+ continue;
+ }
+ if (Regex.match_simple("\\.stamp$", fn)) {
GLib.debug("SKIP %s - .o",fn);
continue;
}
- if (Regex.match_simple("\\~$", fn)) {
- GLib.debug("SKIP %s - ~",fn);
+ if ("stamp-h1" == bn) {
+ GLib.debug("SKIP %s - .o",fn);
continue;
}
- if (Regex.match_simple("^\\.", GLib.Path.get_basename(fn))) {
+ // confgure.am
+ if ("config.h" == bn || "config.h.in" == bn || "config.log" == bn || "configure" == bn ) {
+ if (allfiles.index_of( in_path +"/configure.ac") > -1) {
+ continue;
+ }
+ }
+ // makefile
+ if ("Makefile" == bn || "Makefile.in" == bn ) {
+ if (allfiles.index_of( in_path +"/Makefile.am") > -1) {
+ continue;
+ }
+ }
+
+ if (Regex.match_simple("^\\.", bn)) {
GLib.debug("SKIP %s - hidden",fn);
continue;
}