Article 6JXPC Some SBo scripts with PRINT_PACKAGE_NAME set fail.

Some SBo scripts with PRINT_PACKAGE_NAME set fail.

by
viel
from LinuxQuestions.org on (#6JXPC)
Hi all,

I am checking all the SBo scripts with the var PRINT_PACKAGE_NAME set and there are some scripts that fail because of code between the variables and the if conditional check.

From vi /opt/slackware-repositories/slackbuilds/15.0/system/zookeeper/zookeeper.SlackBuild

Code:--skipped--
25 cd $(dirname $0) ; CWD=$(pwd)
26
27 PRGNAM=zookeeper
28 VERSION=${VERSION:-3.4.10}
29 BUILD=${BUILD:-1}
30 TAG=${TAG:-_SBo}
31 PKGTYPE=${PKGTYPE:-tgz}
32
33 ZOOKEEPER_USER=${ZOOKEEPER_USER:-zookeeper}
34 ZOOKEEPER_UID=${ZOOKEEPER_UID:-322}
35 ZOOKEEPER_GROUP=${ZOOKEEPER_GROUP:-zookeeper}
36 ZOOKEEPER_GID=${ZOOKEEPER_GID:-322}
37
38 if [ -z "$ARCH" ]; then
39 case "$( uname -m )" in
40 i?86) ARCH=i586 ;;
41 arm*) ARCH=arm ;;
42 *) ARCH=$( uname -m ) ;;
43 esac
44 fi
45
46 bailout() {
47 echo " You must have a $ZOOKEEPER_USER user and $ZOOKEEPER_GROUP group to run this script. "
48 echo " Something like this should suffice for most systems: "
49 echo " # groupadd -g $ZOOKEEPER_GID $ZOOKEEPER_GROUP "
50 echo " # useradd -u $ZOOKEEPER_UID -g $ZOOKEEPER_GID -c \"Zookeeper user\" -d /var/lib/zookeeper -s /bin/sh $ZOOKEEPER_USER "
51 echo " Giving /bin/sh as $ZOOKEEPER_USER shell is important as the init script will try tu 'su -' to it."
52 exit 1
53 }
54
55 # Bail if user and/or group isn't valid on your system
56 # uid=322 is suggested to avoid conflicts with other SBo packages,
57 # but it's your call: http://slackbuilds.org/uid_gid.txt
58 if ! grep -q "^$ZOOKEEPER_USER:" /etc/passwd; then
59 bailout
60 elif ! grep -q "^$ZOOKEEPER_GROUP:" /etc/group; then
61 bailout
62 fi
63
64 # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
65 # the name of the created package would be, and then exit. This information
66 # could be useful to other scripts.
67 if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
68 echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
69 exit 0
70 fi
71

--skipped--
Code:[root@arcadia tmp]# PRINT_PACKAGE_NAME=y bash /opt/slackware-repositories/slackbuilds/15.0/system/zookeeper/zookeeper.SlackBuild
You must have a zookeeper user and zookeeper group to run this script.
Something like this should suffice for most systems:
# groupadd -g 322 zookeeper
# useradd -u 322 -g 322 -c "Zookeeper user" -d /var/lib/zookeeper -s /bin/sh zookeeper
Giving /bin/sh as zookeeper shell is important as the init script will try tu 'su -' to it.
[root@arcadia tmp]#

Realy i think don't need a telegraf group to check the package name.
Code:[root@arcadia tmp]# PRINT_PACKAGE_NAME=y bash /opt/slackware-repositories/slackbuilds/15.0/system/telegraf/telegraf.SlackBuild
You must have the "telegraf" group to run this script.
# groupadd -g 349 telegraf
[root@arcadia tmp]#
That is all the entire list. Above.

Code:[root@arcadia tmp]# time for i in $(find /opt/slackware-repositories/slackbuilds/15.0/ -type f -name *.SlackBuild ) ; do PRINT_PACKAGE_NAME=y bash $i >/dev/null 2>/dev/null || echo $i ; done
/opt/slackware-repositories/slackbuilds/15.0/academic/amplifx/amplifx.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/audio/rplay/rplay.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/business/stansoft/stansoft.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/development/sonarqube/sonarqube.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/games/smokinguns/smokinguns.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/multimedia/serviio/serviio.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/multimedia/sickchill/sickchill.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/network/coturn/coturn.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/network/ircd-hybrid/ircd-hybrid.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/network/kasp_updater/kasp_updater.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/network/nsd/nsd.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/network/rspamd/rspamd.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/network/yadifa/yadifa.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/chronograf/chronograf.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/colord/colord.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/fcron/fcron.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/influxdb/influxdb.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/kafka/kafka.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/kapacitor/kapacitor.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/netdata/netdata.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/ntopng/ntopng.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/nut/nut.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/prometheus/prometheus.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/rabbitmq-server/rabbitmq-server.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/telegraf/telegraf.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/zookeeper/zookeeper.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/greetd/greetd.SlackBuild
/opt/slackware-repositories/slackbuilds/15.0/system/kbfs/kbfs.SlackBuild

real 1m40.163s
user 1m6.396s
sys 0m36.474s
[root@arcadia tmp]#Is there some reason I don't see to put a few lines of code between
Code: PRGNAM=foo
VERSION=${VERSION:-1.1.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}and
Code:
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi?

If not. Is there a way to solve that all in one? or I need to contact all the maintainers folks?

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