1#!/bin/sh 2# postinst script for ls-config 3# 4# see: dh_installdeb(1) 5 6set -e 7 8# summary of how this script can be called: 9# * <postinst> `configure' <most-recently-configured-version> 10# * <old-postinst> `abort-upgrade' <new version> 11# * <conflictor's-postinst> `abort-remove' `in-favour' <package> 12# <new-version> 13# * <postinst> `abort-remove' 14# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' 15# <failed-install-package> <version> `removing' 16# <conflicting-package> <version> 17# for details, see http://www.debian.org/doc/debian-policy/ or 18# the debian-policy package 19 20config_path() { 21 local CHK="$(echo ":$PATH:" | grep ":/usr/share/ls/lib:")" 22 if [ "$CHK" != "" ]; then 23 return 0; 24 fi; 25 local BIFS="$IFS" 26 IFS=$'\n' 27 local PR="$(</etc/profile)" 28 local NF="" 29 local L 30 for L in $PR 31 do 32 CHK="$(echo "$L" | sed -E 's/^([\ \t]+)//g')" 33 CHK="${CHK:0:5}" 34 NF="$NF$IFS$L" 35 if [ "$CHK" = "PATH=" ]; then 36 NF="$NF$IFS#Configuration path for ls scripting" 37 NF="$NF$IFS" 38 NF="${NF}PATH=\"\$PATH:/usr/share/ls/lib\"$IFS" 39 fi; 40 done 41 NF="$NF$IFS" 42 IFS="$BIFS" 43 echo "$NF" > /etc/profile 44} 45 46case "$1" in 47 configure) 48 if [ ! -e "/etc/ls" ]; then 49 mkdir -p "/etc/ls/" 50 config_path 51 fi; 52 ;; 53 54 abort-upgrade|abort-remove|abort-deconfigure) 55 ;; 56 57 *) 58 echo "postinst called with unknown argument \`$1'" >&2 59 exit 1 60 ;; 61esac 62 63# dh_installdeb will replace this with shell code automatically 64# generated by other debhelper scripts. 65 66#DEBHELPER# 67 68exit 0 69