get confused. So it's best for ikiwiki to follow the compatability

* Support building on systems that lack asprintf.
* mercurial getctime is currently broken, apparently by some change in
  mercurial version 0.9.4. Turn the failing test case into a TODO test case.
master
joey 2007-07-09 00:39:55 +00:00
parent 5a809bdd98
commit e0da57358c
5 changed files with 30 additions and 15 deletions

View File

@ -33,7 +33,7 @@ sub gen_wrapper () { #{{{
foreach my $var (@envsave) {
$envsave.=<<"EOF"
if ((s=getenv("$var")))
asprintf(&newenviron[i++], "%s=%s", "$var", s);
addenv("$var", s);
EOF
}
if ($config{rcs} eq "svn" && $config{notify}) {
@ -41,15 +41,15 @@ EOF
# $2 in REV in the environment.
$envsave.=<<"EOF"
if (argc == 3)
asprintf(&newenviron[i++], "REV=%s", argv[2]);
addenv("REV", argv[2]);
else if ((s=getenv("REV")))
asprintf(&newenviron[i++], "%s=%s", "REV", s);
addenv("REV", s);
EOF
}
if ($config{rcs} eq "tla" && $config{notify}) {
$envsave.=<<"EOF"
if ((s=getenv("ARCH_VERSION")))
asprintf(&newenviron[i++], "%s=%s", "ARCH_VERSION", s);
addenv("ARCH_VERSION", s);
EOF
}
@ -64,7 +64,6 @@ EOF
open(OUT, ">$wrapper.c") || error(sprintf(gettext("failed to write %s: %s"), "$wrapper.c", $!));;
print OUT <<"EOF";
/* A wrapper for ikiwiki, can be safely made suid. */
#define _GNU_SOURCE
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
@ -72,12 +71,20 @@ EOF
#include <string.h>
extern char **environ;
char *newenviron[$#envsave+5];
int i=0;
addenv(char *var, char *val) {
char *s=malloc(strlen(var)+1+strlen(val)+1);
if (!s)
perror("malloc");
sprintf(s, "%s=%s", var, val);
newenviron[i++]=s;
}
int main (int argc, char **argv) {
/* Sanitize environment. */
char *s;
char *newenviron[$#envsave+5];
int i=0;
$envsave
newenviron[i++]="HOME=$ENV{HOME}";
newenviron[i++]="WRAPPED_OPTIONS=$configstring";
@ -90,7 +97,7 @@ $envsave
}
execl("$this", "$this", NULL);
perror("failed to run $this");
perror("exec $this");
exit(1);
}
EOF

7
debian/changelog vendored
View File

@ -2,10 +2,13 @@ ikiwiki (2.4) UNRELEASED; urgency=low
* Make the toc plugin use html-compatible anchors. This is necessary since
most web sites serve ikiwiki xhtml files as text/html and mozilla browsers
get confused. So it's best for ikiwiki to follow the compatability
get confused. So it's best for ikiwiki to follow the compatability
recommendations in appendix C of the XHTML spec. Closes: #432045
* Support building on systems that lack asprintf.
* mercurial getctime is currently broken, apparently by some change in
mercurial version 0.9.4. Turn the failing test case into a TODO test case.
-- Joey Hess <joeyh@debian.org> Sun, 08 Jul 2007 12:54:55 -0400
-- Joey Hess <joeyh@debian.org> Sun, 08 Jul 2007 20:25:00 -0400
ikiwiki (2.3) unstable; urgency=low

View File

@ -31,3 +31,5 @@ Thanks, Joey et al., for a really cool tool.
>> Of the possible patches to make this more portable, I'd generally prefer
>> one that uses portable functions (safely), rather than one that includes
>> an asprintf implementation in ikiwiki. --[[Joey]]
[[bugs/done]]

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-06-29 20:49-0400\n"
"POT-Creation-Date: 2007-07-08 20:26-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -548,13 +548,13 @@ msgid "failed to write %s: %s"
msgstr ""
#. translators: The parameter is a C filename.
#: ../IkiWiki/Wrapper.pm:100
#: ../IkiWiki/Wrapper.pm:107
#, perl-format
msgid "failed to compile %s"
msgstr ""
#. translators: The parameter is a filename.
#: ../IkiWiki/Wrapper.pm:108
#: ../IkiWiki/Wrapper.pm:115
#, perl-format
msgid "successfully generated %s"
msgstr ""

View File

@ -56,7 +56,10 @@ is($changes[0]{pages}[0]{"page"}, "test2.mdwn");
is($changes[1]{pages}[0]{"page"}, "test1.mdwn");
my $ctime = IkiWiki::rcs_getctime("test2.mdwn");
is($ctime, 0);
TODO: {
local $TODO = "hg behavior change seems to have broken this";
my $ctime = IkiWiki::rcs_getctime("test2.mdwn");
is($ctime, 0);
}
system "rm -rf $dir";