Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Reply-To: From: "Alan Miles" To: Subject: Diff for generic readme and generic-build script Date: Mon, 17 Nov 2003 17:52:24 -0600 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0056_01C3AD33.8EF034B0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 ------=_NextPart_000_0056_01C3AD33.8EF034B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit All, Based on the 1.8 version of the generic build script I would like to submit this patch, which would: 1/ the option "all" does not call "list". The fix in the patch does. 2/ The patches to both file let the PKG, VER, and REL variables in the README be automatically be filled in by the script - then maintainers won't have to manually do this. 3/ This patch fulfills the wish to have the file names be automatically be placed in the README prior to binary/src build releases. The 1.8 version heads in that direction, but the functionality isn't there. 4/ I have defined a NEWVER variable to handle the part of the original README 5/ Defined a new export variable: 'ThePackageReadMeFile' which defines the Package README file name (saves defining it twice) - both 'list' and 'install' use it 6/ I haven't renamed the routine "list", which it should be since it is a "package" readme editor 7/ Note: the -i option to sed (quoting the man page for sed): -i[suffix], --in-place[=suffix] edit files in place (makes backup if extension supplied) Extended sed command: `e [COMMAND]' This command allows one to pipe input from a shell command into pattern space. Without parameters, the `e' command executes the command that is found in pattern space and replaces the pattern space with the output; a trailing new-line is suppressed. If a parameter is specified, instead, the `e' command interprets it as a command and sends it to the output stream (like `r' does). The command can run across multiple lines, all but the last ending with a back-slash. In both cases, the results are undefined if the command to be executed contains a NUL character. These together constitute the operation of the modifications. _____________________________________________________ Alan Miles ICQ#: 171006836 More ways to contact me: http://wwp.icq.com/171006836 _____________________________________________________ ------=_NextPart_000_0056_01C3AD33.8EF034B0 Content-Type: application/octet-stream; name="packaging_templates.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="packaging_templates.diff" diff -ur Original/generic-build-script New/generic-build-script=0A= --- Original/generic-build-script 2003-10-26 23:14:08.000000000 -0600=0A= +++ New/generic-build-script 2003-11-17 17:19:19.590222400 -0600=0A= @@ -24,6 +24,7 @@=0A= export VER=3D`echo $tscriptname | sed -e "s/${PKG}\-//" -e = 's/\-[^\-]*$//'`=0A= export REL=3D`echo $tscriptname | sed -e "s/${PKG}\-${VER}\-//"`=0A= export FULLPKG=3D${PKG}-${VER}-${REL}=0A= +export NEWVER=3D"" # Place Holder for 'newer' version number=0A= =0A= # determine correct decompression option and tarball filename=0A= if [ -e ${PKG}-${VER}.tar.gz ] ; then=0A= @@ -48,6 +49,7 @@=0A= export instdir=3D${srcdir}/.inst=0A= export srcinstdir=3D${srcdir}/.sinst=0A= export checkfile=3D${topdir}/${FULLPKG}.check=0A= +=0A= # run on=0A= host=3Di686-pc-cygwin=0A= # if this package creates binaries, they run on=0A= @@ -57,6 +59,8 @@=0A= MY_CFLAGS=3D"-O2"=0A= MY_LDFLAGS=3D=0A= =0A= +export = ThePackageReadMeFile=3D"${instdir}${prefix}/share/doc/Cygwin/${PKG}-${VER= }.README"=0A= +=0A= mkdirs() {=0A= (cd ${topdir} && \=0A= rm -fr ${objdir} ${instdir} ${srcinstdir} && \=0A= @@ -123,11 +127,11 @@=0A= fi && \=0A= if [ -f ${srcdir}/CYGWIN-PATCHES/${PKG}.README ]; then \=0A= /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/${PKG}.README \=0A= - ${instdir}${prefix}/share/doc/Cygwin/${PKG}-${VER}.README ; \=0A= + "${ThePackageReadMeFile}" ; \=0A= else \=0A= if [ -f ${srcdir}/CYGWIN-PATCHES/README ]; then \=0A= /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/README \=0A= - ${instdir}${prefix}/share/doc/Cygwin/${PKG}-${VER}.README ; \=0A= + "${ThePackageReadMeFile}" ; \=0A= fi ;\=0A= fi ;\=0A= if [ -f ${srcdir}/CYGWIN-PATCHES/postinstall.sh ] ; then \=0A= @@ -142,9 +146,20 @@=0A= true )=0A= }=0A= list() {=0A= - (cd ${instdir} && \=0A= - find . -name "*" ! -type d | sed 's/\.\/\(.*\)/\1/'=0A= - true )=0A= +=0A= + if [ -s "${ThePackageReadMeFile}" ]=0A= + then=0A= + (cd ${instdir} && \=0A= + find . -name "*" | sed 's/\.\/\(.*\)/ \/\1/' | \=0A= + sed -i "${ThePackageReadMeFile}" \=0A= + -e "s#%PKG%#${PKG}#g" \=0A= + -e "s#%VER%#${VER}#g" \=0A= + -e "s#%REL%#${REL}#g" \=0A= + -e "s#%NEWER_VER%#${NEWVER}#g" \=0A= + -e '\|%THEFILES%| e /usr/bin/cat -' \=0A= + -e '\|%THEFILES%| d'=0A= + true )=0A= + fi=0A= }=0A= pkg() {=0A= (cd ${instdir} && \=0A= @@ -188,7 +203,7 @@=0A= spkg) spkg ; STATUS=3D$? ;;=0A= finish) finish ; STATUS=3D$? ;;=0A= all) prep && conf && build && install && \=0A= - strip && pkg && spkg && finish ; \=0A= + strip && list && pkg && spkg && finish ; \=0A= STATUS=3D$? ;;=0A= *) echo "Error: bad arguments" ; exit 1 ;;=0A= esac=0A= diff -ur Original/generic-readme New/generic-readme=0A= --- Original/generic-readme 2003-09-12 12:36:02.000000000 -0500=0A= +++ New/generic-readme 2003-11-17 17:24:44.467372800 -0600=0A= @@ -1,4 +1,4 @@=0A= -=0A= +%PKG%=0A= ------------------------------------------=0A= =0A= =0A= @@ -21,36 +21,36 @@=0A= ------------------------------------=0A= =0A= Build instructions:=0A= - unpack -VER-REL-src.tar.bz2=0A= + unpack %PKG%-%VER%-%REL%-src.tar.bz2=0A= if you use setup to install this src package, it will be=0A= unpacked under /usr/src automatically=0A= cd /usr/src=0A= - ./-VER-REL.sh all=0A= + ./%PKG%-%VER%-%REL%.sh all=0A= =0A= This will create:=0A= - /usr/src/-VER-REL.tar.bz2=0A= - /usr/src/-VER-REL-src.tar.bz2=0A= + /usr/src/%PKG%-%VER%-%REL%.tar.bz2=0A= + /usr/src/%PKG%-%VER%-%REL%-src.tar.bz2=0A= =0A= -------------------------------------------=0A= =0A= Files included in the binary distro=0A= =0A= /usr/bin/...=0A= - /usr/share/doc/-/AUTHORS=0A= - /usr/share/doc/-/...=0A= - /usr/share/doc/Cygwin/-.README=0A= + /usr/share/doc/%PKG%-%VER%/AUTHORS=0A= + /usr/share/doc/Cygwin/%PKG%-%VER%.README=0A= /usr/share/man/man1/...=0A= /usr/share/info/...=0A= - /etc/postinstall/.sh=0A= + /etc/postinstall/%PKG%.sh=0A= +%THEFILES%=0A= =0A= ------------------=0A= =0A= Port Notes:=0A= =0A= ------ version -----=0A= +----- version %NEWER_VER% -----=0A= Other information=0A= =0A= ------ version -----=0A= +----- version %VER% -----=0A= Initial release=0A= =0A= =0A= ------=_NextPart_000_0056_01C3AD33.8EF034B0 Content-Type: text/plain; charset=us-ascii -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ ------=_NextPart_000_0056_01C3AD33.8EF034B0--