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>
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>