Fix problems found by distcheck 0.1
authorJ. Ali Harlow <ali@juiblex.co.uk>
Wed, 8 Jul 2009 23:01:18 +0000 (00:01 +0100)
committerJ. Ali Harlow <ali@juiblex.co.uk>
Wed, 8 Jul 2009 23:01:18 +0000 (00:01 +0100)
librazor/test-lua.c
po/POTFILES.in
test/Makefile.am

index b069ad0..ec75071 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
@@ -62,7 +63,7 @@ int main(int argc, char *argv[])
        int r;
        void *script;
        size_t len;
-       char *s, *test_file;
+       char *s, *test_file, *srcdir;
        FILE *fp;
 
        if (argc > 2) {
@@ -94,6 +95,24 @@ int main(int argc, char *argv[])
        free(s);
 
        script = razor_file_get_contents(test_file, &len);
+       if (!script) {
+               srcdir = getenv("srcdir");
+               if (srcdir && errno == ENOENT && *test_file != '/') {
+                       s = malloc(strlen(srcdir) + strlen(test_file) + 2);
+                       strcpy(s, srcdir);
+                       strcat(s, "/");
+                       strcat(s, test_file);
+                       script = razor_file_get_contents(s, &len);
+                       if (!script) {
+                               perror(s);
+                               exit(1);
+                       }
+                       free(s);
+               } else {
+                       perror(test_file);
+                       exit(1);
+               }
+       }
        r = run_lua_script(root, test_file, script, len, -1);
        razor_file_free_contents(script, len);
 
index e69de29..b8ab93d 100644 (file)
@@ -0,0 +1,3 @@
+gl/error.c
+gl/fnmatch_loop.c
+gl/xalloc-die.c
index 7109c10..032e80f 100644 (file)
@@ -49,6 +49,13 @@ EXTRA_DIST =                         \
        named-root.sh           \
        relocate.sh
 
+MOSTLYCLEANFILES =             \
+       primary.xml.gz          \
+       filelists.xml.gz        \
+       $(check_SCRIPTS)        \
+       rawhide.rzdb
+
 clean-local :
        rm -f *~
+       rm -rf repodata rpms