Package: wims-lti
Version: 0.4.4.1-10
Tags: patch

Dear wims-lti maintainer,

the current postrm script of `wims-lti` requires Perl. Maintscripts
should not rely on the existence of Perl in future systems.

In this specific case it is possible to replace the single use of `perl`
with an invocation of `mktemp` or `shuf` (both from coreutils), as in
these patches:

Using `mktemp`:

diff -ur a/debian/wims-lti.postrm b/debian/wims-lti.postrm
--- a/debian/wims-lti.postrm    2021-09-06 19:07:17.000000000 +0200
+++ b/debian/wims-lti.postrm    2022-04-13 15:10:38.698891971 +0200
@@ -35,7 +35,7 @@
        # backup the database
        # create a random temporary file name, without tempfile
        # ... Why is not debianutils part of piupart's package list?
-       t="/var/tmp/wims-lti"$(perl -e 'print rand();')".sqlite3"
+       t="$(mktemp --tmpdir=/var/tmp --suffix .sqlite3 wims-lti-XXXXX)"
        cp /var/lib/wims-lti/db.sqlite3 $t
        echo "Made a backup of the database in $t"
        # clean every file left

Using `shuf`:

diff -ur a/debian/wims-lti.postrm b/debian/wims-lti.postrm
--- a/debian/wims-lti.postrm    2021-09-06 19:07:17.000000000 +0200
+++ b/debian/wims-lti.postrm    2022-04-13 15:10:38.698891971 +0200
@@ -35,7 +35,7 @@
        # backup the database
        # create a random temporary file name, without tempfile
        # ... Why is not debianutils part of piupart's package list?
-       t="/var/tmp/wims-lti"$(perl -e 'print rand();')".sqlite3"
+       t="/var/tmp/wims-lti"$(shuf -i 10000000-99999999 -n1)".sqlite3"
        cp /var/lib/wims-lti/db.sqlite3 $t
        echo "Made a backup of the database in $t"
        # clean every file left

Regards,

--
Gioele Barabucci

Reply via email to