From: Sam Ravnborg <sam@ravnborg.org>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: linux-kernel@vger.kernel.org, Randy Dunlap <randy.dunlap@oracle.com>
Subject: Re: [PATCH 1/1] scripts: allow docproc invocation from external
Date: Wed, 7 Jan 2009 20:55:42 +0100 [thread overview]
Message-ID: <20090107195542.GD4647@uranus.ravnborg.org> (raw)
In-Reply-To: <1231164510-14355-1-git-send-email-jirislaby@gmail.com>
On Mon, Jan 05, 2009 at 03:08:30PM +0100, Jiri Slaby wrote:
> - getcwd returns path without slash at the end, add the slash
> - add KERNSRCTREE env, so that we can specify path for kernel
> (for knowing where to find scripts/kernel-doc) and SRCTREE
> (for searching files referenced in .tmpl) separately
Kbuild already have:
KBUILD_SRC that point to the source tree
KBUILD_OUTPUT that points to the output directory
Could we reuse these?
Sam
>
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Randy Dunlap <randy.dunlap@oracle.com>
> ---
> scripts/basic/docproc.c | 13 +++++++++----
> 1 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c
> index 35bdc68..c716ae8 100644
> --- a/scripts/basic/docproc.c
> +++ b/scripts/basic/docproc.c
> @@ -69,7 +69,7 @@ FILELINE * docsection;
> #define NOFUNCTION "-nofunction"
> #define NODOCSECTIONS "-no-doc-sections"
>
> -char *srctree;
> +static char *srctree, *kernsrctree;
>
> void usage (void)
> {
> @@ -77,7 +77,8 @@ void usage (void)
> fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n");
> fprintf(stderr, "doc: frontend when generating kernel documentation\n");
> fprintf(stderr, "depend: generate list of files referenced within file\n");
> - fprintf(stderr, "Environment variable SRCTREE: absolute path to kernel source tree.\n");
> + fprintf(stderr, "Environment variable SRCTREE: absolute path to sources.\n");
> + fprintf(stderr, " KERNSRCTREE: absolute path to kernel source tree.\n");
> }
>
> /*
> @@ -96,8 +97,8 @@ void exec_kernel_doc(char **svec)
> exit(1);
> case 0:
> memset(real_filename, 0, sizeof(real_filename));
> - strncat(real_filename, srctree, PATH_MAX);
> - strncat(real_filename, KERNELDOCPATH KERNELDOC,
> + strncat(real_filename, kernsrctree, PATH_MAX);
> + strncat(real_filename, "/" KERNELDOCPATH KERNELDOC,
> PATH_MAX - strlen(real_filename));
> execvp(real_filename, svec);
> fprintf(stderr, "exec ");
> @@ -178,6 +179,7 @@ void find_export_symbols(char * filename)
> char real_filename[PATH_MAX + 1];
> memset(real_filename, 0, sizeof(real_filename));
> strncat(real_filename, srctree, PATH_MAX);
> + strncat(real_filename, "/", PATH_MAX - strlen(real_filename));
> strncat(real_filename, filename,
> PATH_MAX - strlen(real_filename));
> sym = add_new_file(filename);
> @@ -382,6 +384,9 @@ int main(int argc, char *argv[])
> srctree = getenv("SRCTREE");
> if (!srctree)
> srctree = getcwd(NULL, 0);
> + kernsrctree = getenv("KERNSRCTREE");
> + if (!kernsrctree)
> + kernsrctree = srctree;
> if (argc != 3) {
> usage();
> exit(1);
> --
> 1.6.0.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2009-01-07 19:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-05 14:08 [PATCH 1/1] scripts: allow docproc invocation from external Jiri Slaby
2009-01-07 19:55 ` Sam Ravnborg [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-05-31 16:05 Jiri Slaby
2009-06-01 16:05 ` Randy Dunlap
2009-06-01 17:02 ` Jiri Slaby
2009-06-05 21:45 ` Sam Ravnborg
2009-06-16 14:29 William Cohen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090107195542.GD4647@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=randy.dunlap@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.