Changed a line which made it almost sound like sbopkg might randomly
replace the config file, making it clear it's under user control.
Modified (mostly removed) the paragraph (similar to one in the README
that was also recently modified/removed) about sbopkg not really
supporting build chains. It isn't *guaranteed*, but doesn't need to
sound like some random fluke.
Major reformatting and some textual modifications of
src/usr/doc/sbopkg-*/* including breaking out the credits from the
script into a detailed THANKS file, renaming and reformatting
ChangeLog.txt into NEWS, renaming the sample queuefiles from *.sqf to
*.sqf.sample, and making lesser modifications to all the other docs.
Move the assignment to SBOPKGTMP (via mktemp and its TMPDIR) to after
sourcing the config file. Thanks to Ken Roberts for reporting the issue
and providing a preliminary fix.
Also modify config_check() to check for obsolete variables as it does
for required variables. Also modify cleanup() to only try to remove
SBOPKGTMP if it exists.
Remove documentation for removed config file option SBOPKGTMP and
document its replacement, TMPDIR. Add TMPDIR (and comments) to the
config file.
Thanks to dive for raising this issue.
r845 addresses part of a problem with sbopkg code and bash 3x array
handling but not all of it. When creating an array with the += operator,
if the array creation code was triggered, the item doing so should have
been assigned to index 0 and, instead, an empty string was being
assigned to 0 and the item was being assigned to index 1, resulting in a
blank line being output before the proper item. Thanks to greinze for
pointing this out. Explicitly declaring the variable an array seems to
solve this.
Applied patch by Mauro which modified get_source_names() to only attempt
to ls SRCNAME if SRCNAME is not empty so that it doesn't list the entire
cache directory and break get_obsolete_sources(). This was triggered by
django, whose DOWNLOAD was given as
"http://www.djangoproject.com/download/1.2.3/tarball/"
Signed-off-by: slakmagik <slakmagik@gmail.com>
r819 mostly replaced directory_checks() and ck_dir() with dir_init() but
forgot about the MKDIR_PROMPT variable used in ck_dir(). So again wrapped
the prompting in a conditional based on that setting and moved the
action outside the conditional.
Also added a rename to the bugfix branch which had been added to trunk after
the branch point - now the two files are in sync (just in case we do another
0.33.x release).
This revision corrects a security issue introduced in r762 and a trap
lost in r819. The basic idea is to revert the unsafe operator from r762
and then replace sbopkg's static SBOPKGTMP directory with a more secure,
volatile one created by mktemp and to use it and a new batch of traps to
simplify creation and cleanup of tmp dirs and files.
Tmp/trap/cleanup changes:
* /etc/sbopkg/sbopkg.conf.new: removed old SBOPKGTMP variable.
* config_check(): ditto. Also removed everything about unexpected files
since the new SBOPKGTMP should take care of that.
* dir_init(): removed SBOPKGTMP variable and its use. Dumped the
ALLOW_MULTI/mcookie part, since the new SBOPKGTMP should take care of
that.
* script-wide: removed all calls to cleanup(), except for the new call
from the traps.
* check_for_updates(): reverted the redirection operator
* build_package(): now uses the volatile SBOPKGTMP directly if/when we
CLEANUP, rather than a volatile subdir in a static SBOPKGTMP.
* cleanup(): changed all the specific deletions of the contents of the
old SBOPKGTMP to a general deletion of the entire new SBOPKGTMP.
Dumped the ALLOW_MULTI stuff since it can't be triggered now (rm -r of
a mktemp vs. a rmdir of an mcookie).
* control_c(): made a comment more specific; made the function a lot
quieter; removed the cleanup/exit parts now trapped.
* main: added traps; assigned to SBOPKGTMP internally with a mktemp
invocation that respects TMPDIR and moved up all SBOPKGTMP variables
that had to wait on sourcing the config file since they no longer have
to wait for that.
Unrelated changes that I tripped over along the way:
* pid_check(): combine PIDFILE declaration and assignment and shorten
comment.
* info_item(): changed use of filenames to use of variables.
* sync_repo(): made an error condition exit 1 rather than 0.
* get_source(): changed PIDLIST to SBOPKG_PIDLIST like it is elsewhere.
* pick_file(): establish a RETURN trap to clean out files which are now
referred to by variables rather than semi-random deletions of files
referred to by filenames.
* process_queue(): now moves the built package from the tmpdir before
installing rather than after so people's PACKAGE LOCATION lines aren't
screwed up in their package db.
* main: combined a command and exit status check into the one 'if'. Also
changed some more filenames to vars and removed two that didn't need
to be declared there. (They can be local to their functions since r831
or so.)
Added check_cert_prompt() which is called from get_source() which
prompts the user to append '--no-check-certificate' to WGETFLAGS if it
is not already present, and tries again. Previously, this was handled by
changing WGETFLAGS manually (which is still possible) but this handles
it interactively on a case by case basis and may help new users who
aren't aware that modifying WGETFLAGS would be a solution. Thanks to
Chess and Mauro for review and suggestions.
Created parse_arguments() and modified main to call it and use_options()
to use the results. Updated the man page to reflect the changes.
Also caught up on the ChangeLog.
Previously, the user had to quote multiple arguments to a single flag.
This is still possible but now there's the option of using the flags
multiple times with a single arg to each with no quoting.
* search_package(): modified to return a sorted list
* gen_search_package(): moved my select menu to the new function.
* search_and_display(): new function which takes one or more arguments
(literal or quoted globs) from the command line (-s) and uses
search_package() to return an array of possible matches. If more than
one app is returned, it presents the user with a menu. It displays the
standard files associated with the app the user chooses. If
search_package() only returns one app, it displays the associated
files immediately. Despite being a new function, this merely restores
old functionality (albeit somewhat improved) which had been broken.
* main: moved the old code from the SEARCH test block to the new
function, replacing it with a call to that function.
* main: temporarily disabled pathname expansion in part of the GENSEARCH
test block (and in part of the new function) so it wouldn't break if
someone searched for 'fu*' with a 'fubar' file in the current
directory.
Also modified the man page and one comment regarding details of these
flags/functions.
This broke out a sed line used in a couple of places (and which needed
to be extended) into a commented function. This specifically addresses
dzen2, as well as the zarafa problems found while dealing with dzen2.
Also tightened up a regex that caused problems while dealing with
similar quirks. Also modified comments in these areas.
Note that virtualbox (no longer a problem) and calcurse (now
specifically handled) were handled by two generic substitution commands,
which have been removed. If these commands were catching things besides
virtualbox and calcurse, this will cause a regression but it's not
considered likely; it will let us know what *needs* to be fixed; and it
should be easy to do so.
Brought the error_read() calls more into conformance with standard
'read's. Two items still differ significantly: since the 'read' is in
error_read() and must handle a variety of prompts, prompts are done
before the call with 'printf's and since error_read is restricted to Y/N
values, the prompts have to use those for at least two of their options.
* error_read(): modified comments to reflect current status. Made read
use '-e' like the rest of the reads. Got rid of the '$1's and 'eval's
and used a simple assignment to REPLY. While the "(as specified with
'-e')" echo should never happen unless ON_ERROR was set to
stop/continue, it's still better to assign it to a variable tied
directly to where it's supposed to occur.
All direct uses of the 'read' builtin are now close to the following
format: possibly a block of statement text to the user output by
whatever means are handiest then, if not an 'anykey' prompt, a loop
which prompts and checks for valid input. The prompt is generally a
concise line in the forms of
read -p "(A)pples or (O)ranges?: "
read -n1 -p "Press any key to continue: "
Then a case statement handles the input in the format:
A|a) apple_action ;;
O|o) orange_action ;;
*) unknown_response ;;
Also misc minor changes such as modifying wording or option letters,
changing linebreaks in case statements, etc.
Beyond simple wording changes in the statement text, there was also:
* remove_files(): removed the 'echo -e foo\n' which seemed unnecessary.
* use_options(): added the SAVEDOPT and QUEUEOPT variables which are
used in read's prompt to customize it to the nature of the actually
possible choices and removed the 'else's we don't need to display.
* do_install(): moved a revised form into install_package(), removing
this one.
* install_package(): tried to make sure we local-ized all the vars we
need; saved two variables and two stat calls with one find; put a
missing loop around our read prompt; made the key line the argument of
read's -p flag; put the breaks and returns in the right places; and,
in terms of what was brought in from do_install(): removed the unused
loop from around the rename check and upgradepkg call; modified
variables to use install_package()s and dequoted the surviving
PKG_NAME.
Now we write changes to */src/usr/doc/ChangeLog.txt and generate
*/tools/ChangeLog-latest.txt. User visible changes since the last
release were added to the former.
Also re-added a re-re-rename that SBo keeps waffling about. ;)
* unknown_response(): new function to specify calling function and
unknown input in the error message.
* any functions with '{error_,}read's in them: replaced 'local ANS/read
ANS/case $ANS' with 'local REPLY/read/case $REPLY' and all '*) Unknown
response' with '*) unknown_response'.
* several functions: added missing 'local REPLY'
* get_source(): removed stale 'ANS'
* read_info(): reformatted case statement
Also made two other probably unnecessary changes to help with hunting an
elusive bug.
* error_read(): modified to loudly bomb out if it's somehow acquired an
impossible value.
* main: modified ON_ERROR so it's even more impossible for it to get the
wrong value.
Previously, the user was confronted with 7 prompts for directory
creation on first run to which they could hit enter or ^C in response.
The main purpose of this revision is to provide a nice printout and a
single question to which they can hit 'y/n'.
This led to a cascade of changes but it's all focused on establishing
sbopkg's needed directories and even results in fewer loc.
* directory_checks(): replaced with dir_init()
* config_check(): the ALLOW_MULTI check there was creating a directory
rather than checking the config, so moved it to dir_init(). Also made
the directory creation non-interactive since it's only creating a
tmpdir in an already-created sbopkg directory.
* sync_repo(): moved the directory_check() call to select_repository()
since being able to switch repos mid-run in the dialog
select_repository() interface is the direct (and only) reason for
calling dir_init() after startup. Removed the check_write() call and
all the rest related to it as it was no longer needed.
* select_repository(): aside from gaining the item just mentioned, the
'save setting' dialog was wrapped in a conditional based on whether
the user actually chose to create the new repo dir.
* ck_dir(): removed. The seven calls in directory_checks() went with
that function and the one in config_check() was also removed, since
it's now handled by dir_init() non-interactively, leaving it unused.
* check_write(): removed. The single call from sync_repo() was removed,
as discussed above, leaving it unused.
* pid_check(): now does a quick check for ALLOW_MULTI, making that a black
box that does the right thing.
* main: as just mentioned, the ALLOW_MULTI check was moved into
pid_check(). ALLOW_MULTI already gets special treatment in cleanup()
and did in config_check() and does in dir_init(), so it might as well
in pid_check() rather than being tested for in main. And, of course,
replaced the directory_checks() call with one to dir_init().
Modified all parameter expansions to use default values.
Also tweaked some wording and spacing and fixed an sbopkg-breaking typo
from the last commit of this file.
Replaced variable data with 'xxxDATAxxx' tags. The tags are replaced by
the revised release script. This way, only that file needs to have,
e.g., 'size' changed and it will propagate to the README and both
manpages, rather than requiring three separate edits. Also, sbopkg.conf
and sbopkg.conf(5) will always automatically be in sync.
Also shortened how we test for whether DEBUG(_UPDATES) is 0,1,2 and made
DEBUG_UPDATES use default values if unset, rather than being set
directly to a default value.
This entire variable may be removed shortly but, until then, there's
this.
In HACKING, I moved two points, modified two points, moved and modified
one point, and added two points. I also separated all points with a
blank line as is consistent with the first list in the file.
In both man pages, I shortened most 'SlackBuilds.org' references to
'SBo'; shortened most 'SlackBuild scripts' references to 'SlackBuilds';
added some missed root prompt symbols; and added a few missed .Bs and
.Is or flipped a wrong one for the right one.
In sbopkg.conf.5, I added 'simultaneously' in ALLOW_MULTI; revised a
line in KEEPLOG, and one in LOGFILE; and flipped a couple of
inconsistent .PP/.RS pairs to .RS/.PP.
In sbopkg.8, I added a comma in a list; redid a sequence of bold/roman
in the '-e' arg list; changed 'another configuration file' to 'FILE';
and flipped the out-of-order -r/-R flags.
Started a sentence on another sentence's line in sbopkg.conf(5) and left
a separator at double lines when it should have been changed to single
in sbopkg(8).
Also added several more points to HACKING which cover most of the other
changes - there are a few semantic/textual changes in here, too. The
largest changes are probably a making the 'type' of the conf values a
part of the 'template', moving and adding complete authors to both
The revision removes LOGDIR from sbopkg, sbopkg.conf.new, and
sbopkg.conf(5) and adds the previously missing LOGFILE value to
sbopkg.conf(5). Now, with a test for a setting to absolute path, we use
the dirname of LOGFILE rather than LOGDIR.
This makes all config file values be rendered the same way, with the entire
line in its own paragraph, which is set to fixed-width font (for postscript
output) and shortens and simplifies the intro line in keeping with the
whole-line consistency.
Also corrected one point in HACKING relevant to earlier revisions and
added three more points relevant to this one. However, the vast majority
of changes in this revision don't fall under those three points or any
easily generalizable description. They're just attempts at more clarity,
consistency, accuracy, etc. Oh, and some punctuation, too.