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>
This function is unused since a long time, and likely won't
be used anytime soon, so delete it.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
ARCH is a special name for SlackBuilds, and it will get even
more important now that Slackware is going to support x86_64.
This patch makes sure sbopkg doesn't use it internally any
more.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
Since git repositories track the whole history of a project,
there's no point in maintaining a change log for them. Sbopkg
expects one nevertheless, since it's historically rsync
oriented.
This patch adds the little code needed to automatically
generate a meaningful ChangeLog.txt from the project history.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
The '-s' switch got broken, mainly because it used "leaking"
variables. Give it a proper interface, and use that.
Also, properly check for search failures.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
David Spencer reported on the ML that the current sbopkg
behavior of checking the MD5 only just after the download
breaks some (bad) applications, like Google Earth, which
don't change the source file name on version upgrades.
This patch puts an additional check for existing sources,
so to workaround this issue (at the expense of extra MD5
checks for all other good applications). Moreover, add an
option to retry the download, which comes handy with the
aforementioned bad applications since otherwise the user had
to start the build twice (the first time he sees a failed
MD5 check and has the option to delete the downloaded file,
and the second time the source gets downloaded again).
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch revisits some cleanup path, and makes sure that
the temporary files are deleted where appropriate.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch replaces some wrong 'continue' statements with
'return 0' (which is functionally equivalent on all call
sites), merging some of them at the end of the function.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>