Debian Bug report logs - #655712
RFP: template -- environment variable expander | simple template tool

Package: wnpp; Maintainer for wnpp is wnpp@debian.org;

Reported by: Michael Stummvoll <michael@stummi.org>

Date: Fri, 13 Jan 2012 12:48:19 UTC

Severity: wishlist

Tags: wontfix

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, debian-devel@lists.debian.org, wnpp@debian.org:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 12:48:22 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Stummvoll <michael@stummi.org>:
New Bug report received and forwarded. Copy sent to debian-devel@lists.debian.org, wnpp@debian.org. (Fri, 13 Jan 2012 12:48:26 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Michael Stummvoll <michael@stummi.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 13:40:58 +0100
Package: wnpp
Severity: wishlist
Owner: Michael Stummvoll <michael@stummi.org>

I'm planning to upload this new package through a sponsor

* Package name    : template
  Version         : 0.1
  Upstream Author : Michael Stummvoll <michael@stummi.org>
* URL             : http://stuff.stummi.org/template.html
* License         : GPL
  Programming Lang: C
  Description     : environment variable expander and simple template tool

template is a very simple tool that reads from stdin, expands variables in the form ${FOO} to its according environment variables and prints this to stdout.




Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org, Michael Stummvoll <michael@stummi.org>:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 12:57:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sandro Tosi <morph@debian.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org, Michael Stummvoll <michael@stummi.org>. (Fri, 13 Jan 2012 12:57:07 GMT) Full text and rfc822 format available.

Message #10 received at 655712@bugs.debian.org (full text, mbox):

From: Sandro Tosi <morph@debian.org>
To: Michael Stummvoll <michael@stummi.org>, 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 13:51:35 +0100
On Fri, Jan 13, 2012 at 13:40, Michael Stummvoll <michael@stummi.org> wrote:
> * Package name    : template

It's probably a too generic name

-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi




Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 13:09:12 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Stummvoll <michael@stummi.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org. (Fri, 13 Jan 2012 13:09:17 GMT) Full text and rfc822 format available.

Message #15 received at 655712@bugs.debian.org (full text, mbox):

From: Michael Stummvoll <michael@stummi.org>
To: Sandro Tosi <morph@debian.org>, 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 13:59:38 +0100
On 13.01.2012 13:51, Sandro Tosi wrote:
> On Fri, Jan 13, 2012 at 13:40, Michael Stummvoll<michael@stummi.org>  wrote:
>> * Package name    : template
> It's probably a too generic name
Ok, you may be right. Would something like template-tool be better?

Regards,
Michael




Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org, Michael Stummvoll <michael@stummi.org>:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 13:39:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org, Michael Stummvoll <michael@stummi.org>. (Fri, 13 Jan 2012 13:39:06 GMT) Full text and rfc822 format available.

Message #20 received at 655712@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Michael Stummvoll <michael@stummi.org>, 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 13:35:20 +0000
[Message part 1 (text/plain, inline)]
On Fri, 13 Jan 2012 13:40:58 +0100
Michael Stummvoll <michael@stummi.org> wrote:

> Package: wnpp
> Severity: wishlist
> Owner: Michael Stummvoll <michael@stummi.org>
> 
> I'm planning to upload this new package through a sponsor
> 
> * Package name    : template
>   Version         : 0.1
>   Upstream Author : Michael Stummvoll <michael@stummi.org>
> * URL             : http://stuff.stummi.org/template.html
> * License         : GPL
>   Programming Lang: C
>   Description     : environment variable expander and simple template tool
> 
> template is a very simple tool that reads from stdin, expands variables in the form ${FOO} to its according environment variables and prints this to stdout.

printenv?

Maybe printenv combined with sed or grep ...

What is the advantage?

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 13:45:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Stummvoll <michael@stummi.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org. (Fri, 13 Jan 2012 13:45:06 GMT) Full text and rfc822 format available.

Message #25 received at 655712@bugs.debian.org (full text, mbox):

From: Michael Stummvoll <michael@stummi.org>
To: Neil Williams <codehelp@debian.org>, 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 14:44:13 +0100
On 13.01.2012 14:35, Neil Williams wrote:
> printenv? Maybe printenv combined with sed or grep ... What is the 
> advantage? 
expanding variables in a file is very tricky using bash only.
And I don't really see your point. What did you mean with "printenv 
combined with sed"? Listing all environment-variables and replacing them 
in the stream using sed? I think this way is laborious.

Regards,
Michael




Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 13:57:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Stummvoll <michael@stummi.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org. (Fri, 13 Jan 2012 13:57:07 GMT) Full text and rfc822 format available.

Message #30 received at 655712@bugs.debian.org (full text, mbox):

From: Michael Stummvoll <michael@stummi.org>
To: Steve McIntyre <steve@einval.com>, 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 14:55:06 +0100
On 13.01.2012 14:52, Steve McIntyre wrote:
> Why do we need this? Does it need to be a separate package for a very 
> simple utility program? 
do you think it has better chances to get in a package like moreutils 
instead of as own?




Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org, Michael Stummvoll <michael@stummi.org>:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 14:09:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steve McIntyre <steve@einval.com>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org, Michael Stummvoll <michael@stummi.org>. (Fri, 13 Jan 2012 14:09:06 GMT) Full text and rfc822 format available.

Message #35 received at 655712@bugs.debian.org (full text, mbox):

From: Steve McIntyre <steve@einval.com>
To: Michael Stummvoll <michael@stummi.org>
Cc: 655712@bugs.debian.org, debian-devel@lists.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 14:05:54 +0000
On Fri, Jan 13, 2012 at 02:55:06PM +0100, Michael Stummvoll wrote:
>On 13.01.2012 14:52, Steve McIntyre wrote:
>>Why do we need this? Does it need to be a separate package for a
>>very simple utility program?
>do you think it has better chances to get in a package like moreutils
>instead of as own?

That would be a better place, yes. But:

 * There's no license statement anywhere in the code or accompanying
   files

 * I don't really see how this program is more useful than a very
   simple shell (or perl, or python, or ...) loop to do the same
   thing.

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
"Since phone messaging became popular, the young generation has lost the
 ability to read or write anything that is longer than one hundred and sixty
 characters."  -- Ignatios Souvatzis





Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org, Michael Stummvoll <michael@stummi.org>:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 14:12:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steve McIntyre <steve@einval.com>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org, Michael Stummvoll <michael@stummi.org>. (Fri, 13 Jan 2012 14:12:06 GMT) Full text and rfc822 format available.

Message #40 received at 655712@bugs.debian.org (full text, mbox):

From: Steve McIntyre <steve@einval.com>
To: michael@stummi.org
Cc: debian-devel@lists.debian.org,655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 13:52:44 +0000
Michael Stummvoll wrote:
>Package: wnpp
>Severity: wishlist
>Owner: Michael Stummvoll <michael@stummi.org>
>
>I'm planning to upload this new package through a sponsor
>
>* Package name    : template
>  Version         : 0.1
>  Upstream Author : Michael Stummvoll <michael@stummi.org>
>* URL             : http://stuff.stummi.org/template.html
>* License         : GPL
>  Programming Lang: C
>  Description     : environment variable expander and simple template tool
>
>template is a very simple tool that reads from stdin, expands variables in the form ${FOO} to its according environment
>variables and prints this to stdout.

Why do we need this? Does it need to be a separate package for a very
simple utility program?

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
"Because heaters aren't purple!" -- Catherine Pitt




Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 14:18:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Stummvoll <michael@stummi.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org. (Fri, 13 Jan 2012 14:18:03 GMT) Full text and rfc822 format available.

Message #45 received at 655712@bugs.debian.org (full text, mbox):

From: Michael Stummvoll <michael@stummi.org>
To: Steve McIntyre <steve@einval.com>, 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 15:14:54 +0100
On 13.01.2012 15:05, Steve McIntyre wrote:
> * I don't really see how this program is more useful than a very 
> simple shell (or perl, or python, or ...) loop to do the same thing. 
I looked a while for a simple shell loop which does exactly this. But 
could'nt find one, so I wrote this tool.
All bash-scripts I found used some tricky eval-hacks, which i wanted to 
avoid.

Regards,
Michael





Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org, Michael Stummvoll <michael@stummi.org>:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 14:48:34 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org, Michael Stummvoll <michael@stummi.org>. (Fri, 13 Jan 2012 14:48:34 GMT) Full text and rfc822 format available.

Message #50 received at 655712@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Michael Stummvoll <michael@stummi.org>
Cc: 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 14:36:41 +0000
[Message part 1 (text/plain, inline)]
On Fri, 13 Jan 2012 14:44:13 +0100
Michael Stummvoll <michael@stummi.org> wrote:

> On 13.01.2012 14:35, Neil Williams wrote:
> > printenv? Maybe printenv combined with sed or grep ... What is the 
> > advantage? 
> expanding variables in a file is very tricky using bash only.

? file? You're talking about environment variables.

> And I don't really see your point. What did you mean with "printenv 
> combined with sed"? Listing all environment-variables and replacing them 
> in the stream using sed?

$ printenv|grep GDM_LANG|sed -e 's/GDM_LANG=//'

#!/bin/sh
GLANG=`printenv|grep GDM_LANG|sed -e 's/GDM_LANG=//'`
echo $GLANG

Why is that hard?

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 14:48:36 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Stummvoll <michael@stummi.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org. (Fri, 13 Jan 2012 14:48:36 GMT) Full text and rfc822 format available.

Message #55 received at 655712@bugs.debian.org (full text, mbox):

From: Michael Stummvoll <michael@stummi.org>
To: Neil Williams <codehelp@debian.org>, 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 15:43:03 +0100
On 13.01.2012 15:36, Neil Williams wrote:
> $ printenv|grep GDM_LANG|sed -e 's/GDM_LANG=//'
>
> #!/bin/sh
> GLANG=`printenv|grep GDM_LANG|sed -e 's/GDM_LANG=//'`
> echo $GLANG
>
> Why is that hard?
>
did you really read and understand what I wrote in the package 
description and the upstream-website?

I want a tool, that reads (e.g from a file) content like

"foo ${BAR} blup"

and replaces ${BAR} here with the environment variable BAR

Regards,
Michael







Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org, Michael Stummvoll <michael@stummi.org>:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 15:03:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org, Michael Stummvoll <michael@stummi.org>. (Fri, 13 Jan 2012 15:03:08 GMT) Full text and rfc822 format available.

Message #60 received at 655712@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Michael Stummvoll <michael@stummi.org>
Cc: 655712@bugs.debian.org, debian-devel@lists.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 15:00:40 +0000
[Message part 1 (text/plain, inline)]
On Fri, 13 Jan 2012 15:43:03 +0100
Michael Stummvoll <michael@stummi.org> wrote:

> On 13.01.2012 15:36, Neil Williams wrote:
> > $ printenv|grep GDM_LANG|sed -e 's/GDM_LANG=//'
> >
> > #!/bin/sh
> > GLANG=`printenv|grep GDM_LANG|sed -e 's/GDM_LANG=//'`
> > echo $GLANG
> >
> > Why is that hard?
> >
> did you really read and understand what I wrote in the package 
> description and the upstream-website?

Then the description in the ITP needs to be improved.

The point about sed is that sed can substitute whatever you like into
whatever you like - printenv with grep and sed gets the value, then
another grep for the lines that matter and pass those lines to sed. It
really isn't hard.

> I want a tool, that reads (e.g from a file) content like
> 
> "foo ${BAR} blup"
> 
> and replaces ${BAR} here with the environment variable BAR

As Steve pointed out, then all you need is a little perl or other
language loop, not an entirely new package. Maybe it could fit into
moreutils but you'd have to convince those maintainers that it is worth
the effort.

The "problem" being solved is sufficiently trivial, common and varied
that any number of people will have already implemented their own
solutions without needing to add a dependency on another package. I've
probably got four or five slightly different versions hanging around in
various scripts and packages already. The advantage of a local
perl/python loop is that the entire thing is customised to only look
for lines which have 'foo' four characters from the start and not match
on 'bar' etc. Some need to skip blank lines, some need to collate lines
into paragraphs first ...., some need to handle comments, some don't,
some need to understand the content of the file to know what a comment
is...

Shells can run perl/python snippets as easily as calling anything else.
There's no reason to escalate that to a compiled tool.

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 15:15:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Stummvoll <michael@stummi.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org. (Fri, 13 Jan 2012 15:15:06 GMT) Full text and rfc822 format available.

Message #65 received at 655712@bugs.debian.org (full text, mbox):

From: Michael Stummvoll <michael@stummi.org>
To: Neil Williams <codehelp@debian.org>, 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 16:11:50 +0100
On 13.01.2012 16:00, Neil Williams wrote:
> The point about sed is that sed can substitute whatever you like into
> whatever you like - printenv with grep and sed gets the value, then
> another grep for the lines that matter and pass those lines to sed. It
> really isn't hard.
ok, please can you give me an example sed-command which replaces ${.*} 
with the according environment-variables? I couldn't find this yet and 
nobody could point me to it yet. The only way to do this I seeing atm is 
to iterate through $(printenv) and replace all listed 
environment-variables in the stream using sed. But this way seams very 
"bloat" to me.
And when i write such a tool for myself, why does it matter if i do this 
with python, perl, ruby, php, c or something else?

Regards,
Michael




Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org, Michael Stummvoll <michael@stummi.org>:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 15:15:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gergely Nagy <algernon@balabit.hu>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org, Michael Stummvoll <michael@stummi.org>. (Fri, 13 Jan 2012 15:15:09 GMT) Full text and rfc822 format available.

Message #70 received at 655712@bugs.debian.org (full text, mbox):

From: Gergely Nagy <algernon@balabit.hu>
To: Michael Stummvoll <michael@stummi.org>
Cc: 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 16:14:41 +0100
Michael Stummvoll <michael@stummi.org> writes:

> On 13.01.2012 15:05, Steve McIntyre wrote:
>> * I don't really see how this program is more useful than a very
>> simple shell (or perl, or python, or ...) loop to do the same
>> thing. 
> I looked a while for a simple shell loop which does exactly this. But
> could'nt find one, so I wrote this tool.
> All bash-scripts I found used some tricky eval-hacks, which i wanted
> to avoid.

I would suggest using perl, which is an essential package anyway, and
doing an env-var substitution on its stdin is as simple as this:

#! /usr/bin/perl -wnp
s/(\$\{([^\}]+)\})/$ENV{$2} || $1/eg;

