g-b-s patch: upstream patch list

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

g-b-s patch: upstream patch list

Eric Blake (cygwin)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I finally made my upstream patching generic, following Igor's suggestion
of providing foo-ver-rel.patch.tar.bz2 if there is more than one patch
file being applied to foo-ver.tar.*.  I used this patch on readline-5.1-2,
and have been testing it on my (soon-to-be-released) bash-3.1-2.  The idea
is that you create a single file, CYGWIN-PATCHES/upstream_patches.lst,
which is a listing of pathnames relative to ${srcdir} containing upstream
patches.  Then g-b-s can use the contents of that file to manipulate a
.patches directory to create/unpack the patch tarball.

2006-01-30  Eric Blake  <[hidden email]>

        * templates/generic-build-script: Add ability to apply upstream
        patches, listed in CYGWIN-PATCHES/upstream_patches.lst.
        (mkdirs): Use new .patches directory.
        (fixup): New function.
        (prep): Unpack patch tarball.
        (mkpatch): Apply upstream patches before doing diff.
        (spkg): Make patch tarball if needed.
        (checksig): Look at patch tarball sig.
        (install): manifest.lst is not executable.

- --
Life is short - so eat dessert first!

Eric Blake             [hidden email]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD3iAY84KuGfSFAYARArKCAJ9THVYXlUa7rfKrSOZN/JYacbGNPQCbBilw
fI79URGOOQqxE0OwvOYTgqk=
=jX/A
-----END PGP SIGNATURE-----

Index: templates/generic-build-script
===================================================================
RCS file: /cvs/cygwin-apps/packaging/templates/generic-build-script,v
retrieving revision 1.46
diff -u -p -r1.46 generic-build-script
--- templates/generic-build-script 28 Jan 2006 20:33:13 -0000 1.46
+++ templates/generic-build-script 30 Jan 2006 14:12:19 -0000
@@ -70,6 +70,7 @@ export src_orig_pkg=${topdir}/${src_orig
 # determine correct names for generated files
 export src_pkg_name=${FULLPKG}-src.tar.bz2
 export src_patch_name=${FULLPKG}.patch
+export src_patch_tar_name=${FULLPKG}.patch.tar.bz2
 export bin_pkg_name=${FULLPKG}.tar.bz2
 export log_pkg_name=${FULLPKG}-BUILDLOGS.tar.bz2
 
@@ -80,12 +81,15 @@ export installlogname=${FULLPKG}-INSTALL
 
 export src_pkg=${topdir}/${src_pkg_name}
 export src_patch=${topdir}/${src_patch_name}
+export src_patch_tar=${topdir}/${src_patch_tar_name}
 export bin_pkg=${topdir}/${bin_pkg_name}
 export srcdir=${topdir}/${BASEPKG}
 export objdir=${srcdir}/.build
 export instdir=${srcdir}/.inst
 export srcinstdir=${srcdir}/.sinst
 export buildlogdir=${srcdir}/.buildlogs
+export patchdir=${srcdir}/.patches
+export upstream_patchlist=${srcdir}/CYGWIN-PATCHES/upstream_patches.lst
 export configurelogfile=${srcinstdir}/${configurelogname}
 export makelogfile=${srcinstdir}/${makelogname}
 export checklogfile=${srcinstdir}/${checklogname}
@@ -182,12 +186,11 @@ unpack() {
   tar xv${opt_decomp}f "$1"
 }
 
+# make hidden directories used by g-b-s
 mkdirs() {
   (cd ${topdir} && \
-  rm -fr ${objdir} ${instdir} ${srcinstdir} && \
-  mkdir -p ${objdir} && \
-  mkdir -p ${instdir} && \
-  mkdir -p ${srcinstdir} )
+  rm -fr ${objdir} ${instdir} ${srcinstdir} ${patchdir} && \
+  mkdir -p ${objdir} ${instdir} ${srcinstdir} ${patchdir} )
 }
 mkdirs_log() {
   (cd ${topdir} && \
@@ -195,14 +198,45 @@ mkdirs_log() {
   rm -fr ${buildlogdir} && \
   mkdir -p ${buildlogdir} )
 }
+
+# Internal function for applying upstream patches
+# $1 is directory to patch, $2 is file containing patch names
+fixup() {
+  if [ -f "$2" ] ; then
+    (cd "$1" &&
+    for patch in `cat "$2"` ; do
+      echo "APPLYING UPSTREAM PATCH `basename ${patch}`"
+      patch -Z -p0 < ${srcdir}/${patch}
+    done
+    )
+  fi
+}
+
+# Unpack the original tarball, and get everything set up for g-b-s
 prep() {
   (cd ${topdir} && \
   unpack ${src_orig_pkg} && \
+  mkdirs && \
+  if [ -f ${src_patch_tar} ] ; then
+    (cd ${patchdir} &&
+    tar xvjf ${src_patch_tar} &&
+    if [ -f ${src_patch_name} ] ; then
+      mv ${src_patch_name} ${src_patch}
+    fi &&
+    if [ -f upstream_patches.lst ] ; then
+      for patch in `cat upstream_patches.lst` ; do
+ cp -p ${patch} ${srcdir}/${patch} &&
+ if [ -f ${patch}.sig ] ; then
+  cp -p ${patch}.sig ${srcdir}/${patch}.sig
+ fi
+      done
+    fi )
+  fi &&
+  fixup "${srcdir}" ${patchdir}/upstream_patches.lst &&
   cd ${topdir} && \
   if [ -f ${src_patch} ] ; then \
     patch -Z -p0 < ${src_patch} ;\
-  fi && \
-  mkdirs )
+  fi )
 }
 prep_log() {
   prep "$@" && \
@@ -212,6 +246,8 @@ prep_log() {
     tar xvjf ${topdir}/${log_pkg_name}
   fi
 }
+
+# Configure the package
 conf() {
   (cd ${objdir} && \
   CFLAGS="${MY_CFLAGS}" LDFLAGS="${MY_LDFLAGS}" \
@@ -227,6 +263,8 @@ conf_log() {
   conf "$@" 2>&1 | tee ${configurelogfile}
   return ${PIPESTATUS[0]}
 }
+
+# Rerun configure
 reconf() {
   (cd ${topdir} && \
   rm -fr ${objdir} && \
@@ -237,6 +275,8 @@ reconf_log() {
   reconf "$@" 2>&1 | tee ${configurelogfile}
   return ${PIPESTATUS[0]}
 }
+
+# Run make
 build() {
   (cd ${objdir} && \
   make CFLAGS="${MY_CFLAGS}" )
@@ -245,6 +285,8 @@ build_log() {
   build "$@" 2>&1 | tee ${makelogfile}
   return ${PIPESTATUS[0]}
 }
+
+# Run the package testsuite
 check() {
   (cd ${objdir} && \
   make -k ${test_rule} )
@@ -253,10 +295,14 @@ check_log() {
   check "$@" 2>&1 | tee ${checklogfile}
   return ${PIPESTATUS[0]}
 }
+
+# Remove built files
 clean() {
   (cd ${objdir} && \
   make clean )
 }
+
+# Install the package, with DESTDIR of .inst
 install() {
   (cd ${objdir} && \
   rm -fr ${instdir}/* && \
@@ -325,7 +371,7 @@ install() {
     if [ ! -d ${instdir}${sysconfdir}/preremove ]; then
       mkdir -p ${instdir}${sysconfdir}/preremove ;
     fi &&
-    /usr/bin/install -m 755 ${srcdir}/CYGWIN-PATCHES/manifest.lst \
+    /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/manifest.lst \
       ${instdir}${sysconfdir}/preremove/${PKG}-manifest.lst ;
   fi )
 }
@@ -333,16 +379,22 @@ install_log() {
   install "$@" 2>&1 | tee ${installlogfile}
   return ${PIPESTATUS[0]}
 }
+
+# Strip binaries
 strip() {
   (cd ${instdir} && \
   find . -name "*.dll" -or -name "*.exe" | xargs -r strip 2>&1 ; \
   true )
 }
+
+# List files that belong to the package
 list() {
   (cd ${instdir} && \
   find . -name "*" ! -type d | sed 's%^\.%  %' | sort ; \
   true )
 }
+
+# List .dll dependencies of the package
 depend() {
   (cd ${instdir} && \
   find ${instdir} -name "*.exe" -o -name "*.dll" | xargs -r cygcheck | \
@@ -350,30 +402,68 @@ depend() {
   xargs -r -n1 cygpath -u | xargs -r cygcheck -f | sed 's%^%  %' | sort -u ; \
   true )
 }
+
+# Build the binary package
 pkg() {
   (cd ${instdir} && \
   tar cvjf ${bin_pkg} * )
 }
+
+# Compare the original tarball with cygwin modifications
 mkpatch() {
   (cd ${srcdir} && \
   find . -name "autom4te.cache" | xargs -r rm -rf ; \
   unpack ${src_orig_pkg} && \
   mv ${BASEPKG} ../${BASEPKG}-orig && \
+  fixup "../${BASEPKG}-orig" ${upstream_patchlist} &&
   cd ${topdir} && \
-  diff -urN -x '.build' -x '.inst' -x '.sinst' -x '.buildlogs' \
+  rm -f ${BASEPKG}-filter &&
+  if [ -f ${upstream_patchlist} ] ; then
+    cp ${upstream_patchlist} ${BASEPKG}-filter &&
+    for patch in `cat ${upstream_patchlist}` ; do
+      echo ${patch}.sig >> ${BASEPKG}-filter
+    done
+  else
+    touch ${BASEPKG}-filter
+  fi &&
+  for dir in '.build' '.inst' '.sinst' '.buildlogs' '.patches' ; do
+    echo ${dir} >> ${BASEPKG}-filter
+  done &&
+  diff -urN -X ${BASEPKG}-filter \
     ${BASEPKG}-orig ${BASEPKG} > \
     ${srcinstdir}/${src_patch_name} ; \
-  rm -rf ${BASEPKG}-orig )
+  rm -rf ${BASEPKG}-filter ${BASEPKG}-orig &&
+  if [ -f ${upstream_patchlist} ] ; then
+    rm -Rf ${patchdir} &&
+    mkdir -p ${patchdir} &&
+    mv ${srcinstdir}/${src_patch_name} ${patchdir}/${src_patch_name} &&
+    for patch in `cat ${upstream_patchlist}` ; do
+      cp -p ${srcdir}/${patch} ${patchdir}/ &&
+      if [ -f ${srcdir}/${patch}.sig ] ; then
+ cp -p ${srcdir}/${patch}.sig ${patchdir}/
+      fi
+    done &&
+    cp ${upstream_patchlist} ${patchdir}/upstream_patches.lst &&
+    (cd ${patchdir} &&
+    tar cvjf ${srcinstdir}/${src_patch_tar_name} *
+    )
+  fi
+  )
 }
+
 # Note: maintainer-only functionality
 acceptpatch() {
   cp --backup=numbered ${srcinstdir}/${src_patch_name} ${topdir}
 }
+
+# Build the source tarball
 spkg() {
   (mkpatch && \
-  if [ "${SIG}" -eq 1 ] ; then \
-    name=${srcinstdir}/${src_patch_name} text="PATCH" sigfile ; \
-  fi && \
+  if [ -f ${upstream_patchlist} ] ; then
+    name=${srcinstdir}/${src_patch_tar_name} text="PATCH" sigfile
+  else
+    name=${srcinstdir}/${src_patch_name} text="PATCH" sigfile
+  fi &&
   cp ${src_orig_pkg} ${srcinstdir}/${src_orig_pkg_name} && \
   if [ -e ${src_orig_pkg}.sig ] ; then \
     cp ${src_orig_pkg}.sig ${srcinstdir}/ ; \
@@ -398,9 +488,13 @@ spkg_log() {
   fi && \
   tar uvjf ${src_pkg} * )
 }
+
+# Clean up everything
 finish() {
   rm -rf ${srcdir}
 }
+
+# Generate GPG signatures
 sigfile() {
   if [ \( "${SIG}" -eq 1 \) -a \( -e $name \) -a \( \( ! -e $name.sig \) -o \( $name -nt $name.sig \) \) ]; then \
     if [ -x /usr/bin/gpg ]; then \
@@ -412,6 +506,8 @@ sigfile() {
     fi; \
   fi
 }
+
+# Validate signatures
 checksig() {
   if [ -x /usr/bin/gpg ]; then \
     if [ -e ${src_orig_pkg}.sig ]; then \
@@ -420,18 +516,37 @@ checksig() {
     else \
       echo "ORIGINAL PACKAGE signature missing."; \
     fi; \
+    if [ -f ${upstream_patchlist} ] ; then
+      for patch in `cat ${upstream_patchlist}` ; do
+ if [ -f ${srcdir}/${patch}.sig ] ; then
+  echo "UPSTREAM PATCH ${patch} signature follows:"
+  /usr/bin/gpg --verify ${srcdir}/${patch}.sig ${srcdir}/${patch}
+ else
+  echo "UPSTREAM PATCH ${patch} signature missing."
+ fi
+      done
+    fi
     if [ -e $0.sig ]; then \
       echo "SCRIPT signature follows:"; \
       /usr/bin/gpg --verify $0.sig $0; \
     else \
       echo "SCRIPT signature missing."; \
     fi; \
-    if [ -e ${src_patch}.sig ]; then \
-      echo "PATCH signature follows:"; \
-      /usr/bin/gpg --verify ${src_patch}.sig ${src_patch}; \
-    else \
-      echo "PATCH signature missing."; \
-    fi; \
+    if [ -f ${src_patch_tar} ] ; then
+      if [ -f ${src_patch_tar}.sig ] ; then
+        echo "PATCH signature follows:"; \
+        /usr/bin/gpg --verify ${src_patch_tar}.sig ${src_patch_tar}; \
+      else \
+        echo "PATCH signature missing."; \
+      fi; \
+    elif [ -e ${src_patch} ] ; then
+      if [ -e ${src_patch}.sig ]; then \
+        echo "PATCH signature follows:"; \
+        /usr/bin/gpg --verify ${src_patch}.sig ${src_patch}; \
+      else \
+        echo "PATCH signature missing."; \
+      fi; \
+    fi
   else
     echo "You need the gnupg package installed in order to check signatures." ; \
   fi
Reply | Threaded
Open this post in threaded view
|

Re: g-b-s patch: upstream patch list

Igor Peshansky
On Mon, 30 Jan 2006, Eric Blake wrote:

> I finally made my upstream patching generic, following Igor's suggestion
> of providing foo-ver-rel.patch.tar.bz2 if there is more than one patch
> file being applied to foo-ver.tar.*.  I used this patch on
> readline-5.1-2, and have been testing it on my (soon-to-be-released)
> bash-3.1-2.  The idea is that you create a single file,
> CYGWIN-PATCHES/upstream_patches.lst, which is a listing of pathnames
> relative to ${srcdir} containing upstream patches.  Then g-b-s can use
> the contents of that file to manipulate a .patches directory to
> create/unpack the patch tarball.

Heh, this is cool, thanks for doing this.  I was working on the same kind
of functionality for pdksh over the weekend, and also have a whole bunch
of changes to the g-b-s, with essentially a very similar approach.  Some
of your stuff looks cleaner, while some of mine may be more general --
I'll need to review and compare these in more detail.  Some initial
comments on your patch below.

> 2006-01-30  Eric Blake  <ebb9<at>byu.net>
>
> * templates/generic-build-script: Add ability to apply upstream
> patches, listed in CYGWIN-PATCHES/upstream_patches.lst.
> (mkdirs): Use new .patches directory.
> (fixup): New function.
> (prep): Unpack patch tarball.
> (mkpatch): Apply upstream patches before doing diff.
> (spkg): Make patch tarball if needed.
> (checksig): Look at patch tarball sig.
> (install): manifest.lst is not executable.

First off, please, please don't bundle unrelated changes into the same
patch.  I like the idea of the leading comments, and of fixing up the mode
on manifest.lst, but could that be a separate patch, with a separate
ChangeLog?  That makes it much easier to review the changes.

FWIW, in the comments, I'd replace "g-b-s" by "the script" everywhere,
since they will also appear in the actual build scripts.  Also, I think
it's worth mentioning that depend() only lists the *static* DLL
dependencies.

Now, for the upstream patches functionality, I think it would be easier if
I actually posted my changes and we could compare on-list.  I'll clean
them up and post them in the next couple of days.
        Igor
--
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_    [hidden email] | [hidden email]
ZZZzz /,`.-'`'    -.  ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-' old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"
Reply | Threaded
Open this post in threaded view
|

Re: g-b-s patch: upstream patch list

Yitzchak Scott-Thoennes
On Mon, Jan 30, 2006 at 10:45:10AM -0500, Igor Peshansky wrote:
> > 2006-01-30  Eric Blake  <ebb9<at>byu.net>
> >
> > * templates/generic-build-script: Add ability to apply upstream
> > patches, listed in CYGWIN-PATCHES/upstream_patches.lst.
>
> Now, for the upstream patches functionality, I think it would be easier if
> I actually posted my changes and we could compare on-list.  I'll clean
> them up and post them in the next couple of days.

FWIW, when I looked at this, it looked easiest just to apply the patches
in unpack().
Reply | Threaded
Open this post in threaded view
|

Re: g-b-s patch: upstream patch list

Igor Peshansky
On Mon, 30 Jan 2006, Yitzchak Scott-Thoennes wrote:

> On Mon, Jan 30, 2006 at 10:45:10AM -0500, Igor Peshansky wrote:
> > > 2006-01-30  Eric Blake  <ebb9<at>byu.net>
> > >
> > > * templates/generic-build-script: Add ability to apply upstream
> > > patches, listed in CYGWIN-PATCHES/upstream_patches.lst.
> >
> > Now, for the upstream patches functionality, I think it would be
> > easier if I actually posted my changes and we could compare on-list.
> > I'll clean them up and post them in the next couple of days.
>
> FWIW, when I looked at this, it looked easiest just to apply the patches
> in unpack().

Maybe, but I'd rather keep unpack() as it is -- i.e., a helper function to
replace an unconditional "tar xf".  That way, if a package has non-tar.gz
source archives, the maintainers don't have to rack their brains to figure
out how to edit unpack().
        Igor
--
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_    [hidden email] | [hidden email]
ZZZzz /,`.-'`'    -.  ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-' old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"
Reply | Threaded
Open this post in threaded view
|

Re: g-b-s patch: upstream patch list

Eric Blake (cygwin)
In reply to this post by Igor Peshansky
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Igor Peshansky on 1/30/2006 8:45 AM:
> First off, please, please don't bundle unrelated changes into the same
> patch.  I like the idea of the leading comments, and of fixing up the mode
> on manifest.lst, but could that be a separate patch, with a separate
> ChangeLog?  That makes it much easier to review the changes.

The uncontroversial bits of my patch:

2006-02-01  Eric Blake  <[hidden email]>

        * templates/generic-build-script: Add comments throughout.
        (usage): Document --logs option.
        (install): manifest.lst is not executable.

- --
Life is short - so eat dessert first!

Eric Blake             [hidden email]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD4LdM84KuGfSFAYARAlvNAJ41BTLZGFeSmiWVY4A2fNlntUHM5QCgk1zi
klZpCIYnkARojF+reWqEjdo=
=ycK1
-----END PGP SIGNATURE-----

Index: generic-build-script
===================================================================
RCS file: /cvs/cygwin-apps/packaging/templates/generic-build-script,v
retrieving revision 1.46
diff -u -p -r1.46 generic-build-script
--- generic-build-script 28 Jan 2006 20:33:13 -0000 1.46
+++ generic-build-script 1 Feb 2006 13:25:12 -0000
@@ -142,10 +142,12 @@ export LC_ALL=C
 help() {
 cat <<EOF
 This is the cygwin packaging script for ${FULLPKG}.
-Usage: $0 <action>
-Actions are:
+Usage: $0 [<option>...] <action>...
+Options are:
     help, --help Print this message
     version, --version Print the version message
+    with_logs, --logs Create logs of remaining steps
+Actions are:
     prep Unpack and patch into ${srcdir}
     mkdirs Make hidden directories needed during build
     conf, configure Configure the package (./configure)
@@ -169,19 +171,20 @@ Actions are:
 EOF
 }
 
-# Provide version of generic-build-script modified to make this
+# Provide version of generic-build-script modified to make this script.
 version() {
     vers=`echo '$Revision: 1.46 $' | sed -e 's/Revision: //' -e 's/ *\\$//g'`
     echo "$0 based on generic-build-script $vers"
 }
 
-# unpacks the original package source archive into ./${BASEPKG}/
-# change this if the original package was not tarred
-# or if it doesn't unpack to a correct directory
+# Unpacks the original package source archive into ./${BASEPKG}/.
+# Change this if the original package was not tarred
+# or if it doesn't unpack to a correct directory.
 unpack() {
   tar xv${opt_decomp}f "$1"
 }
 
+# Make the hidden directories used by this script.
 mkdirs() {
   (cd ${topdir} && \
   rm -fr ${objdir} ${instdir} ${srcinstdir} && \
@@ -195,6 +198,8 @@ mkdirs_log() {
   rm -fr ${buildlogdir} && \
   mkdir -p ${buildlogdir} )
 }
+
+# Unpack the original tarball, and get everything set up for this script.
 prep() {
   (cd ${topdir} && \
   unpack ${src_orig_pkg} && \
@@ -212,6 +217,8 @@ prep_log() {
     tar xvjf ${topdir}/${log_pkg_name}
   fi
 }
+
+# Configure the package.
 conf() {
   (cd ${objdir} && \
   CFLAGS="${MY_CFLAGS}" LDFLAGS="${MY_LDFLAGS}" \
@@ -227,6 +234,8 @@ conf_log() {
   conf "$@" 2>&1 | tee ${configurelogfile}
   return ${PIPESTATUS[0]}
 }
+
+# Rerun configure to pick up changes in the environment.
 reconf() {
   (cd ${topdir} && \
   rm -fr ${objdir} && \
@@ -237,6 +246,8 @@ reconf_log() {
   reconf "$@" 2>&1 | tee ${configurelogfile}
   return ${PIPESTATUS[0]}
 }
+
+# Run make.
 build() {
   (cd ${objdir} && \
   make CFLAGS="${MY_CFLAGS}" )
@@ -245,6 +256,8 @@ build_log() {
   build "$@" 2>&1 | tee ${makelogfile}
   return ${PIPESTATUS[0]}
 }
+
+# Run the package testsuite.
 check() {
   (cd ${objdir} && \
   make -k ${test_rule} )
@@ -253,10 +266,14 @@ check_log() {
   check "$@" 2>&1 | tee ${checklogfile}
   return ${PIPESTATUS[0]}
 }
+
+# Remove files built by configure and make.
 clean() {
   (cd ${objdir} && \
   make clean )
 }
+
+# Install the package, with DESTDIR set to '.inst'.
 install() {
   (cd ${objdir} && \
   rm -fr ${instdir}/* && \
@@ -325,7 +342,7 @@ install() {
     if [ ! -d ${instdir}${sysconfdir}/preremove ]; then
       mkdir -p ${instdir}${sysconfdir}/preremove ;
     fi &&
-    /usr/bin/install -m 755 ${srcdir}/CYGWIN-PATCHES/manifest.lst \
+    /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/manifest.lst \
       ${instdir}${sysconfdir}/preremove/${PKG}-manifest.lst ;
   fi )
 }
@@ -333,16 +350,24 @@ install_log() {
   install "$@" 2>&1 | tee ${installlogfile}
   return ${PIPESTATUS[0]}
 }
+
+# Strip binaries.
 strip() {
   (cd ${instdir} && \
   find . -name "*.dll" -or -name "*.exe" | xargs -r strip 2>&1 ; \
   true )
 }
+
+# List files that belong to the package.
 list() {
   (cd ${instdir} && \
   find . -name "*" ! -type d | sed 's%^\.%  %' | sort ; \
   true )
 }
+
+# List the static .dll dependencies of the package.  This does not pick up
+# dynamic dependencies (whether or not libtool was used), nor does it pick
+# up program dependencies, such as system() depending on /bin/sh.
 depend() {
   (cd ${instdir} && \
   find ${instdir} -name "*.exe" -o -name "*.dll" | xargs -r cygcheck | \
@@ -350,10 +375,14 @@ depend() {
   xargs -r -n1 cygpath -u | xargs -r cygcheck -f | sed 's%^%  %' | sort -u ; \
   true )
 }
+
+# Build the binary package.
 pkg() {
   (cd ${instdir} && \
   tar cvjf ${bin_pkg} * )
 }
+
+# Compare the original tarball against cygwin modifications.
 mkpatch() {
   (cd ${srcdir} && \
   find . -name "autom4te.cache" | xargs -r rm -rf ; \
@@ -369,6 +398,8 @@ mkpatch() {
 acceptpatch() {
   cp --backup=numbered ${srcinstdir}/${src_patch_name} ${topdir}
 }
+
+# Build the source tarball.
 spkg() {
   (mkpatch && \
   if [ "${SIG}" -eq 1 ] ; then \
@@ -398,9 +429,13 @@ spkg_log() {
   fi && \
   tar uvjf ${src_pkg} * )
 }
+
+# Clean up everything.
 finish() {
   rm -rf ${srcdir}
 }
+
+# Generate GPG signtatures.
 sigfile() {
   if [ \( "${SIG}" -eq 1 \) -a \( -e $name \) -a \( \( ! -e $name.sig \) -o \( $name -nt $name.sig \) \) ]; then \
     if [ -x /usr/bin/gpg ]; then \
@@ -412,6 +447,8 @@ sigfile() {
     fi; \
   fi
 }
+
+# Validate signatures.
 checksig() {
   if [ -x /usr/bin/gpg ]; then \
     if [ -e ${src_orig_pkg}.sig ]; then \
Reply | Threaded
Open this post in threaded view
|

Re: g-b-s patch: upstream patch list

Igor Peshansky
On Wed, 1 Feb 2006, Eric Blake wrote:

> The uncontroversial bits of my patch:
>
> 2006-02-01  Eric Blake  <ebb9<at>byu.net>
>
> * templates/generic-build-script: Add comments throughout.
> (usage): Document --logs option.
> (install): manifest.lst is not executable.

Applied with (very) minor tweaks.  Thanks!
        Igor
--
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_    [hidden email] | [hidden email]
ZZZzz /,`.-'`'    -.  ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-' old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"