#34 Use printf instead of non-portable echo -n

system_independent
closed
None
5
2014-08-06
2013-12-25
No

When configuring dar 2.4.11 on OS X 10.9.1, the output is:

dar and libdar have been successfully configured with the following parameters:

  LIBDAR parameters:
-n    Zlib compression (gzip)    : 
YES
-n    Libbz2 compression (bzip2) : 
YES
-n    Liblzo2 compression (lzo)  : 
YES
-n    Strong encryption support  : 
YES
-n    Extended Attributes support: 
YES
-n    Large files support (> 2GB): 
YES
-n    ext2fs NODUMP flag support : 
NO
-n    Special allocation scheme  : 
YES
-n    Integer size used          : 
infinint
-n    Thread safe support        : 
YES
-n    Furtive read mode          : 
NO
-n    Large directory optim.     : 
YES

  DAR SUITE command line programs:
-n    Long options available : 
YES
-n    Building examples      : 
NO
-n    Building dar_static    : 
NO  (system does not support static linking, see note below)
-n    using upx at install   : 
NO
-n    building documentation : 
YES

This can be fixed by using printf instead of echo -n, as in the attached patch. (echo -n is not portable and POSIX-compliant systems like OS X do not implement the -n flag.) After the patch, the result is:

dar and libdar have been successfully configured with the following parameters:

  LIBDAR parameters:
   Zlib compression (gzip)    : YES
   Libbz2 compression (bzip2) : YES
   Liblzo2 compression (lzo)  : YES
   Strong encryption support  : YES
   Extended Attributes support: YES
   Large files support (> 2GB): YES
   ext2fs NODUMP flag support : NO
   Special allocation scheme  : YES
   Integer size used          : infinint
   Thread safe support        : YES
   Furtive read mode          : NO
   Large directory optim.     : YES

  DAR SUITE command line programs:
   Long options available : YES
   Building examples      : NO
   Building dar_static    : NO  (system does not support static linking, see note below)
   using upx at install   : NO
   building documentation : YES
1 Attachments

Discussion

  • Denis Corbin

    Denis Corbin - 2013-12-25

    Hello Ryan,

    Thanks for your feedback and patch. I agree with this change. It has been added to GIT for next stable release (2.4.12)

    Kind Regards,
    Denis.

     
  • Denis Corbin

    Denis Corbin - 2013-12-25
    • status: open --> accepted
    • assigned_to: Denis Corbin
    • Priority: 1 --> 5
     
  • Denis Corbin

    Denis Corbin - 2014-01-14
    • status: accepted --> git-merged
     
  • Denis Corbin

    Denis Corbin - 2014-01-18

    New release (2.4.12) contains that patch, closing this report.

     
  • Denis Corbin

    Denis Corbin - 2014-01-18
    • status: git-merged --> closed
     

Log in to post a comment.