schooltool.postinst should use /bin/sh not /bin/bash

Bug #726679 reported by Jamie Strandboge on 2011-02-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone
schooltool (Ubuntu)
Gediminas Paulauskas

Bug Description

Binary package hint: schooltool

In reviewing the schooltool package, I noticed that debian/schooltool.postinst used /bin/bash. It should use /bin/sh instead. I ran checkbashisms on debian/schooltool.postinst, and it did not detect any bashisms, so simply changing to /bin/sh might be enough.

Related branches

Jonathan Carter (jonathan) wrote :

Hi Jamie, thanks for your bug report. I should have spotted that when reviewing the package.

It's been fixed and uploaded.

Changed in schooltool (Ubuntu):
assignee: nobody → Jonathan Carter (jonathan)
status: New → Fix Committed
Gediminas Paulauskas (menesis) wrote :

I used ";&" separator in the case statement so that "configure" step continues to "triggered" step. This syntax does not work with /bin/sh:

Unpacking replacement schooltool ...
Setting up schooltool (1:1.6.0~a1-0ubuntu2) ...
/var/lib/dpkg/info/schooltool.postinst: 33: Syntax error: ";" unexpected
dpkg: error processing schooltool (--install):
 subprocess installed post-installation script returned error exit status 2

That's why I used /bin/bash in this script.

Jonathan Carter (jonathan) wrote :

checkbashisms schooltool.postinst
possible bashism in schooltool.postinst line 33 (;;& and ;& special case operators):

Hmm, weird that Jamie's checkbashisms didn't pick that up. I guess I should've checked it myself too. suggests that there isn't a simple replacement for ".&".

Gediminas, will you have time to implement a function like that page suggests? If not I'll set it back to bash then.

Gediminas Paulauskas (menesis) wrote :

Will extract functions for next update. Thanks for bashism link.

Changed in schooltool (Ubuntu):
status: Fix Committed → Triaged
importance: Undecided → Medium
assignee: Jonathan Carter (jonathan) → Gediminas Paulauskas (menesis)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package schooltool - 1:1.6.0~b1-0ubuntu1

schooltool (1:1.6.0~b1-0ubuntu1) natty; urgency=low

  * New upstream release
    - Added report package (LP: #429588)
    - Fixed crash when term title is "First" or "Last" (LP: #485639).
    - Updated translations.
  * debian/schooltool.postinst: Extract backup_database function to make
    the script work using /bin/sh (LP: #726679)
  * debian/patches/include-plugins.patch: Remove the patch. Instead, depend
    on z3c.autoinclude 0.3.4 that fixes the problem.
 -- Gediminas Paulauskas <email address hidden> Mon, 18 Apr 2011 22:12:41 +0300

Changed in schooltool (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers