Added code in base/pkgtools/makepkg to echo package description from an SMLinux-specific build file
This commit is contained in:
parent
183616d75a
commit
6a8649ac16
1 changed files with 33 additions and 13 deletions
|
@ -393,7 +393,14 @@ for package in $* ; do
|
|||
if [ "$DESCRIPTION" = "" ]; then
|
||||
mkdir -p $TMP/scan$$
|
||||
( cd $TMP/scan$$ ; $packagecompression -dc | $TAR xf - install ) < $package 2> /dev/null
|
||||
if grep "^$packagebase:" "$TMP/scan$$/install/slack-desc" 1> /dev/null 2> /dev/null ; then
|
||||
( cd $TMP/scan$$ ; $packagecompression -dc | $TAR xf - doc ) < $package 2> /dev/null
|
||||
if [ "$( find $TMP/scan$$/doc -name "$packagebase.SMBuild" | wc -l)" == "1" ] ; then
|
||||
source "$( find $TMP/scan$$/doc -name "$packagebase.SMBuild" )"
|
||||
# The build file contains the $DESC variable. We use that as our description
|
||||
DESCRIPTION="$(echo $DESC)"
|
||||
# Set a custom variable once we source the application build file
|
||||
SMLINUX_DESC=1
|
||||
elif grep "^$packagebase:" "$TMP/scan$$/install/slack-desc" 1> /dev/null 2> /dev/null ; then
|
||||
DESCRIPTION="$TMP/scan$$/install/slack-desc"
|
||||
elif grep "^$shortname:" "$TMP/scan$$/install/slack-desc" 1> /dev/null 2> /dev/null ; then
|
||||
DESCRIPTION="$TMP/scan$$/install/slack-desc"
|
||||
|
@ -406,16 +413,20 @@ for package in $* ; do
|
|||
fi
|
||||
|
||||
# Gather package infomation into a temporary file:
|
||||
grep "^$packagebase:" $DESCRIPTION | cut -f 2- -d : | cut -b2- 1> $TMP/tmpmsg$$ 2> /dev/null
|
||||
if [ "$shortname" != "$packagebase" ]; then
|
||||
grep "^$shortname:" $DESCRIPTION | cut -f 2- -d : | cut -b2- 1>> $TMP/tmpmsg$$ 2> /dev/null
|
||||
if [ -z "$SMLINUX_DESC" ] ; then
|
||||
grep "^$packagebase:" $DESCRIPTION | cut -f 2- -d : | cut -b2- 1> $TMP/tmpmsg$$ 2> /dev/null
|
||||
if [ "$shortname" != "$packagebase" ]; then
|
||||
grep "^$shortname:" $DESCRIPTION | cut -f 2- -d : | cut -b2- 1>> $TMP/tmpmsg$$ 2> /dev/null
|
||||
fi
|
||||
|
||||
# Adjust the length here. This allows a slack-desc to be any size up to 13 lines instead of fixed at 11.
|
||||
LENGTH=$(wc -l < $TMP/tmpmsg$$ )
|
||||
while [ $LENGTH -lt 12 ]; do
|
||||
echo >> $TMP/tmpmsg$$
|
||||
LENGTH=$(expr $LENGTH + 1)
|
||||
done
|
||||
fi
|
||||
# Adjust the length here. This allows a slack-desc to be any size up to 13 lines instead of fixed at 11.
|
||||
LENGTH=$(wc -l < $TMP/tmpmsg$$ )
|
||||
while [ $LENGTH -lt 12 ]; do
|
||||
echo >> $TMP/tmpmsg$$
|
||||
LENGTH=$(expr $LENGTH + 1)
|
||||
done
|
||||
|
||||
echo "Size: Compressed: ${COMPRESSED}, uncompressed: ${UNCOMPRESSED}." >> $TMP/tmpmsg$$
|
||||
# For recent versions of dialog it is necessary to add \n to the end of each line
|
||||
# or it will remove repeating spaces and mess up our careful formatting:
|
||||
|
@ -444,10 +455,19 @@ EOF
|
|||
else
|
||||
echo "Installing package $(basename $package) $PMSG:"
|
||||
fi
|
||||
|
||||
echo "PACKAGE DESCRIPTION:"
|
||||
grep "^$packagebase:" $DESCRIPTION | uniq | sed "s/^$packagebase:/#/g"
|
||||
if [ "$shortname" != "$packagebase" ]; then
|
||||
grep "^$shortname:" $DESCRIPTION | uniq | sed "s/^$shortname:/#/g"
|
||||
|
||||
# If SMLINUX_DESC is set, echo that description
|
||||
if [ -n "$SMLINUX_DESC" ] && [ "$SMLINUX_DESC" == "1" ] ; then
|
||||
echo ""
|
||||
echo "<<<< $DESCRIPTION >>>>"
|
||||
echo ""
|
||||
elif [ -z "$SMLINUX_DESC" ]; then
|
||||
grep "^$packagebase:" $DESCRIPTION | uniq | sed "s/^$packagebase:/#/g"
|
||||
if [ "$shortname" != "$packagebase" ]; then
|
||||
grep "^$shortname:" $DESCRIPTION | uniq | sed "s/^$shortname:/#/g"
|
||||
fi
|
||||
fi
|
||||
elif [ "$MODE" = "terse" ]; then # emit a single description line
|
||||
printf "%-72s %-6s\n" "$(echo $shortname: $(echo $(cat $DESCRIPTION | grep "^$packagebase:" | sed "s/^$packagebase: //g" | head -n 1 | tr -d '()' | sed "s/^$packagebase //g" ) $(echo " ......................................................................")) | cut -b1-72)" "[${UNCOMPRESSED}]" | cut -b1-80
|
||||
|
|
Loading…
Reference in a new issue