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>
sbopkg 'touch'es a file (sbopkg_return_main_menu) to track
that the user asked to jump back to the main menu from a
"deep" menu level (such as info_item).
This patch converts it to the usage of function return values,
which makes the code smaller and easier to read.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
Since we do many file operations in $SBOPKGTMP, including
some 'rm -rf', check its content on startup to make sure no
user files are mistakenly in there.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch removes some code duplication and modifies some
detail about the EDITOR, PAGER and HAS_NCURSES variables.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch introduces a new repos.d directory containing
all the definitions of repository branches. This way the
supported repositories can be extended without modifying
the default configuration files, which causes problems on
version updates.
Thanks to Chess Griffin for his efforts in planning this
feature and reviewing the implementation.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>