Article 6PRSF installpkg: Unsure of purpose of echo statement in 'if block'?

installpkg: Unsure of purpose of echo statement in 'if block'?

by
Mechanikx
from LinuxQuestions.org on (#6PRSF)
I was reading through installpkg and came across and 'if block' that looks like it's meant to warn you if a package's slack-desc is missing. However:

Code: # If we still don't have a package description, look inside the package.
# This requires a costly untar.
if [ "$DESCRIPTION" = "" ]; then
mkdir -p $TMP/scan${MCOOKIE}
( cd $TMP/scan${MCOOKIE} ; $packagecompression -dc | tar xf - install ) < $package 2> /dev/null
if grep "^$packagebase:" "$TMP/scan${MCOOKIE}/install/slack-desc" 1> /dev/null 2> /dev/null ; then
DESCRIPTION="$TMP/scan${MCOOKIE}/install/slack-desc"
elif grep "^$shortname:" "$TMP/scan${MCOOKIE}/install/slack-desc" 1> /dev/null 2> /dev/null ; then
DESCRIPTION="$TMP/scan${MCOOKIE}/install/slack-desc"
fi
fi

if [ "$DESCRIPTION" = "" ]; then
#echo "WARNING NO SLACK-DESC"
DESCRIPTION="/dev/null"
fi


# Gather package infomation into a temporary file:
grep "^$packagebase:" $DESCRIPTION | cut -f 2- -d : | cut -b2- 1> $TMP/tmpmsg${MCOOKIE} 2> /dev/null
if [ "$shortname" != "$packagebase" ]; then
grep "^$shortname:" $DESCRIPTION | cut -f 2- -d : | cut -b2- 1>> $TMP/tmpmsg${MCOOKIE} 2> /dev/null
fiThe echo statement is commented out. At first I thought this was a mistake but after doing a little digging I see that this 'if block' was first introduced in 13.0 and that echo
statement has always been commented. There's no mention of this change in the ChangeLog for 13.0. So I thought I would post here rather than the requests thread since I'm unsure
if it's intentional or not.

I decided to remove the slac-desc from the emacs package and install it.

Quote:
Verifying package emacs-29.4-x86_64-1_slack15.0.txz.
Installing package emacs-29.4-x86_64-1_slack15.0.txz:
PACKAGE DESCRIPTION:
Executing install script for emacs-29.4-x86_64-1_slack15.0.txz.
Package emacs-29.4-x86_64-1_slack15.0.txz installed.
Uncommenting that echo statement in installpkg:

Quote:
Verifying package emacs-29.4-x86_64-1_slack15.0.txz.
WARNING NO SLACK-DESC
Installing package emacs-29.4-x86_64-1_slack15.0.txz:
PACKAGE DESCRIPTION:
Executing install script for emacs-29.4-x86_64-1_slack15.0.txz.
Package emacs-29.4-x86_64-1_slack15.0.txz installed.
It would seem like a good idea to warn a user about a missing slac-desc file. If not, why is that echo statement even there to begin with and why would it be commented?

Thanks
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments