Check for updates: show and queue all version changes.

sbopkg sometimes misinterprets version numbers, and some upgrade can
be classified as a downgrade which, by default, is not shown.
For example, 1.0.1 looks older than 1.0-rc2 to it.
Always show and queue apparent downgrades and "unclassified" version
changes as disabled queue items. This way users can fix sbopkg errors
(since there's no way sbopkg can always correctly guess correctly).

Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This commit is contained in:
mauro.giachero 2009-10-20 13:14:48 +00:00
parent 0d1720bc33
commit d27fd4d394
3 changed files with 28 additions and 15 deletions

View File

@ -35,4 +35,8 @@ enhancements:
of the actual options; thanks to Erik Hanson for the bug report. of the actual options; thanks to Erik Hanson for the bug report.
* Work around build issues caused by custom LC_COLLATE values. * Work around build issues caused by custom LC_COLLATE values.
* Add tint=tint2 to /etc/sbopkg/renames.d/50-default file. * Add tint=tint2 to /etc/sbopkg/renames.d/50-default file.
* The 'check for updates' function now always lists apparent downgrades,
since it sometimes can mistakenly classify an upgrade as a downgrade
(e.g. version 1.0.1 looks older than 1.0-rc2 to sbopkg). The apparent
downgrades are added to the queue but are disabled by default.
+--------------------------+ +--------------------------+

View File

@ -177,11 +177,11 @@ There can be more unsafe situations we haven't thought about. Take care.
.br .br
This option should be set to 0, 1, or 2. DEBUG sets the default This option should be set to 0, 1, or 2. DEBUG sets the default
debugging level for the update list feature of sbopkg. When DEBUG is debugging level for the update list feature of sbopkg. When DEBUG is
set to 0, then only potential updated packages are listed. This was set to 0, then only potential updated (or downgraded) packages are listed.
the default output prior to the DEBUG variable. When DEBUG is set to When DEBUG is set to 1, then potential updates plus packages not in the
1, then potential updates plus packages not in the repo and packages repo and packages that are newer than the repo are listed. When DEBUG is
that are newer than the repo are listed. Changing DEBUG to 1 may be set to 2, all non-updated packages are also listed. Changing DEBUG to 1 or
helpful if it appears the updatelist might be missing an update. 2 may be helpful if it appears the updatelist might be missing an update.
The default value of DEBUG is: 0. The default value of DEBUG is: 0.

View File

@ -779,15 +779,23 @@ check_for_updates() {
>> $UPDATELIST >> $UPDATELIST
echo "$NAME" >> $SBOPKGTMP/sbopkg-update-queue echo "$NAME" >> $SBOPKGTMP/sbopkg-update-queue
elif [[ $UPDATED -eq -1 ]]; then elif [[ $UPDATED -eq -1 ]]; then
if [[ $DEBUG -ge 1 ]]; then echo $NAME: >> $UPDATELIST
echo $NAME: >> $UPDATELIST echo " INSTALLED PACKAGE IS NEWER THAN REPO" \
echo " INSTALLED PACKAGE IS NEWER THAN REPO" \ >> $UPDATELIST
>> $UPDATELIST echo " Installed version: " $CURPKG >> $UPDATELIST
echo " Installed version: " $CURPKG >> $UPDATELIST echo " Repo version: " \
echo " Repo version: " \ $NAME-$NEWVER-$NEWARCH-${NEWBUILD}$REPO_TAG \
$NAME-$NEWVER-$NEWARCH-${NEWBUILD}$REPO_TAG \ >> $UPDATELIST
>> $UPDATELIST echo "-$NAME" >> $SBOPKGTMP/sbopkg-update-queue
fi elif [[ $PKG_VER != $NEWVER ]]; then
echo $NAME: >> $UPDATELIST
echo " UNCLASSIFIED VERSION CHANGE" \
>> $UPDATELIST
echo " Installed version: " $CURPKG >> $UPDATELIST
echo " Repo version: " \
$NAME-$NEWVER-$NEWARCH-${NEWBUILD}$REPO_TAG \
>> $UPDATELIST
echo "-$NAME" >> $SBOPKGTMP/sbopkg-update-queue
else else
if [[ $DEBUG -eq 2 ]]; then if [[ $DEBUG -eq 2 ]]; then
echo $NAME: >> $UPDATELIST echo $NAME: >> $UPDATELIST
@ -4140,7 +4148,8 @@ main_updates() {
if [[ -f $UPDATES_QUEUE ]]; then if [[ -f $UPDATES_QUEUE ]]; then
dialog --title "Add Updates to Queue?" --yesno \ dialog --title "Add Updates to Queue?" --yesno \
"$(crunch "Would you like to add the flagged updates to \ "$(crunch "Would you like to add the flagged updates to \
the build queue?")" 8 35 the build queue?\\n\\nApparent downgrades will be added to the \
queue but will be kept disabled.")" 9 50
if [[ $? == 0 ]]; then if [[ $? == 0 ]]; then
touch $USERQUEUE_LOCK touch $USERQUEUE_LOCK
parse_queue $UPDATES_QUEUE parse_queue $UPDATES_QUEUE