[Pkg-zope-developers] Re: zope (2.6.4-1.6)

Pierre Machard pmachard@debian.org
Wed, 1 Sep 2004 04:19:44 +0200


--FkmkrVfFsRoUs1wW
Content-Type: multipart/mixed; boundary="PEIAKu/WMn1b1Hv9"
Content-Disposition: inline


--PEIAKu/WMn1b1Hv9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello,

Thanks for your patch. I've added it to this message so that people from
the zope-pkg team and  Derrick 'dman' Hudson can proofread it.

On Tue, Aug 31, 2004 at 08:57:03PM +0000, Thaddeus H. Black wrote:
> Please find attached a proposed patch from zope (2.6.4-1.5) to
> (2.6.4-1.6).
>=20
> Remarks on the changes to postinst:
>=20
> > +        if [ -d ${access} -o -f ${access} -a ! -s ${access} ] ; then
> > +            # In the /var/ hierarchy, because a useful file now needs
> > +            # the filename, move the useless directory or empty file
> > +            # which an earlier zope (2.6.4-1.x) has inadvertently
> > +            # created.
> > +            if [ -e ${access}.bak ] ; then
> > +                BAKDIR=3D$( mktemp -u ${access}.bak.XXXXXX )
> > +            else
> > +                BAKDIR=3D${access}.bak
> > +            fi
> > +            mv ${access} ${BAKDIR}
> > +        fi
>=20
> This moves out of the way the spurious files and directories the earlier
> zope (2.6.4-1.x) have created, for orderly upgrades from these versions.
> Even though they probably have no value, it does not delete them.
>=20
> >          # This should set up all configured instances.
> > -        {
> > -            if [ ! -e $access ] ; then
> > -                	touch $access
> > -                	echo "Please enter a password for Zope's initial/emer=
gency user."
> > -                	zopectl --access "$access"
> > -	    fi
> > -        }
> > -        zopectl --init '*' --pcgi '*'
> > +        mkdir -p ${INSTANCE_HOME}
> > +        [ -e ${access} ] || echo \
> > +            "Please enter a password for Zope's initial/emergency user=
=2E"
> > +        zopectl --access 'default' --init '*' --pcgi '*' </dev/tty
>=20
> The key to this is the "</dev/tty".  Zopectl indirectly prompts for a
> password.  Terminal echo is turned off for password entry, so
> the "</dev/tty" is needed for the script to run correctly.  Refer to
> Policy sect 6.3.  This was my mistake in zope (2.6.4-1.2).  This is the
> mistake which has led to the other, subsequent mistakes.  The patch now
> fixes it the way I should have fixed it in the first place.

We should probably use a debconf question for that purpose :

In /usr/share/doc/debian-policy/upgrading-checklist.txt.gz
we can read:

 3.6.1.0                    Aug 2003
       + Prompting the user should be done using debconf. Non debconf
         user prompts are now deprecated. [3.10.1]
	      =20

> (Notice that "mkdir -p $X" does nothing, successfully, when the
> directory $X already exists.)
>=20
> With the patch, the installation seems to me to work correctly now.  Try
> it when you have some time.  Does it look good to you?

I will try it once My exams are over.

> By the way, I think that you may have even fixed bugs #220370
> and #267394, in addition to all the zope bugs you have already closed.
>=20

Ok, I will take a look at it later.


Thanks for you help this is very much appreciate,

Cheers,
--=20
                                Pierre Machard
<pmachard@debian.org>                                 http://debian.org
GPG: 1024D/23706F87 : B906 A53F 84E0 49B6 6CF7 82C2 B3A0 2D66 2370 6F87


--PEIAKu/WMn1b1Hv9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="zope.diff"
Content-Transfer-Encoding: quoted-printable

diff -ruN zope-2.6.4.old/debian/changelog zope-2.6.4/debian/changelog
--- zope-2.6.4.old/debian/changelog	2004-08-31 15:51:04.000000000 +0000
+++ zope-2.6.4/debian/changelog	2004-08-31 20:20:52.000000000 +0000
@@ -1,3 +1,13 @@
+zope (2.6.4-1.6) unstable; urgency=3Dhigh
+
+  * NMU
+  [This NMU has been prepared by Thaddeus H. Black <t@b-tk.org>]
+  * Further fix /var/lib/zope/instance/default/access
+  * In postinst, because stdin is not connected directly to the
+    terminal, take password input from /dev/tty instead
+
+ -- Pierre Machard <pmachard@debian.org>  Tue, 31 Aug 2004 22:00:00 +0200
+=20
 zope (2.6.4-1.5) unstable; urgency=3Dhigh
=20
   * Fix /var/lib/zope/instances/default/access introcuced in 2.6.4.-1.2
diff -ruN zope-2.6.4.old/debian/zope.postinst zope-2.6.4/debian/zope.postin=
st
--- zope-2.6.4.old/debian/zope.postinst	2004-08-31 15:51:04.000000000 +0000
+++ zope-2.6.4/debian/zope.postinst	2004-08-31 20:20:52.000000000 +0000
@@ -77,15 +77,23 @@
                 echo ${INSTANCE_HOME} already exists. >&2
             fi
         fi
+        if [ -d ${access} -o -f ${access} -a ! -s ${access} ] ; then
+            # In the /var/ hierarchy, because a useful file now needs
+            # the filename, move the useless directory or empty file
+            # which an earlier zope (2.6.4-1.x) has inadvertently
+            # created.
+            if [ -e ${access}.bak ] ; then
+                BAKDIR=3D$( mktemp -u ${access}.bak.XXXXXX )
+            else
+                BAKDIR=3D${access}.bak
+            fi
+            mv ${access} ${BAKDIR}
+        fi
         # This should set up all configured instances.
-        {
-            if [ ! -e $access ] ; then
-                	touch $access
-                	echo "Please enter a password for Zope's initial/emergenc=
y user."
-                	zopectl --access "$access"
-	    fi
-        }
-        zopectl --init '*' --pcgi '*'
+        mkdir -p ${INSTANCE_HOME}
+        [ -e ${access} ] || echo \
+            "Please enter a password for Zope's initial/emergency user."
+        zopectl --access 'default' --init '*' --pcgi '*' </dev/tty
 	;;
=20
 	*)

--PEIAKu/WMn1b1Hv9--

--FkmkrVfFsRoUs1wW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBNTHAs6AtZiNwb4cRAvrAAKDbBexbZDscMASwTRKt0CcC1NJ3WgCePQTD
SoyWwqYgtoZ555/Mu6jTd0U=
=vBs/
-----END PGP SIGNATURE-----

--FkmkrVfFsRoUs1wW--