Bug#397785: [debconf] Should warn if postinst doesn't understand argument reconfigure

2006-11-09 Thread Frank Küster
Package: lintian
Version: 1.5.8
Severity: wishlist

From debconf-devel(7):

,
| the right thing would be to pass $1 = reconfigure, but doing so
| without breaking all the postinsts that use debconf is difficult.  The
| migration plan away from this hack is to encourage people to write
| postinsts that accept reconfigure, and once they all do, begin
| passing that variable.
`

To aid in that goal, it would be nice if lintian complained if
reconfigure is not accepted.

Regards, Frank

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (99, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.17-2-686
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages debconf depends on:
ii  debconf-i18n   1.4.30.13 full internationalization support 
ii  perl-base  5.8.4-8sarge5 The Pathologically Eclectic Rubbis

-- debconf information:
* debconf/priority: medium
* debconf/frontend: Kde

-- 
Dr. Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)



Bug#397785: [debconf] Should warn if postinst doesn't understand argument reconfigure

2006-11-09 Thread Russ Allbery
Frank Küster [EMAIL PROTECTED] writes:

 Package: lintian
 Version: 1.5.8
 Severity: wishlist

 From debconf-devel(7):

 ,
 | the right thing would be to pass $1 = reconfigure, but doing so
 | without breaking all the postinsts that use debconf is difficult.  The
 | migration plan away from this hack is to encourage people to write
 | postinsts that accept reconfigure, and once they all do, begin
 | passing that variable.
 `

 To aid in that goal, it would be nice if lintian complained if
 reconfigure is not accepted.

Agreed, but I don't have any idea how to do that given that the tests in
postinst can be written as case statements or if statements and in many
different formats and syntaxes and simply missing the word reconfigure
doesn't mean that the postinst is wrong.

-- 
Russ Allbery ([EMAIL PROTECTED])   http://www.eyrie.org/~eagle/



Bug#397785: [debconf] Should warn if postinst doesn't understand argument reconfigure

2006-11-09 Thread Frank Küster
Russ Allbery [EMAIL PROTECTED] wrote:

 Frank Küster [EMAIL PROTECTED] writes:

 Package: lintian
 Version: 1.5.8
 Severity: wishlist

 From debconf-devel(7):

 ,
 | the right thing would be to pass $1 = reconfigure, but doing so
 | without breaking all the postinsts that use debconf is difficult.  The
 | migration plan away from this hack is to encourage people to write
 | postinsts that accept reconfigure, and once they all do, begin
 | passing that variable.
 `

 To aid in that goal, it would be nice if lintian complained if
 reconfigure is not accepted.

 Agreed, but I don't have any idea how to do that given that the tests in
 postinst can be written as case statements or if statements and in many
 different formats and syntaxes and simply missing the word reconfigure
 doesn't mean that the postinst is wrong.

Yes, this is hard and probably won't go without false positives and
negatives... 

One approach might be to

- find assignments of $1 to a variable name

- check all occurrences of 

case [']*\$(1|name_found)['] 

  or analogous 

if (\[|test) ...

  whether there's an occurence of reconfigure before esac or before
  then, respectively.  I'd say it's a feature not to allow
  *configure in case statements.

Even if this approach might give false positives, I still think it's
better to do such a check than none at all.  

Regards, Frank
-- 
Dr. Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)