This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for generic-build-script


On Fri, 13 Aug 2004, Gerrit P. Haase wrote:

> Hello Igor,
>
> On 12. August 2004, Igor wrote:
>
> > On Thu, 12 Aug 2004, Robb, Sam wrote:
>
> [...]
>
> >> - When compressing info files as part of an install, uses the
> >>   -exec option of find rather than xargs.
> >>
> >>   Packages that already compress info files on install will create
> >>   an info dir, but there will not be any *.info files under that
> >>   directory.  Find fails, and xargs attempts to call gzip without
> >>   any input.  As a result, you get the error:
> >>
> >>     gzip: compressed data not written to a terminal. Use -f to force compression.
> >>     For help, type: gzip -h
> >>
> >>   ... and the install fails.  Using the -exec option of find ensures
> >>   that gzip is only executed when an info file is found.
>
> > Good catch.  I'd rather add the '-r' ('--no-run-if-empty') flag to the
> > all of the xargs invocations, though.
>
> We already discussed this and IIRC the best option would be to use
> `-type f` instead of `-name *.info` for the find options.

Yes, but passing -r to xargs is orthogonal to this issue, and is generally
a good idea.  In fact, I should actually go through all of the xargs
invocations and add -r to all of them...  I'll do it in a bit.

> >> - When compressing files using gzip as part of an install, adds
> >>   the -f flag to the gzip arguments to force compression.
> >>
> >> -Samrobb
>
> > Why?  Is it just to force compression of files that wouldn't benefit from
> > it?  Frankly, I'm not clear on why this is useful...
>
> OTOH it is annoying that the script produces an error if there are
> already compressed files and there is nothing to do.

Hmm, true.  But maybe ignoring the gzip error code is a better way to get
the script to continue?  Alternatively, something like

find ${instdir}${prefix}/share/info -type f -name "*.info*" \
  \( -exec test -e {}".gz" \; -o -print \) | xargs -r gzip -q ; \

could also work (even though it'll do multiple invocations of "test").
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]