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: Busted generic build script?


On Thu, 18 Mar 2004, Harold L Hunt II wrote:

I have been having trouble with unmodified copies of the most recent
generic build script.

Symptoms
========
The build script just doesn't work, it does *nothing* it always produces
an error... it basically doesn't parse right due to the install_docs
variable.  Removing all entries from install_docs that the shell
complains about results in a script that runs, but it silently fails to
install any of the listed document names during the install step.

Attached is an example that reproduces the problem.

Steps to reproduce
==================
1) Save files to a directory
2) tar xjf foo-1.0.tar.bz2
3) ./foo-1.0-1.sh mkdirs
4) Observe the following output:
export: BUG-REPORTS: bad variable name

I think the following analysis is telling:
1) Run these commands in a bash shell:
export install_docs="ABOUT-NLS"
export install_docs=`for i in ${install_docs}; do echo $i; done | sort -u`
set | grep install_docs

2) Observe the output:
install_docs=ABOUT-NLS

3) Run these commands in a bash shell:
export install_docs="ABOUT-NLS FOO"
export install_docs=`for i in ${install_docs}; do echo $i; done | sort -u`
set | grep install_docs

4) Observe the output:
install_docs=$'ABOUT-NLS\nFOO'

Possible Solution
=================
It seems to me that the sorting of the install_docs list is pretty
useless since this is a static list that might be updated once or twice
during the development of a package.  Removing the sorting step removes
both symptoms described above.  Of course, any other solution that also
fixes the problem is acceptable to me.

Harold

Oops. Mea culpa. I've verified that it worked in bash, and ran the script through "sh -n" (which turns out to not be enough).

Harold, could you please try the attached patch and see if it fixes things
for you?  If yes, I'll commit it to CVS.
	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!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

Attachment: gbs-sort.patch
Description: Text document


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