A separate package for this is way overkill.

(By the way, you can abuse /usr/share/dh-exec/dh-exec-subst-env, which
does just that, and is part of the dh-exec package, if you don't want to
put it in a script in ~/bin or something. ;)

-- 
|8]





Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 15:24:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Stummvoll <michael@stummi.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org. (Fri, 13 Jan 2012 15:24:03 GMT) Full text and rfc822 format available.

Message #75 received at 655712@bugs.debian.org (full text, mbox):

From: Michael Stummvoll <michael@stummi.org>
To: Gergely Nagy <algernon@balabit.hu>, 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 16:21:26 +0100
On 13.01.2012 16:14, Gergely Nagy wrote:
> (By the way, you can abuse /usr/share/dh-exec/dh-exec-subst-env, which 
> does just that, and is part of the dh-exec package, if you don't want 
> to put it in a script in ~/bin or something. ;) 
ah, thanks. Thats what I looked for. So, the tool isn't too simple, as 
some people said, just its function is still provided by another tool 
(where nobody could point me yet), so i think the ITP can be closed

Greetings,
Michael





Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org, Michael Stummvoll <michael@stummi.org>:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 15:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gergely Nagy <algernon@balabit.hu>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org, Michael Stummvoll <michael@stummi.org>. (Fri, 13 Jan 2012 15:27:03 GMT) Full text and rfc822 format available.

Message #80 received at 655712@bugs.debian.org (full text, mbox):

From: Gergely Nagy <algernon@balabit.hu>
To: Michael Stummvoll <michael@stummi.org>
Cc: 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 16:25:47 +0100
Michael Stummvoll <michael@stummi.org> writes:

> On 13.01.2012 16:14, Gergely Nagy wrote:
>> (By the way, you can abuse /usr/share/dh-exec/dh-exec-subst-env,
>> which does just that, and is part of the dh-exec package, if you
>> don't want to put it in a script in ~/bin or something. ;) 
> ah, thanks. Thats what I looked for. So, the tool isn't too simple, as
> some people said, just its function is still provided by another tool
> (where nobody could point me yet), so i think the ITP can be closed

It IS dead simple. One line of perl, and not even a complex one.

It just so happens that dh-exec, out of pure coincidence, provides a
tool that runs that single line exactly the way you want to.

-- 
|8]





Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org, Michael Stummvoll <michael@stummi.org>:
Bug#655712; Package wnpp. (Fri, 13 Jan 2012 16:06:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org, Michael Stummvoll <michael@stummi.org>. (Fri, 13 Jan 2012 16:06:03 GMT) Full text and rfc822 format available.

Message #85 received at 655712@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Michael Stummvoll <michael@stummi.org>
Cc: 655712@bugs.debian.org, debian-devel@lists.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Fri, 13 Jan 2012 16:02:59 +0000
[Message part 1 (text/plain, inline)]
On Fri, 13 Jan 2012 16:11:50 +0100
Michael Stummvoll <michael@stummi.org> wrote:

