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

Bug#275140: tetex-base: installation fails if "noclobber" is set



Package: tetex-base
Version: 2.0.2b-6
Severity: important

The postinst script:
/var/lib/dpkg/info/tetex-base.postinst
fails if you set bash's "noclobber" (say in your .bashrc via set -o noclobber).
(yes, I set noclobber in root's .bashrc -- I'm careful)

This is because it creates temporary files via:
tempfile=`mktemp`
echo hi > $tempfile

(more precisely, via stuff like:
  tempfile=`mktemp`
  sed 's@^\(For use with ngerman\)@\% \1@' < $CUR_LDAT > $tempfile
)

If noclobber is set, this'll refuse to overwrite the existing file.

I don't know (and couldn't find) Debian policy on noclobber assumptions
in packaging scripts; however, this hasn't caused problems before
(though I haven't been using Debian long).

I can see 3 resolutions:
1: use >| to force clobbering
2: have "set +o noclobber" in the script to turn off noclobber
3: require folk to not set noclobber in their .bashrc
  (i.e., WONTFIX)
I recall reading something in my Googling about bash treating >| and >
(with noclobber unset) slightly differently, but I'm not sure if this is
an issue here.

Option #1 (use >| to explicitly clobber temporary files) seems the
simplest, safest and most correct (we do want to explicitly clobber it),
and shouldn't break anything.

This seems like a common issue -- is it documented somewhere (in some
packaging guidelines?)?

In any case, this occurs at a few points in 
/var/lib/dpkg/info/tetex-base.postinst
namely lines 103, 111, 141

It also occurs in docbook-dsssl (1.78-5) -- I think it's the same bug (I
get the same "can't overwrite" error, though there it's not used in a
mktemp context, though it probably should be).

Thanks!
-nils

-- Package-specific info:

######################################
 List of ls-R files

-rw-rw-r--  1 root staff 91 2004-10-06 01:43 /usr/local/lib/texmf/ls-R
-rw-rw-r--  1 root users 834 2004-10-06 01:43 /var/lib/texmf/ls-R
lrwxrwxrwx  1 root root 29 2004-10-06 01:41 /usr/share/texmf/ls-R -> /var/lib/texmf/ls-R-TEXMFMAIN

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.7-1-386
Locale: LANG=en_US, LC_CTYPE=en_US

Versions of packages tetex-base depends on:
ii  debconf                       1.4.30.5   Debian configuration management sy
ii  dpkg                          1.10.23    Package maintenance system for Deb
ii  texinfo                       4.7-2.2    Documentation system for on-line i
ii  ucf                           1.09       Update Configuration File: preserv

Versions of packages tetex-bin depends on:
ii  debconf                  1.4.30.5        Debian configuration management sy
ii  debianutils              2.8.4           Miscellaneous utilities specific t
ii  dpkg                     1.10.23         Package maintenance system for Deb
ii  ed                       0.2-20          The classic unix line editor
ii  libc6                    2.3.2.ds1-16    GNU C Library: Shared libraries an
ii  libgcc1                  1:3.4.1-4sarge1 GCC support library
ii  libice6                  4.3.0.dfsg.1-4  Inter-Client Exchange library
ii  libkpathsea3             2.0.2-22        path search library for teTeX (run
ii  libpaper1                1.1.14-0.4      Library for handling paper charact
ii  libpng12-0               1.2.5.0-7       PNG library - runtime
ii  libsm6                   4.3.0.dfsg.1-4  X Window System Session Management
ii  libstdc++5               1:3.3.4-13      The GNU Standard C++ Library v3
ii  libt1-5                  5.0.2-3         Type 1 font rasterizer library - r
ii  libwww0                  5.4.0-9         The W3C WWW library
ii  libx11-6                 4.3.0.dfsg.1-4  X Window System protocol client li
ii  libxaw7                  4.3.0.dfsg.1-4  X Athena widget set library
ii  libxext6                 4.3.0.dfsg.1-4  X Window System miscellaneous exte
ii  libxmu6                  4.3.0.dfsg.1-4  X Window System miscellaneous util
ii  libxt6                   4.3.0.dfsg.1-4  X Toolkit Intrinsics
ii  mime-support             3.28-1          MIME files 'mime.types' & 'mailcap
ii  perl                     5.8.4-2.3       Larry Wall's Practical Extraction 
ii  sed                      4.1.2-1         The GNU sed stream editor
ii  ucf                      1.09            Update Configuration File: preserv
ii  xlibs                    4.3.0.dfsg.1-4  X Window System client libraries m
ii  zlib1g                   1:1.2.1.1-7     compression library - runtime

Versions of packages tetex-extra depends on:
ii  dpkg                      1.10.23        Package maintenance system for Deb
ii  gsfonts                   8.14+v8.11-0.1 Fonts for the Ghostscript interpre
ii  tetex-bin                 2.0.2-22       The teTeX binary files
ii  ucf                       1.09           Update Configuration File: preserv

-- debconf information:
  tetex-bin/updmap-failed:
  tetex-bin/hyphen: french[=patois], ngerman[=naustrian-neue_Rechtschreibung]
  tetex-base/olddat: true
  tetex-bin/oldcfg: true
* tetex-base/fmtutil-failed:
  tetex-base/oldupdm:
  tetex-bin/upd_map: true
  tetex-bin/cnf_name:
  tetex-bin/fmtutil: true
  tetex-base/updmap-failed:
  tetex-bin/use_debconf: false
  tetex-bin/fmtutil-failed:
  tetex-bin/groupname: users
  tetex-bin/userperm: false
  tetex-bin/groupperm: true
  tetex-bin/lsr-perms: true



Reply to: