On 2014-04-03 02:27 PM, Kern Sibbald wrote:
> Strange. I build FreeBSD binaries, and I never had to make *any*
> patches to Bacula to build an run it. I seem to be missing something
> here. Please don't get me wrong, I am not complaining or anything like
> that, but I have a hard time understanding what the real problem is
> other than "printf" doesn't work like echo and what to do about it in
> a portable way.

I have no explanation as to why I'm encountering this problem, but I 
have a simple test below.


I hope what I have here may lead to a solution. I don't have one, but I 
know why the code fails:

To test, I removed the patches for 5.2.12 which change ECHO to echo (see 
my previous post below for an outline of those changes).

After doing a make configure, I run make.  These are the errors:

# make
===>  Building for bacula-server-5.2.12_3
==>Entering directory 
/var/ports/root/bacula-server/work/bacula-5.2.12/src
==>Entering directory 
/var/ports/root/bacula-server/work/bacula-5.2.12/scripts
==>Entering directory 
/var/ports/root/bacula-server/work/bacula-5.2.12/src/cats
"Makefile", line 518: Need an operator
make: fatal errors encountered -- cannot continue
   ====== Error in 
/var/ports/root/bacula-server/work/bacula-5.2.12/src/cats ======
*** [all] Error code 1
1 error
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure 
to
the maintainer.
*** [do-build] Error code 1

Stop in /root/bacula-server.
*** [build] Error code 1

Stop in /root/bacula-server.

I have copied src/cats/Makefile to 
http://www.langille.org/tmp/src-cats-Makefile.txt so you can view it.

For comparison, this is the file created with the FreeBSD patches for 
echo:

   http://www.langille.org/tmp/src-cats-Makefile2.txt

The file sizes?

-rw-r--r--  1 dan  www  72754 Apr  3 19:54 src-cats-Makefile2.txt
-rw-r--r--  1 dan  www  72757 Apr  3 19:48 src-cats-Makefile.txt


Only 3 bytes difference.  The error is clear in the diff.  A missing 
newline:

$ diff src-cats-Makefile.txt src-cats-Makefile2.txt
432c432
<       @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
---
>       @echo "# DO NOT DELETE: nice dependency list follows" >> Makefile
456c456,457
< # DO NOT DELETE: nice dependency list followsnbvfs.lo: bvfs.c 
../bacula.h ../config.h /usr/include/stdint.h \
---
> # DO NOT DELETE: nice dependency list follows
> bvfs.lo: bvfs.c ../bacula.h ../config.h /usr/include/stdint.h \

See that 'n' after 'follows'?  That's not supposed to be there.  It's 
supposed to be a newline.

Could that be the \n from " ECHO='printf %s\n'" is causing an issue?


Kern, this is the test you can try on your FreeBDS system:

Which let me to this test:

# echo testing
testing
# printf testing
testing#
#
#
# printf %s\n testing
testingn# printf %s\n, testing
testingn,#
# printf "%s\n", testing
testing
,# printf "%s\n" testing
testing
#

It seems you have to have "double quotes"

So I tried: ECHO='printf "%s\n"' but that gives:

config.status: creating src/config.h
config.status: executing libtool commands
./config.status: "printf: not found
config.status: executing default-1 commands


leading to:

/var/ports/root/bacula-server/work/bacula-5.2.12/libtool: not found


and more




I also tried: ECHO='printf \'%s\n\''


But that led to:

checking how to print strings... ./configure: 4: Syntax error: end of 
file unexpected (expecting word)
./configure: 6396: Syntax error: Error in command substitution
===>  Script "configure" failed unexpectedly.



Does this help?

