What other functionalities would like to have on sbopkg
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What other functionalities would like to have on sbopkg
I would like to update packages according to their dependencies in their original queue files. Thus if I need to upgrade package A and B, but A depends on B, then sbopkg would get the order right from the original queue files. If C also depended on B, then maybe you would like to re-build it as well. I had written a script that does this for me but it is just a script and therefore not integrated in sbopkg.
I would also like to see some clever way to uninstall packages. If I would like to uninstall package A, but B was only installed as a dependency for A, then sbopkg would let me know and offer the option of removing both.
If I would like to uninstall B, it would be nice to warn you that A and C depend on B.
sbopkg does not uninstall packages, but it might be helpful if the queue files have been carefully compiled.
I would also like to optionally ignore md5sum checksum errors; they are pretty useless most of the time, and there is not much to do about them.
+1 for including queues as a built in part of sbopkg, however if a package includes an optional dependency this could be a problem for some people. Should the queue only contain the files that are essential or should it include all?
When you build a package you list your dependencies in a queue file. At that point there are no optional dependencies, they are either in the queue file or not. When upgrading, the same queue file would be referred.
I am attaching my upgrade script. I had written it some time ago and I did not maintain it much. Most of the time it works, and occasionally it fails:-
Quote:
#!/bin/sh
#
# Copyright 2011 Chris Abela, Malta
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Script to upgrade SlackBuilds
#
# This script takes the SlackBuilds flagged for updating as arguments and then
# them creates an Sbopkg queue file that may be used to re-build your packages
# in the correct sequence.
#
# Binary builts are not catered for.
#
# This script assumes rigourous maintenance of the Sbopkg queue files.
USAGE="sh upgrade.sh package_name_1 package_name_2 ..."
QUEUES=${QUEUES:-/var/lib/sbopkg/queues/}
DATE=$( date +%y%m%d )
# A simple usage hint
if [ "$#" -eq 0 ]; then
echo "$USAGE"
exit
else echo "Please wait until I find all the packages built against $* ..."
echo
fi
[ ! -d $QUEUES ] \
&& echo "Sbopkg queue directory was not found, aborting" \
&& exit
cd $QUEUES
# Remove previous upgrade sqf file as they will disturb the algorithm
rm -f upgrade.??????.sqf
format() {
# Replace White Spaces by Line Feeds
FORMAT=$( echo "$1" | tr ' ' '\012' )
}
find_deps() {
unset PREVIOUS_DEPS
# DEPS were compiled against $@:
for PKG in $@; do
DEPS=$( grep -l $PKG *.sqf| grep -v "^$PKG" | grep -v "[[:alnum:]]$PKG" \
| grep -v "$PKG[[:alnum:]]" | sed 's/\.sqf//' )
DEPS="${DEPS} ${PREVIOUS_DEPS}"
PREVIOUS_DEPS=$DEPS
done
sorting "$DEPS"
DEPS="$FORMAT"
}
reverse(){
# Reverse the order of $@
unset REVERSE
for i in $@; do
REVERSE="$i $REVERSE"
done
}
rationalise (){
# Remove double entries in $@ without touching the order
for i in $@; do
# If D does not have i; then append i to D
echo "$D" | grep -q "$i" || D="$D $i"
done
}
build_options (){
# Determine the build options
for i in $@; do
# Do not consider anything after #
BUILD_OPTIONS=$( cat ${i}.sqf | sed 's/#.*//' | grep $i | \
grep -v "[[:alnum:]]${i}" | grep -v "${i}[[:alnum:]]" )
echo $BUILD_OPTIONS >> upgrade.$DATE.sqf
done
}
find_deps $@ # Find the first lot which where built against $@
FINAL_DEPS="$DEPS"
while [ -n "$DEPS" ]; do # Find the next lot that were built against them
find_deps "$DEPS"
FINAL_DEPS="$FINAL_DEPS $DEPS"
done # No more were found
FINAL_DEPS="$@ $FINAL_DEPS"
rationalise $FINAL_DEPS
format "$D"
echo $D
# Write the sbopkg queue file
echo "#upgrade $*" > upgrade.$DATE.sqf
for i in "$FORMAT"; do
build_options $i
done
cat upgrade.$DATE.sqf
echo
Last edited by ChrisAbela; 05-11-2012 at 03:52 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.