[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: removal of subdirs under /usr/local



On Tue, Nov 21, 2000 at 01:05:38PM -0800, Matt Kraai wrote:
> Section 2.2 of the packaging manual says that the postinst script should
> be idempotent.  Section 3.1.2 of the Policy Manual suggests the
> following code to remove directories under /usr/local:
> 
> rmdir /usr/local/lib/emacs/site-lisp && \
> rmdir /usr/local/lib/emacs || \
> true
> 
> This is not idempotent if the system fails (or someone sends a signal)
> after /usr/local/lib/emacs/site-lisp is removed, but before
> /usr/local/lib/emacs is.  Subsequent invocations will never remove
> /usr/local/lib/emacs .  I think the following is a better solution:
> 
> rmdir /usr/local/lib/emacs/site-lisp /usr/local/lib/emacs || true
> 
> If we can't rely on rmdir continuing with the rest of its arguments if
> the first removal fails, then it seems that the following should be
> used:
> 
> rmdir /usr/local/lib/emacs/site-lisp || true
> rmdir /usr/local/lib/emacs || true

I've changed the (now policy) docs in CVS to use your second suggestion.

   Julian

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

         Julian Gilbey, Dept of Maths, Queen Mary, Univ. of London
       Debian GNU/Linux Developer,  see http://people.debian.org/~jdg
  Donate free food to the world's hungry: see http://www.thehungersite.com/



Reply to: