RE: generic build script 'help' patch
Igor wrote: On Mon, 11 Oct 2004, Hannu E K Nevalainen wrote: Igor: I hacked around some, and ended up short of my intentions; in hope it helps some I've *EDITED down* my changes to the attached patch. Feel free to do with it whatever you like. (Non copyrighted material, cgf BEWARE! ;-) Ok, thanks, I'll take a look, but why did this move to the main list from cygwin-apps? I'm redirecting this back to cygwin-apps. Igor Bah! :-7 - The redirect was unintentional. The patch: Mostly make places for manual changes more obvious, and display a more informative message at failure. /Hannu E K Nevalainen, B.Sc. EE Microcomputer systems--72-- ** mailing list preference; please keep replies on list ** -- printf(LocalTime: UTC+%02d\n,(DST)? 2:1); -- --END OF MESSAGE--
RE: generic build script 'help' patch
There is one problem IMO; the script (with the patch) won't allow displaying help unless there is a matching generic-build.{tar,tar.bz,tar.gz} (or some such, you get the picture I hope) file in the same dir. I thought about this, but decided it wasn't important for end-users. For anyone who downloads and unpacks a Cygwin package source archive, the upstream source tarball will be present in the same directory as the build script. The people this might help is Cygwin packagers. But I decided they probably already have read the writeup on cygwin.com, so it wasn't very important for them. But I guess there's no harm in making the help text available even if there's no source archive.
RE: generic build script 'help' patch
On Mon, 11 Oct 2004, Hannu E K Nevalainen wrote: you wrote: Feel free to improve the particulars of my help text. The main thing is that I think some help text is needed. Andrew. There is one problem IMO; the script (with the patch) won't allow displaying help unless there is a matching generic-build.{tar,tar.bz,tar.gz} (or some such, you get the picture I hope) file in the same dir. Igor: I hacked around some, and ended up short of my intentions; in hope it helps some I've *EDITED down* my changes to the attached patch. Feel free to do with it whatever you like. (Non copyrighted material, cgf BEWARE! ;-) Ok, thanks, I'll take a look, but why did this move to the main list from cygwin-apps? I'm redirecting this back to cygwin-apps. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_[EMAIL PROTECTED] ZZZzz /,`.-'`'-. ;-;;,_[EMAIL PROTECTED] |,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
RE: generic build script 'help' patch
Here is a patch that adds some 'help' or 'usage' text to the generic build script. This seems to me to be a useful thing for someone who has downloaded and unpacked a package source archive; sees the package source, patch, and build script; and wonders what to do next. As a guess, they try running './package-ver.sh --help' or similar, and now instead of getting back 'Error: bad arguments', they get some description of the script's purpose and available options, as well as a pointer to the build script discussion on cygwin.com. I also find the usage summary useful as a reminder to myself of what some of my available operations are, and exactly what 'all' does. Feel free to improve the particulars of my help text. The main thing is that I think some help text is needed. Andrew. Hear hear. -- Gary R. Van Sickle --- generic-build-script.orig 2004-10-08 22:48:07.0 -0400 +++ generic-build-script 2004-10-10 23:58:23.0 -0400 @@ -30,6 +30,7 @@ fi fi +scriptname=`basename $0` tscriptname=`basename $0 .sh` export PKG=`echo $tscriptname | sed -e 's/\-[^\-]*\-[^\-]*$//'` export VER=`echo $tscriptname | sed -e s/${PKG}\-// -e 's/\-[^\-]*$//'` @@ -320,6 +321,47 @@ echo You need the gnupg package installed in order to check signatures. ; \ fi } +usage() { + echo Build script for the Cygwin ${PKG} package. +Adapted from the Cygwin generic-build-script; see +http://cygwin.com/setup.html#srcpackage_contents for detailed usage instructions. +Usage: ${scriptname} operation... +build operations: + all build source and binary packages + (same as: prep conf build check install strip pkg spkg) + buildrun 'make' on patched source + conf run ./configure + configurerun ./configure + checkrun test suite + make run 'make' on patched source + prep unpack and patch package source; run mkdirs + stripstrip built executables + test run test suite +packaging operations: + firstbuild source package first time, from existing patched + source directory (same as: mkdirs spkg finish) + install install package into installation staging subdir + package build binary package + pkg build binary package + spkg build source package + src-package build source package +information: + depend list packages on which the binary package depends + help display this message + list list files in the binary package + usagedisplay this message +minor operations: + acceptpatch accept Cygwin source patch + checksig check package, patch, and script signatures + cleanrun 'make clean' + finish remove source directory + mkdirs create package staging directories + mkpatch create Cygwin source patch + reconf remove build staging dir and rerun ./configure + +} + +test -n $1 || set usage while test -n $1 ; do case $1 in prep) prep ; STATUS=$? ;; @@ -348,7 +390,10 @@ all) checksig prep conf build install \ strip pkg spkg finish ; \ STATUS=$? ;; -*) echo Error: bad arguments ; exit 1 ;; +help|-help|--help|usage) usage ; STATUS=$? ;; +*) echo ${scriptname}: error: unknown argument \$1\ ; + echo ${scriptname}: run \${scriptname} help\ to get a usage summary ; + exit 1 ;; esac ( exit ${STATUS} ) || exit ${STATUS} shift