"When in doubt use brute force." The timid line in r770 could result in rm
spitting errors. Thanks to Mauro for the right line. Corrected a typo while I
was at it.
Converted an egrep in info_item() into a grep to avoid issues with '+' being a
metacharacter.
Also removed stale lines (since r631) from gen_search_package() and
string_search(). Also added a couple of credits to the ChangeLog.
Changed the menu order of the "Build options" dialog to default to using
"Saved" options rather than "None" on the theory that, if a user has
saved options, he will more likely want to use them than not.
Removed a commented-out block and made an assignment more consistent.
Brought the add_item_to_queue() comments more in line with its code.
Changed the filename value of GSNFILE so it gets caught by cleanup().
Fixed a typo.
Addressed an issue where hitting ^C during the download of part of a queue
and restarting the queue could result in a download failure. Also added a
ChangeLog item for r768.
Sometimes sbopkg can't determine the version of a package. For example,
the google-chrome script looks at the source archive to determine it, and
such archive can very well be unavailable.
This patch makes sbopkg intercept the error condition and notify it to
the user gracefully, while at the same time falling back to trusting the
version provided in the .info file.
Thanks to alkos333 for the bug report.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
Small improvements:
- reduce the number of times the queue directory is scanned
- drop a wrong 'continue' in the error path
- allow having a QUEUEDIR that is a symlink to the actual directory
- improve file cleanup.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This is a band-aid which explicitly enables all flash-player-plugin sources to
be removed by testing for its names. It also fixes more general issues with
some SRCNAMEs not containing the VERSION number and get_source_names()
sometimes emitting bare newlines in cases where it should emit nothing at all.
This patch also modifies a regex in remove_sources_for_app() and adds unrelated
comments to string_search().
Thanks to artourter for the report, Chess for review, and Mauro for review and
suggestions.
sbopkg sometimes misinterprets version numbers, and some upgrade can
be classified as a downgrade which, by default, is not shown.
For example, 1.0.1 looks older than 1.0-rc2 to it.
Always show and queue apparent downgrades and "unclassified" version
changes as disabled queue items. This way users can fix sbopkg errors
(since there's no way sbopkg can always correctly guess correctly).
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
Adding the updated packages to the build queue could put in the
queue the same package more than once (if it was already present
in there).
Use parse_queue() instead of the bare append to avoid this.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
assignment to PKG in get_source(); modifies process_queue() by checking return
values directly rather than via $? in a couple of places, changes an
assignment to BUILD, and removes an unused COUNTER, and parenthesizes a string
index in the '-b' flag code path
fall through a case; more directly, it sets a NO_DL_LOOP flag if sbopkg has
done a download so that it doesn't download in an infinite loop. It moves the
download command into a conditional which can break the loop. It also modifies
check_source() to unset the flag if sbopkg has done a successful download, so
it can do the next one. Finally, it modifies get_source_names() to only go
into the guessing code if we have done a download, don't have a source file,
and only need to guess on one source name - thanks to godling for noticing a
failure in downloading dictd and the infinite loop; thanks to Chess and Mauro
for review and suggestions.
Some users use a customized LC_COLLATE value, which is known to
be a source of script breakage.
This patch makes sure that LC_COLLATE is set to C (the default)
when building.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
Without this patch, the list of build options was placed on the
left side of a menu dialog entry. Since dialog entries cannot span
to multiple lines, very long option lists were (visually) truncated.
Rework the dialog to show the options in the menu text field, so
there's much more room for them.
Reported by Erik Hanson.
While at it, also make sure that there's no stale options.build
file lying around (which is a minor bugfix).
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This is meant to be useful for doing "final checks" on the active queue
before starting the build process.
Thanks to slakmagik for reviewing.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This way users won't be surprised when misspelling "no" as "np" and
getting a "yes" behavior...
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch makes it possible to run multiple sbopkg instances
simultaneously in different $SBOPKGTMP prefixes.
There are some known (and possibly unknown) caveats the user
should be aware before enabling this option -- I documented the
ones I could think of.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
caused quoted strings in the RHS of the =~ operator in [[ commands to be
interpreted as literal strings, thus causing parts of sbopkg to fail. Update
HACKING to address this. Thanks to SiegeX and others for the reports and
suggestions. Thanks to Mauro and Chess for review and suggestions.
The old regex turned ON into ONOFF. Dialog apparently treats that as
an OFF, so overall the code appeared to work fine. Neverthess, this is
worth a fix.
Spotted by slakmagik.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
'find' prints the directory name as the first result, and if $SBOPKGTMP
is not named after sbopkg it makes the sanity check fail.
Fix this by making sure that 'find' doesn't ever return the directory
name.
Thanks to Ken Roberts for raising the issue.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
In the updates check we split the package name expression (on the
makepkg line) counting dashes. The 13.0 scripts now have, instead of
'tgz', the expression ${PKGTYPE:-tgz} at the end. This makes us pick
up the ARCH field instead.
Fix this by suppressing any ':-' operation found. This should be
reasonably safe (no 12.2 script has such expression there).
While at it, replace the old cut/rev dance with a single sed invocation.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This makes it handier to skip the build for already installed packages.
Note that "installed packages" here includes different versions, since
only the package name is checked.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
The OK wasn't sent to the terminal, so the thing looked quite screwed up
(all the "Checking GPG of" instances were on a single line).
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch shows the currently installed version of each queued package
in queue dialogs, or "New" if the package isn't installed.
The main reason to do something like this is to be quickly able to disable
the build of already-installed packages from a loaded queue. We're not
simply showing "Installed" here just to avoid inducing the user into
thinking that the queued package is exactly the same installed, while it
possibly isn't due to version updates.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
Repository descriptors (*.repo files) weren't properly validated on
load. This could lead to unexpected problems whenever a wrong descriptor
is found.
This patch replaces the original 2-lines loader with a proper parsing
function which also performs some sanity checks.
While at it, stop using the magic number '7' as the number of fields in
a repository record -- use a variable instead.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
they clear the file name in the save dialog and hit okay - before it would
behave as a 'cancel' and now it presents the dialog again. Thanks to Pierre
Cazenave for the suggestion.
Before this patch, they were conditionally unset before
the code checking for the presence of all the required
configuration variables.
While at it, clean up the code a little.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch add a function to remove from $OUTPUT packages
that are not installed. This is useful to remove from
$OUTPUT packages that are made obsolete by version updates,
or that are unwanted for whatever reason.
Addresses issue #20. Thanks to alkos333 for suggesting this
feature.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This is a preparation patch that should have minimal
changes in functionality (some on-screen messages change,
though). Its purpose is to enable the use of the
aforementioned function to remove more than source files.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch adds a sbopkg.conf option that, when enabled,
tells sbopkg to automatically delete the sources and all
the other files generated during the SlackBuild execution
right after running it.
Addresses issue #21. Thanks to Marco Bonetti and Gregory
Tourte for the report and the nice discussion.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch moves the get_source() error management down to
build_package(), which is its only caller. This leads to
some code deletion (mostly related to asking the user what
to do) and gives a "retry" alternative also to source
download problems.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch allows the user to retry a failed build. This
can be useful when the user mistakenly forgot to set up
some prerequisite (like creating a specific user or group),
when the build failed due to filling the build area (not
so unlikely when building large queues) and probably in
other cases too.
Addresses issue #24. Thanks to Zordrak for suggesting this
feature.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This patch adds support for the new SBo 13.0 features, namely
x86_64 support and the ability to specify more than one source
tarball in the .info file.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
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>
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>
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>