After adding an item to the queue from the search/browse
result list, sbopkg should show the list to the user again
so that he can choose another package. This is the 0.27.x
behavior, but got broken sometime.
This patch restores the correct behavior.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch makes sure that the loaded queue list gets
delete before beginning the loading operations.
Without this patch, the sequence:
- load queue 'foo'
- clear the queue
- load queue 'foo' again
results in an empty queue, since on the second load 'foo'
gets skipped since it's listed as already loaded.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
components, using it in check_for_updates() and add_all_to_queue() and
changing the declared and used variables to suit - also
reformatting/reindenting a few lines, correcting a couple of typos, and fixing
the variable declarations of info_item() along the way - thanks to Mauro and
Chess for review and suggestions.
This patch implements the renames checking for
add_item_to_queue(), thus enabling the use of obsolete
names in legacy queues.
That function can fail if the used name cannot be found.
For that reason, check its return status where appropriate
to properly report such errors to the user.
While at it, improve the add_all_to_queue() interface.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
Cleanup and tweak info_item():
- the code to detect already available packages in $OUTPUT
is now more robust and readable;
- the code to determine already installed versions of the
package is now more robust and readable;
- the "Installed:" line now also lists non-SBo packages
(this is useful for Slackware-current users, as well as
for people using non-SBo third-party packages)
- the window title now also shows the package tag, to
remove some ambiguity (e.g. as of now, Slackware-current
has a libzip package with the same "signature" as the
SBo one, and from the info_item() dialog it looks like
they are the same package when in fact they are not).
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
Before this patch, search_package leaked $PKG and in some
places the code actually made use of that. Since $PKG is the
unmodified first parameters of the function, there's really
no need to use the leaked value -- just use whatever was
put as first argument to the call.
As a side effect, probably some cosmetic bug got fixed,
since $PKG was also used in odd places.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
Code reading suggests that if "can_skip_line $FOO" is true,
the line can be skipped. Unfortunately, the code acts
backwards (if the function returns 0, the line _can't_ be
skipped).
Invert the function return logic so to make the code less
confusing.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>