> On 13.01.2012 16:00, Neil Williams wrote:
> > The point about sed is that sed can substitute whatever you like into
> > whatever you like - printenv with grep and sed gets the value, then
> > another grep for the lines that matter and pass those lines to sed. It
> > really isn't hard.
> ok, please can you give me an example sed-command which replaces ${.*} 
> with the according environment-variables? 

Just join the dots of the sample commands already included in this bug
report (which doesn't deserve this much of my time TBH). You may need a
few judicious uses of 'eval' to expand the variables but by that stage,
you might as well just do the entire job in perl, python or whatever
else. Just not in shell.

> I couldn't find this yet and 
> nobody could point me to it yet.

What's the quote... if I wanted to do what you're describing I wouldn't
start where you are currently... I'd have done it in perl and many
others would choose python. Just don't expect shell to do this
usefully. It's much quicker in a.n.other language.

> The only way to do this I seeing atm is 
> to iterate through $(printenv) and replace all listed 
> environment-variables in the stream using sed. But this way seams very 
> "bloat" to me.

Then don't use a shell interpreter to do the job, write the entire
thing in a sensible, fast, language - not just the parser.

Any perl or python or C loop would do exactly the same - scrobble
together all the desired variables out of the environment into an array
or hash, then load the file and substitute the value wherever the key of
the hash exists in what you've read from the file.

> And when i write such a tool for myself, why does it matter if i do this 
> with python, perl, ruby, php, c or something else?

It only matters because you gave the reason for the package as needing
to do this in shell and if you are going to write the parser in
something else, why bother doing the rest of the work in shell? Any
other language wouldn't need this kind of support and would do the
entire job a lot faster than a combination of the tool and shell.

Please do write it for yourself, just don't expect to find a use for it
in Debian.

If you can't work it out, I'm sorry but I don't have the time to walk
you through it. The package proposed is still too trivial and pointless
to be useful in Debian IMHO.

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org, Michael Stummvoll <michael@stummi.org>:
Bug#655712; Package wnpp. (Sun, 15 Jan 2012 16:39:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tollef Fog Heen <tfheen@err.no>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org, Michael Stummvoll <michael@stummi.org>. (Sun, 15 Jan 2012 16:39:09 GMT) Full text and rfc822 format available.

Message #90 received at 655712@bugs.debian.org (full text, mbox):

From: Tollef Fog Heen <tfheen@err.no>
To: Michael Stummvoll <michael@stummi.org>
Cc: 655712@bugs.debian.org
Subject: Re: Bug#655712: ITP: template -- environment variable expander | simple template tool
Date: Sun, 15 Jan 2012 17:34:49 +0100
]] Michael Stummvoll 

