This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
RE: Possible bug with generic build script.
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Gareth Pearce <tilps at probablyprime dot net>
- Cc: cygwin-apps at cygwin dot com
- Date: Thu, 14 Oct 2004 19:04:10 -0400 (EDT)
- Subject: RE: Possible bug with generic build script.
- References: <200410142236.i9EMae4a066374@smtp1.adl2.internode.on.net>
- Reply-to: cygwin-apps at cygwin dot com
On Fri, 15 Oct 2004, Gareth Pearce wrote:
> > On Wed, 13 Oct 2004, Charles Wilson wrote:
> >
> > > Igor Pechtchanski wrote:
> > >
> > > > You're right, it *is* broken. It was never intended to be used with
> > > > subdirectories, so I never tested it. I'll try to come up with a way
> > > > of accomodating subdirs shortly.
> >
> > In fact, it shouldn't've worked with wildcards either, the way it was
> > written... Oops. The new patch should fix it, though -- still waiting on
> > the confirmation.
>
> The patch fixes my specific wild card case.
Good to hear this. I've commited this change.
> > > I use tar when I need to do that, in my locally-modified gbs's.
> > > Something like this:
> > >
> > > (cd theDocDirInSrcTree; tar cf aSubDir |\
> > > tar -C ${instdir}${prefix}/share/doc/${PKG}-${VER} -xvf -)
> > >
> > > repeat as needed, or use a filelist of some kind instead of aSubDir.
> >
> > Hey, neat. This won't be needed if the filename is a wildcard, but if
> > it's just a directory name, this could be useful. I'm wondering whether
> > to require people to explicitly specify wildcards (which will make the
> > code clearer anyway), or to allow the use of directory names... IOW,
> > 'aSubDir/*' vs. 'aSubDir'... I suppose if the tree at aSubDir is more
> > than one level deep...
>
> In cyrus-sasl there was two cases I wanted, one where the copying of files
> in a wildcard/specified fashion occurred in a way which the resultant
> directory structure matched the source and the other where the resultant
> directory structure was flattened. The current patch works for wildcards
> aiming into a single target directory.
Even simpler -- it works for wildcards aiming from a single target
directory to a single source directory, i.e., it won't magically flatten a
directory tree for you, you'll have to use "find" for that...
If you need to copy directory structures using the install_docs mechanism,
I suppose it could be done with something like the patch below -- give it
a shot. You will have to put a "/" after each directory that you want
copied as a tree. The flattening is a bit harder, but still doable.
HTH,
Igor
Index: generic-build-script
===================================================================
RCS file: /cvs/cygwin-apps/packaging/templates/generic-build-script,v
retrieving revision 1.29
diff -u -p -r1.29 generic-build-script
--- generic-build-script 14 Oct 2004 22:55:26 -0000 1.29
+++ generic-build-script 14 Oct 2004 23:00:30 -0000
@@ -193,11 +193,14 @@ install() {
fi && \
templist="" && \
for fp in ${install_docs} ; do \
- for f in ${srcdir}/$fp ; do \
- if [ -f $f ] ; then \
- templist="$templist $f"; \
- fi ; \
- done ; \
+ case "$fp" in \
+ */) templist="$templist `find $fp -type f`" ;;
+ *) for f in ${srcdir}/$fp ; do \
+ if [ -f $f ] ; then \
+ templist="$templist $f"; \
+ fi ; \
+ done ;; \
+ esac ; \
done && \
if [ ! "x$templist" = "x" ]; then \
/usr/bin/install -m 644 $templist \
--
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