> 
>  Best regards,
>  Kern
> 
>  On 04/03/2014 04:00 PM, Dan Langille wrote:
>  > On 2014-04-03 09:51 AM, Martin Simmons wrote:
>  >> This problem with ECHO affects the main bacula makefiles as well.
> The
>  >> definition of ECHO comes from libtool.m4, but it will not work in
> makefiles
>  >> because of the backslash.
>  >>
>  >> I think the makefiles should stop using ECHO, or at least
> Make.common.in
>  >> should do something like:
>  >>
>  >> ECHO = @MAKEFILEECHO@
>  >>
>  >> where configure can define MAKEFILEECHO correctly.
>  >>
>  >> __Martin
>  >
>  > I'm all for doing something like that.
>  >
>  > FYI, FreeBSD has had these patches for Bacula for years. If we can
> fix them all, it will simplify the porting process. Each new release,
> the patches need to be updated.
>  >
>  > [dan@slocum:/usr/ports/sysutils/bacula-server/files] $ grep ECHO
> patch-src__*
>  > patch-src__cats__Makefile.in:- @$(ECHO) "# DO NOT DELETE: nice
> dependency list follows" >> Makefile
>  > patch-src__dird__Makefile.in:- @$(ECHO) "# DO NOT DELETE: nice
> dependency list follows" >> Makefile
>  > patch-src__findlib__Makefile.in:- @$(ECHO) "# DO NOT DELETE: nice
> dependency list follows" >> Makefile
>  > patch-src__lib__Makefile.in:- @$(ECHO) "# DO NOT DELETE: nice
> dependency list follows" >> Makefile
>  > patch-src__stored__Makefile.in:- @$(ECHO) "# DO NOT DELETE: nice
> dependency list follows" >> Makefile
>  > patch-src__tools__Makefile.in: $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c
> $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE)
> $(CFLAGS) $<
>  > patch-src__tools__Makefile.in:- @$(ECHO) "# DO NOT DELETE: nice
> dependency list follows" >> Makefile
>  >
>  >
>  >>
>  >>
>  >>
>  >>>>>>> On Wed, 2 Apr 2014 19:19:16 -0400, Dan Langille said:
>  >>>
>  >>> I had local changes for this echo problem. I just did a 'git
> stash' on my checkout so I could try 7.0.2
>  >>>
>  >>> It fails.
>  >>>
>  >>> I notice that the 5.x code using:
>  >>>
>  >>> @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >>
> Makefile
>  >>>
>  >>> It works.
>  >>>
>  >>> This makes me think: has configure changed?
>  >>>
>  >>> So I went looking at another regression testing jail. I found
> this:
>  >>>
>  >>> $ diff configure configure.orig
>  >>> 6056c6056
>  >>> < ECHO='echo'
>  >>> ---
>  >>> > ECHO='printf %sn'
>  >>>
>  >>> I have a local patch. That's why it works here. I'm sure if we
> search the archives, I reported this same problem back when I first
> set up my first round of regression testing.
>  >>>
>  >>> Look what I have in my regression test script:
>  >>>
>  >>> # patch the printf / echo problem
>  >>> cd bacula
>  >>> patch -N < ${CONFIG_DIR_SRC}/patch-bacula-printf
>  >>> cd -
>  >>>
>  >>> Here is the patch itself:
>  >>>
>  >>> $ cat patch-bacula-printf
>  >>> --- bacula/configure.orig
>  >>> +++ bacula/configure
>  >>> @@ -6045,7 +6045,7 @@ if test "X`( print -r -- -n ) 2>/dev/null`"
> = X-n &&
>  >>> test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
>  >>> ECHO='print -r --'
>  >>> elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
>  >>> - ECHO='printf %sn'
>  >>> + ECHO='echo'
>  >>> else
>  >>> # Use this function as a fallback that always works.
>  >>> func_fallback_echo ()
>  >>>
>  >>>
>  >>> And this is the patch I just created for bacula7:
>  >>>
>  >>> $ cat patch-bacula7-printf
>  >>> --- configure~ 2014-04-02 21:55:27.000000000 +0000
>  >>> +++ configure 2014-04-02 23:12:21.022646230 +0000
>  >>> @@ -5977,7 +5977,7 @@
>  >>> test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
>  >>> ECHO='print -r --'
>  >>> elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
>  >>> - ECHO='printf %sn'
>  >>> + ECHO='echo'
>  >>> else
>  >>> # Use this function as a fallback that always works.
>  >>> func_fallback_echo ()
>  >>>
>  >>>
>  >>> That local patch allows the regression testing to proceed
> unhindered on FreeBSD (9.2 in this particular case). It's running now.
>  >>>
>  >>> On Apr 1, 2014, at 9:27 PM, Dan Langille <d...@langille.org>
> wrote:
>  >>>
>  >>> > In addition to my previous post, this just in:
> http://regress.bacula.org/viewTest.php?onlyfailed&buildid=24144 [1]
>  >>> >
>  >>> > Only disk:tls-test failed this time.
>  >>> >
>  >>> > On Mar 31, 2014, at 11:16 AM, Kern Sibbald <k...@sibbald.com>
> wrote:
>  >>> >
>  >>> >> Hello Dan,
>  >>> >>
>  >>> >> Can you try applying the attached patch to release 7.0.0 and
> see if it
>  >>> >> fixes the problem with the tls-test? I am not 100% convinced
> that it
>  >>> >> will, but at least the code is much tighter now and will not
> store any
>  >>> >> address if it is not either IPv4 or IPv6 and if IPv6 is not
> configured
>  >>> >> and it resolves an IPv6 address, it will not be used.
>  >>> >>
>  >>> >> Best regards,
>  >>> >> Kern
>  >>> >>
>  >>> >> On 03/31/2014 03:44 PM, Dan Langille wrote:
>  >>> >>> On 2014-03-31 09:01 AM, Dan Langille wrote:
>  >>> >>>> On 2014-03-31 07:36 AM, Kern Sibbald wrote:
>  >>> >>>>>
>  >>> >>>>>
>  >>> >>>>>
>  >>>>>>> Links:
>  >>>>>>> ------
>  >>>>>>> [1] http://regress.bacula.org/buildSummary.php?buildid=24125
> [2]
>  >>>>>>> [2] https://lists.sourceforge.net/lists/listinfo/bacula-devel
> [3]
>  >>>>>>> [3] http://www.enigmail.net/ [4]
>  >>> >>
>  >>> >>
> <ipv6_check.patch>------------------------------------------------------------------------------
>  >>> >> _______________________________________________
>  >>> >> Bacula-devel mailing list
>  >>> >> Bacula-devel@lists.sourceforge.net
>  >>> >> https://lists.sourceforge.net/lists/listinfo/bacula-devel [3]
>  >>> >
>  >>> > --
>  >>> > Dan Langille - http://langille.org [5]
>  >>> >
>  >>> >
> ------------------------------------------------------------------------------
>  >>> > _______________________________________________
>  >>> > Bacula-devel mailing list
>  >>> > Bacula-devel@lists.sourceforge.net
>  >>> > https://lists.sourceforge.net/lists/listinfo/bacula-devel [3]
>  >>>
>  >>> --
>  >>> Dan Langille - http://langille.org [5]
>  >>>
>  >>>
>  >
> 
> 
> 
> Links:
> ------
> [1] http://regress.bacula.org/viewTest.php?onlyfailed&amp;buildid=24144
> [2] http://regress.bacula.org/buildSummary.php?buildid=24125
> [3] https://lists.sourceforge.net/lists/listinfo/bacula-devel
> [4] http://www.enigmail.net/
> [5] http://langille.org

-- 
Dan Langille - http://langille.org/

------------------------------------------------------------------------------
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to