> template is a very simple tool that reads from stdin, expands
> variables in the form ${FOO} to its according environment variables
> and prints this to stdout.

It seems slightly excessive to package up

perl -pe 's/\${([^}]+)}/$ENV{$1}/ge'

as its own package.

If this actually is needed, put it in a script in moreutils?

Cheers,
-- 
Tollef Fog Heen
UNIX is user friendly, it's just picky about who its friends are




Added tag(s) wontfix. Request was from Michael Stummvoll <michael@stummi.org> to control@bugs.debian.org. (Fri, 20 Jan 2012 08:21:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, wnpp@debian.org, Michael Stummvoll <michael@stummi.org>:
Bug#655712; Package wnpp. (Mon, 27 May 2013 14:19:34 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lucas Nussbaum <lucas@debian.org>:
Extra info received and forwarded to list. Copy sent to wnpp@debian.org, Michael Stummvoll <michael@stummi.org>. (Mon, 27 May 2013 14:19:34 GMT) Full text and rfc822 format available.

Message #97 received at 655712@bugs.debian.org (full text, mbox):

From: Lucas Nussbaum <lucas@debian.org>
To: 655712@bugs.debian.org
Cc: control@bugs.debian.org
Subject: template: changing back from ITP to RFP
Date: Mon, 27 May 2013 15:24:18 +0200
retitle 655712 RFP: template -- environment variable expander | simple template tool
noowner 655712
tag 655712 - pending
thanks

Hi,

This is an automatic email to change the status of template back from ITP
(Intent to Package) to RFP (Request for Package), because this bug hasn't seen
any activity during the last 12 months.

If you are still interested in adopting template, please send a mail to
<control@bugs.debian.org> with:

 retitle 655712 ITP: template -- environment variable expander | simple template tool
 owner 655712 !
 thanks

However, it is not recommended to keep ITP for a long time without acting on
the package, as it might cause other prospective maintainers to refrain from
packaging that software. It is also a good idea to document your progress on
this ITP from time to time, by mailing <655712@bugs.debian.org>.

Thank you for your interest in Debian,
-- 
Lucas, for the QA team <debian-qa@lists.debian.org>



Changed Bug title to 'RFP: template -- environment variable expander | simple template tool' from 'ITP: template -- environment variable expander | simple template tool' Request was from Lucas Nussbaum <lucas@debian.org> to control@bugs.debian.org. (Mon, 27 May 2013 14:28:53 GMT) Full text and rfc822 format available.

Removed annotation that Bug was owned by Michael Stummvoll <michael@stummi.org>. Request was from Lucas Nussbaum <lucas@debian.org> to control@bugs.debian.org. (Mon, 27 May 2013 14:28:54 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 11:07:58 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.