From 77448121577da35bf3beb0f3700ec833a496f2cc Mon Sep 17 00:00:00 2001 From: J. Ali Harlow Date: Thu, 9 Jul 2009 00:01:18 +0100 Subject: [PATCH] Fix problems found by distcheck --- librazor/test-lua.c | 21 ++++++++++++++++++++- po/POTFILES.in | 3 +++ test/Makefile.am | 7 +++++++ 3 files changed, 30 insertions(+), 1 deletions(-) diff --git a/librazor/test-lua.c b/librazor/test-lua.c index b069ad0..ec75071 100644 --- a/librazor/test-lua.c +++ b/librazor/test-lua.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -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); diff --git a/po/POTFILES.in b/po/POTFILES.in index e69de29..b8ab93d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -0,0 +1,3 @@ +gl/error.c +gl/fnmatch_loop.c +gl/xalloc-die.c diff --git a/test/Makefile.am b/test/Makefile.am index 7109c10..032e80f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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 -- 1.7.1