ctdb/wscript: Avoid installing pre-built man pages which does not exist during make

Michael Adam obnox at samba.org
Wed Nov 11 06:14:02 UTC 2015


On 2015-11-11 at 14:54 +1100, Amitay Isaacs wrote:
> On Wed, Nov 11, 2015 at 1:01 PM, Martin Schwenke <martin at meltin.net> wrote:
> 
> > On Tue, 10 Nov 2015 19:06:38 +1100, Martin Schwenke <martin at meltin.net>
> > wrote:
> >
> > > On Tue, 10 Nov 2015 07:49:15 +0100, Michael Adam <obnox at samba.org>
> > > wrote:
> > >
> > > > On 2015-11-10 at 17:39 +1100, Martin Schwenke wrote:
> > > > > On Tue, 10 Nov 2015 07:33:26 +0100, Michael Adam <obnox at samba.org>
> > > > > wrote:
> > > > >
> > >  [...]
> > > >  [...]
> > > >  [...]
> > > >  [...]
> > >  [...]
> > > >  [...]
> > > >  [...]
> > >  [...]
> > > >  [...]
> > >  [...]
> > > >  [...]
> > >  [...]
> > > >  [...]
> > >  [...]
> > > > >
> > > > > That's a matter of opinion, but I can do that...  :-)
> > > >
> > > > Taste, even.
> > > >
> > > > > I just though that setting a clear condition in configure and then
> > > > > using it in build would be cleanest.
> > > >
> > > > 100% agreed, but if that condition says 'there are no pre-built
> > > > manpages' insted of 'we want to (and can) do xml processing',
> > > > then this is what I find confusing. Especially when the
> > > > creation of this condition is up in configure.
> > >
> > > Sure, I don't mind vague implicit stuff... but annoys other
> > > people...  :-)
> > >
> > >  [...]
> > > > >
> > > > > That's what I tried first.  Then when you run "make clean" it prints
> > > > > messages about whether it could find the pre-built manpages.  Cleaner
> > > > > to put it in configure so it doesn't get run in unexpected
> > contexts...
> > > >
> > > > Ah, that's a good argument. Sold.
> > > >
> > > > what about s/th like this:
> > > >
> > > > +    if 'XSLTPROC_MANPAGES' in conf.env and
> > conf.env['XSLTPROC_MANPAGES']:
> > > > +        conf.env.generate_manpages = True
> > > > +    else:
> > > > +        conf.env.generate_manpages = False
> > > > +
> > > > +        # --> don't even need to have this in else <--
> > > > +        Logs.info("xsltproc unavailable, checking for pre-built
> > manpages")
> > > > +        conf.env.ctdb_prebuilt_manpages = []
> > > > +        for m in manpages:
> > > > +            if os.path.exists(os.path.join("doc", m)):
> > > > +                Logs.info("  %s: yes" % (m))
> > > > +                conf.env.ctdb_prebuilt_manpages.append(m)
> > > > +            else:
> > > > +                Logs.info("  %s: no" % (m))
> > > >
> > > >  def build(bld):
> > > >      if bld.env.standalone_ctdb:
> > > > @@ -493,12 +504,12 @@ def build(bld):
> > > >                              target=x,
> > > >                              rule='sed %s ${SRC} > ${TGT}' %
> > (sed_cmdline))
> > > >
> > > > -    if 'XSLTPROC_MANPAGES' in bld.env and
> > bld.env['XSLTPROC_MANPAGES']:
> > > > +    if bld.env.generate_manpages:
> > > >          bld.MANPAGES('''onnode.1 ctdbd_wrapper.1 ctdbd.conf.5
> > > >                          ctdb.7 ctdb-statistics.7 ctdb-tunables.7''',
> > > >                        True)
> > > >      else:
> > > > -        for m in manpages:
> > > > +        for m in bld.env.ctdb_prebuilt_manpages:
> > > >              bld.SAMBA_GENERATOR(m,
> > > >                                  source=os.path.join("doc", m),
> > > >                                  target=m,
> > >
> > > Sold!  Want to push it?  :-)
> >
> > OK, "final" version attached.  :-)  Only change from above is to use
> > foo.env.ctdb_generate_manpages to avoid potential collision...
> >
> > peace & happiness,
> > martin
> >
> 
> Pushed to autobuid with Michael's RB.

Thanks - Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20151111/4a93bbf7/signature.sig>


More information about the samba-technical mailing list