X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1wWAhHrU1S" Content-Transfer-Encoding: 7bit Message-ID: <17828.9936.351934.626832@Psilocybe.Update.UU.SE> Date: Wed, 10 Jan 2007 00:35:44 +0100 From: Stefan Björnelund To: cygwin AT cygwin DOT com Subject: [BUG] cygport-0.2.7 fails to build multiple binary packages X-Mailer: VM 7.19 under Emacs 21.4.1 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 --1wWAhHrU1S Content-Type: text/plain; charset=iso-8859-1 Content-Description: message body text Content-Transfer-Encoding: quoted-printable While tying to rebuild the gettext-0.15-1 package, I noticed that it did not build correctly any more. The problem is that the postinstall/preremove scripts for all but the primary binary packages are ignored, and thus the packaging step fails. I have tried to correct this fault in the attached patch, but as it was done in a bit of a rush I probably broke as much as I corrected. Could someone familiar with cygport have a look at it, please? Some notes on the suggested changes: * The __prepetc() postinstall function is staring to become too large, so some part were split out into separate functions: - The __prepetc_pre_post_old() now contains the old postinstall/preremove scripts handling. - The __prepetc_profile() now contains the old profile scripts handling. - The __prep_check_pre_post() now postinstall/preremove scripts chmod. * The __prepetc_pre_post() was added to handle postinstall/preremove scripts for multiple binary packages. * The prep_gnu_info.sh script added commands to the wrong postinstall/preremove script, if more than one was used. That is it assumed that all info files were located in the primary package, which is not true for the gettext package. This was replaced with the new prep_gnu_info() function, (not sure if this was an imrovement or not). This function now checks which package the info file belongs to and adds the command to the corresponding postinstall/preremove scripts. Unfortunately this change will probably break the postinstall/preremove scripts in the existing multiple binary packages. Coincidentally this also removes the need for the handcrafted postinstall/preremove scripts in the gettext package, so this change seems to be in line with the intent of the cygport goals. =20=20=20=20 Test Package etc: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Cygcheck result: http://www.update.uu.se/~stefanb/cygwin/bug/cygport-1/cygcheck.out The "corrected" cygport script, and diff to the 0.2.7-1 baseline: http://www.update.uu.se/~stefanb/cygwin/bug/cygport-1/cygport-test http://www.update.uu.se/~stefanb/cygwin/bug/cygport-1/cygport-test.patch A adapted version of the gettext package (with the po-mode emacs mode included): http://www.update.uu.se/~stefanb/cygwin/bug/cygport-1/gettext-0.15-2.tar.bz2 http://www.update.uu.se/~stefanb/cygwin/bug/cygport-1/gettext-0.15-2-src.ta= r.bz2 Regards Stefan Bj=F6rnelund. --1wWAhHrU1S Content-Type: text/plain; charset=iso-8859-1 Content-Description: Suggested corrections to cygport Content-Disposition: inline; filename="cygport-test.patch" Content-Transfer-Encoding: 7bit --- /usr/bin/cygport 2006-12-26 06:43:10.001000000 +0100 +++ cygport-test 2007-01-07 21:09:26.037408000 +0100 @@ -1031,20 +1031,62 @@ done } -# creates and installs postinstall, preremove, and profile.d scripts -__prepetc() { +# creates and installs postinstall, preremove scripts +__prepetc_pre_post_old() { local d; local s; + local -i n=0; + + __step "Installing postinstall, preremove scripts. Old style." + # Old style for s in postinstall preremove do if [ -f ${C}/${s}.sh ] then + echo " /etc/${s}/${PN}.sh"; dodir /etc/${s}; cat >> ${D}/etc/${s}/${PN}.sh < ${C}/${s}.sh; fi done +} + + +# creates and installs postinstall, preremove scripts +__prepetc_pre_post() { + local d; + local s; + local -i n=0; + + __step "Installing postinstall, preremove scripts." + + # New style + for s in postinstall preremove + do + n=0; + while defined pkg_name[${n}] + do + if [ -f ${C}/${pkg_name[${n}]}.${s} ] + then + echo " /etc/${s}/${pkg_name[${n}]}.sh from ${C}/${pkg_name[${n}]}.${s}"; + dodir /etc/${s}; + cat >> ${D}/etc/${s}/${pkg_name[${n}]}.sh < ${C}/${pkg_name[${n}]}.${s}; + fi + n+=1; + done + done +} + + + +# creates and installs postinstall, preremove, and profile.d scripts +__prepetc_profile() { + local d; + local -i n=0; + __step "Installing profile scripts." + + # Old stype, Single package: if [ -f ${C}/profile.d.sh ] then exeinto /etc/profile.d; @@ -1057,6 +1099,159 @@ newexe ${C}/profile.d.csh ${PN}.csh; fi + # New style, multiple packages + n=0; + while defined pkg_name[${n}] + do + if [ -f ${C}/${pkg_name[${n}]}.profile.d.sh ] + then + exeinto /etc/profile.d; + newexe ${C}/${pkg_name[${n}]}.profile.d.sh ${PN}.sh; + fi + + if [ -f ${C}/${pkg_name[${n}]}.profile.d.csh ] + then + exeinto /etc/profile.d; + newexe ${C}/${pkg_name[${n}]}.profile.d.csh ${PN}.csh; + fi + + n+=1; + done +} + +# Postinstall commands for GNU info pages +prep_gnu_info() { + local infopage + local sinfopage + local -i n=0 + set -e + + rm -f ${D}/usr/share/info/dir + + __step "Compressing info pages:" + + for infopage in $(find ${D}/usr/share/info -type f ! -name '*.gz' ! -name '*.bz2') + do + echo " ${infopage##*/}" + gzip -q9 ${infopage} + done + + # Add preremove and postinstall to the correct package! + __step "Adding info commands to postinstall, preremove scripts:" + dodir /etc/postinstall + dodir /etc/preremove + for infopage in $(find ${D}/usr/share/info -type f) + do + # Find the correct package + sinfopage="${infopage##*/}" + #echo "In=/usr/share/info/${infopage##*/}" + n=0; + while defined pkg_name[${n}] + do + if egrep -q "usr/share/info/${sinfopage%%.gz}" ${C}/${pkg_name[${n}]}.list + then + echo " ${infopage##*/} --> PKG: ${pkg_name[${n}]}" + cat >> ${D}/etc/postinstall/${pkg_name[${n}]}.sh <<-_EOF + echo Foo + /usr/bin/install-info --dir-file=/usr/share/info/dir --info-file=/usr/share/info/${infopage##*/} + + _EOF + + cat >> ${D}/etc/preremove/${pkg_name[${n}]}.sh <<-_EOF + echo Foo + /usr/bin/install-info --delete --dir-file=/usr/share/info/dir --info-file=/usr/share/info/${infopage##*/} + + _EOF + + n=9999 + else + n+=1 + fi + done + # If the file is not in a package file list, then add it to the default package... + if [ "$n" != "9999" ] + then + warning "Info page not included in pakage list: /usr/share/info/${infopage##*/}" + cat >> ${D}/etc/postinstall/${PN}.sh <<-_EOF +dd echo Bar + /usr/bin/install-info --dir-file=/usr/share/info/dir --info-file=/usr/share/info/${infopage##*/} + _EOF + cat >> ${D}/etc/preremove/${PN}.sh <<-_EOF + echo Bar + /usr/bin/install-info --delete --dir-file=/usr/share/info/dir --info-file=/usr/share/info/${infopage##*/} + _EOF + fi + done + + # Add a trailing line + n=0; + while defined pkg_name[${n}] + do + if [ -f ${D}/etc/postinstall/${pkg_name[${n}]}.sh ] + then + echo >> ${D}/etc/postinstall/${pkg_name[${n}]}.sh + fi + n+=1 + done +} + + +# Checking preremove postinstallPostinstall commands for GNU info pages +prep_check_pre_post() { + local s + local -i n=0 + set -e + + rm -f ${D}/usr/share/info/dir + + __step "Checking preremove postinstall." + + # Makesure that the scripts are executable. + for d in /etc/postinstall /etc/preremove + do + if [ -d ${D}${d} ] + then + find ${D}${d} -type f -exec chmod 0755 '{}' +; + fi + done + + # OK, this is backwards. Suggest a rewrite. + # It would be better to iterate over the files, verifying that is is included in the corrosponding package list. + n=0; + while defined pkg_name[${n}] + do + for s in postinstall preremove + do + if [ -f ${D}/etc/${s}/${pkg_name[${n}]}.sh ] + then + if grep -q "etc/${s}/${pkg_name[${n}]}.sh" ${C}/${pkg_name[${n}]}.list + then + : #echo " OK: etc/${s}/${pkg_name[${n}]}.sh" ${C}/${pkg_name[${n}]}.list + else + warning "Adding "etc/${s}/${pkg_name[${n}]}.sh to ${C}/${pkg_name[${n}]}.list" + echo "etc/${s}/${pkg_name[${n}]}.sh" >>${C}/${pkg_name[${n}]}.list" + fi + fi + done + n+=1 + done +} + + + +# creates and installs postinstall, preremove, and profile.d scripts +__prepetc() { + local d; + local s; + + __prepetc_pre_post_old + __prepetc_pre_post + + __prepetc_profile + + __step "Generating misc configuration data." + + # System fonts if [ -d ${D}/usr/share/fonts ] then @@ -1066,7 +1261,7 @@ # GNU info pages if [ -d ${D}/usr/share/info ] then - prep_gnu_info.sh || error "GNU info postinstall failed" + prep_gnu_info || error "GNU info postinstall failed" fi # GTK+ 2.x modules @@ -1099,13 +1294,7 @@ prep_freedesktop_mime.sh || error "Shared Mime Info postinstall failed" fi - for d in /etc/postinstall /etc/preremove - do - if [ -d ${D}${d} ] - then - find ${D}${d} -type f -exec chmod 0755 '{}' +; - fi - done + prep_check_pre_post } __prepman() { @@ -1113,7 +1302,7 @@ if [ -d ${D}/usr/share/man ] then - echo "Compressing man pages:"; + __step "Compressing man pages:"; for manpage in $(find ${D}/usr/share/man -type f ! -name '*.gz' ! -name '*.bz2') do @@ -1128,7 +1317,7 @@ cd ${D}; - echo "Stripping executables:"; + __step "Stripping executables:"; # Ruby and Apache2 modules should be *.so, nothing else!!! for exe in $(find * -type f -name '*.dll' -o -name '*.exe' -o -name '*.so') --1wWAhHrU1S 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/ --1wWAhHrU1S--