Commit 74e9da4d authored by Rusty Russell's avatar Rusty Russell

merge

parents 36e8b652 fab2dc93
/* This is test for grab_file() function */
/*
/* This is test for grab_file() function
*
* Example:
*
* void *grab_file(const void *ctx, const char *filename)
......@@ -22,4 +21,34 @@
* }
*/
#include <stdlib.h>
#include <stdio.h>
#include <err.h>
#include <sys/stat.h>
#include "string/string.h"
#include "string/string.c"
#include "tap/tap.h"
int
main(int argc, char *argv[])
{
unsigned int i;
char **split, *str;
int length;
struct stat st;
str = grab_file(NULL, "ccan/string/test/run-grab.c");
split = strsplit(NULL, str, "\n", NULL);
length = strlen(split[0]);
ok1(streq(split[0], "/* This is test for grab_file() function"));
for (i = 1; split[i]; i++)
length += strlen(split[i]);
ok1(streq(split[i-1], "/* End of grab_file() test */"));
if (stat("ccan/string/test/run-grab.c", &st) != 0)
err(1, "Could not stat self");
ok1(st.st_size == length + i);
return 0;
}
/* End of grab_file() test */
......@@ -27,9 +27,7 @@ int main(int argc, char *argv[])
char **split, *str;
void *ctx;
char *strings[NUM_SUBSTRINGS * NUM_SUBSTRINGS];
int length;
struct stat st;
n = 0;
for (i = 0; i < NUM_SUBSTRINGS; i++) {
for (j = 0; j < NUM_SUBSTRINGS; j++) {
......@@ -117,16 +115,5 @@ int main(int argc, char *argv[])
ok1(talloc_parent(str) == ctx);
talloc_free(ctx);
str = grab_file(NULL, "ccan/string/test/run-grab.c");
split = strsplit(NULL, str, "\n", NULL);
length = strlen(split[0]);
ok1(streq(split[0], "/* This is test for grab_file() function */"));
for(i = 1; split[i]; i++)
length += strlen(split[i]);
ok1(streq(split[i-1], "/* End of grab_file() test */"));
if (stat("ccan/string/test/run-grab.c", &st) != 0)
err(1, "Could not stat self");
ok1(st.st_size == length);
return exit_status();
}
No preview for this file type
......@@ -53,7 +53,7 @@ create_tar(char **deps, const char *dir, const char *targetdir)
if (deps != NULL) {
cmd_args = strjoin(NULL, deps, " ");
cmd = talloc_asprintf(NULL, TAR_CMD "%s/%s_dependencies.tar %s %s", targetdir, module, cmd_args, dir);
cmd = talloc_asprintf(NULL, TAR_CMD "%s/%s_with_deps.tar %s %s", targetdir, module, cmd_args, dir);
} else
cmd = talloc_asprintf(NULL, TAR_CMD "%s/%s.tar %s", targetdir, module, dir);
......
......@@ -29,9 +29,6 @@ $temprepo = "temprepo/";
//email from
$frommail = "ccan@ozlabs.org";
//email for admins
$ccan_admin = "g.dinesh.cse@gmail.com";
//ccan home
$ccan_home_dir = "ccan/";
......@@ -43,4 +40,4 @@ $bzr_push = 'bzr push /home/dinesh/testwebsite/ ';
//tar home dir
$tar_dir = 'tarball/';
?>
\ No newline at end of file
?>
No preview for this file type
......@@ -19,7 +19,7 @@ $row = sqlite3_fetch_array($result);
<td>
<?php
if(file_exists($tar_dir . $_GET['module']."_dependencies.tar"))
echo '<a href='. $tar_dir . $_GET['module'] . '_dependencies.tar>Download Dependencies</a>';
echo '<a href='. $tar_dir . $_GET['module'] . '_with_deps.tar>Download Dependencies</a>';
?>
</td>
</tr>
......@@ -54,4 +54,4 @@ function checkerror($status, $msg)
exit();
}
}
?>
\ No newline at end of file
?>
......@@ -36,7 +36,7 @@ function getccanadmin($db)
$result = sqlite3_query($handle, $query) or die("Error in query: ".sqlite3_error($handle));
while ($row = sqlite3_fetch_array($result))
$admin = $admin.$row[0].",";
$admin = $admin.$row['email'].",";
return $admin;
}
?>
\ No newline at end of file
?>
......@@ -3,6 +3,7 @@ session_start();
include('logo.html');
include('menulist.html');
include('configuration');
include('functions.php');
if(isset($_POST['submit'])) {
$name = $_REQUEST['name'];
......@@ -80,7 +81,7 @@ $result = sqlite3_exec($handle, $query) or die("Error in query: ".sqlite3_error(
$subject = "Approval of ccan account";
$message = "There is new request for ccan account id.\n\n Please use the following link to approve http://ccan.ozlabs.org/dinesh/approval.php?accountid=".$accountid;
mail($ccan_admin, $subject, $message, "From: $email");
mail(getccanadmin($db), $subject, $message, "From: $email");
?>
</br><div>Thank you for registering with CCAN. You will get the password to your mail after approval.</div>
<?php
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment