LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-11-2012, 03:07 AM   #1
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware 14.1
Posts: 467

Rep: Reputation: 87
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.

What else?
 
Old 05-11-2012, 03:38 AM   #2
samac
Senior Member
 
Registered: Mar 2004
Location: Westray, Orkney
Distribution: Slackware64-14.1 (multi-lib) KDE 4.11.4
Posts: 1,422

Rep: Reputation: 137Reputation: 137
+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?

samac
 
Old 05-11-2012, 03:50 AM   #3
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware 14.1
Posts: 467

Original Poster
Rep: Reputation: 87
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

sorting() {
# Remove double entries
FORMAT=$( echo "$1" | tr ' ' '\012' | sort -u )
}

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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
timing functionalities in linux singapito Linux - General 2 02-07-2010 07:01 AM
Some more Functionalities with the Designer made form dialog navderm Programming 2 01-05-2009 10:54 AM
graphical Linux router with firewall functionalities yiux Linux - Networking 0 02-20-2007 08:45 AM
Linux and XP NOS functionalities farhan Linux - Networking 5 12-06-2004 04:01 AM
Adobe Photoshop like Functionalities in GIMP gem_skywalker Linux - Software 2 12-23-2003 03:54 PM


All times are GMT -5. The time now is 07:49 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration