misc/pinfo: Add douninst.sh.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2023-03-08 01:38:04 -05:00 committed by Willy Sudiarto Raharjo
parent 7d0876d71f
commit 562c2d8838
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
3 changed files with 11 additions and 5 deletions

View File

@ -1,18 +1,15 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
config etc/pinforc.new
if [ -x /usr/bin/install-info ]; then
chroot . /usr/bin/install-info --info-dir=/usr/info /usr/info/pinfo.info.gz 2> /dev/null
/usr/bin/install-info usr/info/pinfo.info.gz usr/info/dir
fi

6
misc/pinfo/douninst.sh Normal file
View File

@ -0,0 +1,6 @@
if [ -x /usr/bin/install-info -a -d usr/info ]; then
( cd usr/info
rm -f dir
for i in *.info*; do /usr/bin/install-info $i dir 2>/dev/null; done
)
fi

View File

@ -24,6 +24,8 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 20230308 bkw: BUILD=3, add douninst.sh to clean up GNU info dir.
# 20200708 bkw: BUILD=2
# - restore old 'pman' link (nothing conflicts)
# - fix homepage in slack-desc
@ -39,7 +41,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=pinfo
VERSION=${VERSION:-0.6.13}
BUILD=${BUILD:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -124,6 +126,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cat $CWD/douninst.sh > $PKG/install/douninst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE