Re: newsyslog alt compression support?

2022-11-23 Thread Todd T. Fries
tar -j .. uses bzip2. "The bzip2 utility must be installed separately."

I figured it was a long shot. Certainly not as I've done it in any event.

Thanks,

Penned by Theo de Raadt on 20221118 18:23.33, we have:
| I completely disagree on this, of course.
| 
| We do not make base use ports.  
| 
| Todd T. Fries  wrote:
| 
| > I love xz compression. It really pinches the bytes outa ascii files, which 
log files
| > are of course made of.
| > 
| > Is there a direction someone can point me in that would permit the 
functionality this
| > diff provides without hardcoding it and perhaps be acceptable for the tree?
| > 
| > 
| > diff --git a/usr.bin/newsyslog/Makefile b/usr.bin/newsyslog/Makefile
| > index 1bb0ce36439..03787a6439b 100644
| > --- a/usr.bin/newsyslog/Makefile
| > +++ b/usr.bin/newsyslog/Makefile
| > @@ -6,4 +6,8 @@ BINOWN= root
| >  
| >  MAN=   newsyslog.8
| >  
| > +CFLAGS += -DCOMPRESS='"/usr/local/bin/xz"'
| > +CFLAGS += -DCOMPRESS_FORCE='"-f9e"'
| > +CFLAGS += -DCOMPRESS_POSTFIX='".xz"'
| > +
| >  .include 
| > diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
| > index 066167151ca..7d3a959ad90 100644
| > --- a/usr.bin/newsyslog/newsyslog.c
| > +++ b/usr.bin/newsyslog/newsyslog.c
| > @@ -73,8 +73,15 @@
| >  
| >  #define CONF "/etc/newsyslog.conf"
| >  #define PIDFILE "/var/run/syslog.pid"
| > +#ifndef COMPRESS
| >  #define COMPRESS "/usr/bin/gzip"
| > +#endif
| > +#ifndef COMPRESS_FORCE
| > +#define COMPRESS_FORCE "-f"
| > +#endif
| > +#ifndef COMPRESS_POSTFIX
| >  #define COMPRESS_POSTFIX ".gz"
| > +#endif
| >  #define STATS_DIR "/var/run"
| >  #define SENDMAIL "/usr/sbin/sendmail"
| >  
| > @@ -925,7 +932,7 @@ compress_log(struct conf_entry *ent)
| > if (pid == -1) {
| > err(1, "fork");
| > } else if (pid == 0) {
| > -   (void)execl(COMPRESS, base, "-f", tmp, (char *)NULL);
| > +   (void)execl(COMPRESS, base, COMPRESS_FORCE, tmp, (char *)NULL);
| > warn(COMPRESS);
| > _exit(1);
| > }
| > -- 
| > Todd Fries .. t...@fries.net
| > 
| >  
| > |\  1.636.410.0632 (voice)
| > | Free Daemon Consulting, LLC\  1.405.227.9094 (voice)
| > | http://FreeDaemonConsulting.com\  1.866.792.3418 (FAX)
| > | PO Box 16169, Oklahoma City, OK 73113-2169 \  sip:freedae...@ekiga.net
| > | "..in support of free software solutions." \  sip:4052279...@ekiga.net
| >  \
| >  
| >   37E7 D3EB 74D0 8D66 A68D  B866 0326 204E 3F42 004A
| > http://todd.fries.net/pgp.txt
| > 

-- 
Todd T. Fries . http://todd.fries.net/pgp.txt . @unix2mars . github:toddfries



Re: newsyslog alt compression support?

2022-11-18 Thread Theo de Raadt
I completely disagree on this, of course.

We do not make base use ports.  

Todd T. Fries  wrote:

> I love xz compression. It really pinches the bytes outa ascii files, which 
> log files
> are of course made of.
> 
> Is there a direction someone can point me in that would permit the 
> functionality this
> diff provides without hardcoding it and perhaps be acceptable for the tree?
> 
> 
> diff --git a/usr.bin/newsyslog/Makefile b/usr.bin/newsyslog/Makefile
> index 1bb0ce36439..03787a6439b 100644
> --- a/usr.bin/newsyslog/Makefile
> +++ b/usr.bin/newsyslog/Makefile
> @@ -6,4 +6,8 @@ BINOWN=   root
>  
>  MAN= newsyslog.8
>  
> +CFLAGS += -DCOMPRESS='"/usr/local/bin/xz"'
> +CFLAGS += -DCOMPRESS_FORCE='"-f9e"'
> +CFLAGS += -DCOMPRESS_POSTFIX='".xz"'
> +
>  .include 
> diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
> index 066167151ca..7d3a959ad90 100644
> --- a/usr.bin/newsyslog/newsyslog.c
> +++ b/usr.bin/newsyslog/newsyslog.c
> @@ -73,8 +73,15 @@
>  
>  #define CONF "/etc/newsyslog.conf"
>  #define PIDFILE "/var/run/syslog.pid"
> +#ifndef COMPRESS
>  #define COMPRESS "/usr/bin/gzip"
> +#endif
> +#ifndef COMPRESS_FORCE
> +#define COMPRESS_FORCE "-f"
> +#endif
> +#ifndef COMPRESS_POSTFIX
>  #define COMPRESS_POSTFIX ".gz"
> +#endif
>  #define STATS_DIR "/var/run"
>  #define SENDMAIL "/usr/sbin/sendmail"
>  
> @@ -925,7 +932,7 @@ compress_log(struct conf_entry *ent)
>   if (pid == -1) {
>   err(1, "fork");
>   } else if (pid == 0) {
> - (void)execl(COMPRESS, base, "-f", tmp, (char *)NULL);
> + (void)execl(COMPRESS, base, COMPRESS_FORCE, tmp, (char *)NULL);
>   warn(COMPRESS);
>   _exit(1);
>   }
> -- 
> Todd Fries .. t...@fries.net
> 
>  
> |\  1.636.410.0632 (voice)
> | Free Daemon Consulting, LLC\  1.405.227.9094 (voice)
> | http://FreeDaemonConsulting.com\  1.866.792.3418 (FAX)
> | PO Box 16169, Oklahoma City, OK 73113-2169 \  sip:freedae...@ekiga.net
> | "..in support of free software solutions." \  sip:4052279...@ekiga.net
>  \
>  
>   37E7 D3EB 74D0 8D66 A68D  B866 0326 204E 3F42 004A
> http://todd.fries.net/pgp.txt
>