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>
Modify the renames tracking so that, instead of a single
file, all the files of a renames.d directory are used (just
like udev and modprobe do).
This has several advantages:
- no more need to "mv sbopkg-renames.new sbopkg-renames"
- it's now easier to add custom renames that automatically
"survive" version upgrades
and, last but not least, this is believed to be the correct
way to handle these things.
Many thanks are due to Robby Workman for proposing this
change and to Chess Griffin for implementing it.
The giant cleanup broke package building by marking "too
many" variables as local. These two are actually used
elsewhere, so just make them global.
Thanks to Chess Griffin for this fix.
If the user ever created a personal sbopkg.conf file not
containing the SLACKVER=... line, the old code would not
add it.
This patch fixes the code by removing the assignment if it
exists, and then unconditionally adding the new one at the
end.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
SBOPKG_CONF shouldn't be unset at startup, because we want
to be able to override the default config file name with it.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
Give a lower priority to the build process, so that sbopkg
becomes less a resource hog when left working in background.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch makes the repository list a configurable item
inside sbopkg.conf.
With this new way to specify repositories, there's the
possibility of naming the tool able to sync the local copy
of the remote repository. Such feature has been then used to
implement the support of git-based repositories, much
common in the Slamd64 land.
Please note that the purpose of this patch is to provide a
more flexible fetching system. The additional repositories
must be careful in being conform to the SlackBuilds.org
structure, or sbopkg will fail with them.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
$CWD stores the directory the user started sbopkg from.
We cannot make assumptions about it not containing spaces,
so proper quoting is needed.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This is a call I forgot to remove when the new updates code
went in (r333). There were no functional changes due to this,
but slowed down the updates by a perceivable amount.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch touches almost every part of sbopkg, making
it more readable, manageable and less bug-prone.
Working on this already let us spot several bugs, and
will ease further development and debugging efforts.
This is the result of a lot of patient team work, for
which Chess, slakmagik and I should be equally credited.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch refactors the renames code putting the old/new
name retrieval in two generic helpers.
Also fix the upgrading of renamed packages by providing
the old package name to upgradepkg.
Thanks to Phillip Warner for raising the issue, and to
Chess Griffin and slakmagik for testing and reviewing this
patch.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>