| Commit message (Collapse) | Author | Age |
|\
| |
| |
| |
| |
| |
| | |
* upstream:
fix(bug) Handle diverted files correctly
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
| |
| |
| |
| |
| |
| |
| | |
The argument to dpkg-divert needs to be the actual file name, not the
fully escaped regexp safe one.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So this is something, one I didn't know about:
In bash and dash,
var=$(something)
works as expected even if that ``something`` contains spaces, like in
var=$(date '+%F %T')
Things are however different in dash if you're within a function and
want to limit the scope, i.e.
local var=$(date '+%F %T')
Quite frankly, I haven't checked which shell implementation does not
follow the specification, if any, or if this is just another bashism.
Quoting fixes this
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
| |
while ucf should not alter the attributes of the file if the
destination exists (the maintainer can do anythjing she wants after
ucf is done), when there is no destination copy the permissions from
the source.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
| |
There have been no dependencies on bash in ucf for ages. Just changed
the shebang line.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
| |
When a configuration file managed by ucf is diverted (using dpkg-divert),
ucf attempts to modify the original path for the conffile, rather than the
diverted path.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
| |
Currently ucf does not support creating the destination files with
the correct SELinux type. This pull adds that.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
| |
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit fixes a bug wyhere ucf did not preserve configuratrion
file attributes if three way merges were chosen by the user.
Apart from that, there are minor improvements, like adding
UCF_CONFFILE_OLD and UCF_CONFFILE_NEW to the inferior shell created by
ucf.
Closes: Bug#935439, Bug#930130, Bug#892301
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
| |
This commit redirects verbose diagostic messages to STDERR, and thus
no longer confuses debconf.
Closes: Bug#762857
Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
|
|
|
|
|
|
|
|
|
|
|
| |
ucf's use of a hard-coded path for its debconf templates file is
incompatible with multiarch, which will create arch subdirectories and
store its state there. As a result, debootstrapping a system using a
multiarch-enabled dpkg now fails, since rsyslog uses ucf
Closes: 615931
Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
|
|
|
|
| |
Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
|
|
|
|
|
|
|
|
| |
No longer test for $?
closes: Bug#633001
Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
|
|
|
|
| |
Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ucf fails with error code 20 when VERBOSE is set to 1 in
/etc/ucf.conf. Actually it is debconf's /usr/share/debconf/confmodule
which fails and subsequently topples ucf. The problem seems to be,
that some of the messages in ucf are written to stdout instead of
stderr, which confuses confmodule's function _db_cmd when reading
_db_internal_line. I believe the same is true when DEBUG is set > 0 in
ucf.conf, but I had no time to test it in more detail.
Fix thanks to Aljoscha Lautenbach <aljoscha.lautenbach@gmail.com>
Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
|
|
|
|
|
|
|
| |
This takes into account the $PAGER variable.
close: Bug#596452
Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
|
|
|
|
|
|
|
|
| |
Closes: Bug#574266
Fix thanks to Aaron Hope <asbestos@xemed.com>
Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fix is one that was first implemented in Ubuntu, and has only been
lightly modified. The problem was the handling of merge failures in three
way merges, ucf used to just pass the error through to the maintainer
script, and so a merge failure resulted in a maintainer script failure,
which could cascade in a upgrade. However, trapping the error, and
showing it via debconf, and then returning to the ucf debconf menu allows
users to resolve this issue as they please.
This patch implements that.
Signed-off-by: Steve Langasek <vorlon@debian.org>
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When there is no tty present (which means we cannot attach to the
keyboard), and there is no DISPLAY set, which means we cannopt fire off
another window, we cannot fork off a shell. This is not a bug, really,
but merely a reality. This patch sleeps for a couple of seconds so that
the error message we dump on STDERR can be read.
Closes: #543367
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
| |
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
|
| |
Also, allow the three way merge options whenever there is a stashed
version of the file, whether or not the package maintainer has explicitly
asked for a three way capability. This way, are closer to making three
way capabilities the default, except for large configuration files, where
large is defined as 25 KB.
Signed-Off-By: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
| |
Also, only run bash directly is the script has a terminal
backend. Failing that, if DISPLAY is set, try to start a terminal
emulator. If there is no tty and no DISPLAY, gibber and do nothing.
Signed-Off-By: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
|
|
| |
This way, when the script is called again under debconf, the command line
arguments are still around, and have not been eliminated during
parsing. And no, getopt was notto blame, ucf was nuking the commandline
itself.
closes: Bug#520073
Signed-Off-By: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until 3.0012, ucf/show_diff was reset just before showing
it to the user. This would unset the 'seen' flag properly.
However, moving the db_reset call after db_input made the
latter skip the note on the first time if the 'seen' flag
was already set.
To make things worse, Debconf::ConfModule::finish()
sets the 'seen' flag for all the questions it has handled
before exiting, so the flag was always true after debconf
exited.
Simply unsetting the flag before db_input fixes this.
Closes: Bug#514071
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
> reset diff question after use so contents are not written to disk
Unfortunately this is not enough (or even needed): the sensitive
data is not stored in the value of ucf/show_diff, but in the DIFF
variable associated with it.
Closes: Bug#511893
Author: Niko Tyni <ntyni@debian.org>
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
|
| |
Although the 'type' command is used by /usr/bin/ucf, a 'type' built-in
command cannot be used by posh. It is safer to use '/bin/which' contained
in debianutils.
Closes: Bug#513755
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
| |
Also, since we do not have two arguments when we are purging, move the
new file processing to after the point where we exi in purge mode.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
| |
If it is done earlier, the DEBCONF_OK flag is not set yet. This is
majorly bad. Closes: Bug#512832, Bug#512905
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
| |
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
| |
If ucf is called without the --debconf-ok switch, and debconf is started,
issue a diagnostic, and use old style promping on the command line. This
is a olicy violation, and soon the non-debconf prompting shall be removed.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
|
|
| |
ucf, even if is called without --debconf-ok, uses debconf and hangs if
db_stop had been already called, since it tries to load
/usr/share/debconf/confmodule and loads the ucf debconf templates. This
is a minimal change, and just moves the test of DEBCONF_OK earlier.
Closes: Bug#511031
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Debconf does not use world readable "temporary internal files" as Manoj
hypothesises. Data is only written to disk if it is left in the debconf
database when the frontend (ucf) exits.
Tightening the permissions on the debconf database would break several
things including use of debconf-show in reportbug.
From 27b3c41c531016ffa506987bf4a856345992a204 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@gnu.kitenet.net>
Date: Wed, 21 Jan 2009 13:03:55 -0500
Subject: [PATCH] reset diff question after use so contents are not written to disk
Closes: Bug#511893 (ucf stores diff (of private files) in debconf
(world readable))
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
| |
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
| |
With large output of diff or sdiff, the pipe buffers used to
communicate with debconf fill up. So now we limit the maximu size to
jusr under 100k. Also, we were unable to handle whitespace only
differences (which show up empty); this change fixes that too.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
|
|
|
|
|
|
|
|
|
|
| |
When three-way merging has a conflict and diff3 exits with a non-zero
status, the postinst exits immediately as "set -e" is in effect.
The attached trivial patch fixes this so that the conflict error message
gets printed instead. Thanks to Niko Tyni.
git-archimport-id: srivasta@debian.org--lenny/ucf--devel--3.0--patch-5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a command line option to specify an alternate, caller provide debconf
template to use for prompting. Use db_metaget _template Choices-C to see
if the new template should be used.
Also, use db_x_loadtemplatefile to load our default templates, in case
the debconf DB had become corrupted. This means we can stop using
debconf-loadtemplate, which was of a lower priority anyway.
In case of three way merge, exit with an error if the merge failed.
--This line, and those below, will be ignored--
Files to commit:
ucfq
ucf.1
ucf
ChangeLog
This list might be incomplete or outdated if editing the log
message was not invoked from an up-to-date changes buffer!
git-archimport-id: srivasta@debian.org--lenny/ucf--devel--3.0--patch-4
|
|
|
|
|
|
|
|
|
|
|
| |
For "keep current" and "threeway merge", ucf expects answers from debconf
which differ from what is specified in the template master. Frans Pop
suggested using the Choices-C feature of debconf, which is relatively
new, but defines a fixed alias for each option which Debconf will then
use in db_get and db_set operations -- so no more matching the template
in the code. closes: #443179, #449274, #453084
git-archimport-id: srivasta@debian.org--lenny/ucf--devel--3.0--patch-2
|
|
|
|
|
|
|
|
|
|
|
|
| |
The template (and some of the questions) have been changed; make ucf
itself reflect that.
* ucf (choice_keep_current): Change the name to fit the changed template
(choice_diff_threeway): Ditto
Closes: Bug#443179
git-archimport-id: srivasta@debian.org--lenny/ucf--devel--3.0--patch-1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Users using a Graphical frontend are surprised when the display apparently
just blocks when they ask to see a diff (or 3-way diff) of the
configuration file being handled, when actually the diff is displayed on
the terminal window ucf was run on. Until the debconf-escape utility and
the escape CAPB support, db_subst ran into newline and line length
issues. Patch from Michael Vogt.
Closes: Bug#325576
* ucf (show_diff): Added a function to show the diff using debconf
* ucf (newsum): Use it
git-archimport-id: srivasta@debian.org--lenny/ucf--devel--2.0--patch-2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ucf: As far as possible, preserve file attributes like ownership and
permission by using cp -pf instead of just cp -f.
* ucf.1: Document that ucf now tries to preserve owner/permission bits
for the file.
* ucfq.1: Typo fix postinst-->postrm
* examples/postrm: Now ucf creates .ucf-new, .ucf-old, and .ucf-dist
suffixes, so the example is updated to clean the new names.
git-archimport-id: srivasta@debian.org--lenny/ucf--devel--2.0--patch-1
|
|
|
|
|
|
|
|
|
| |
* ucf.1: Typo fix
* ucf: Typo fix
git-archimport-id: srivasta@debian.org--etch/ucf--devel--2.0--versionfix-1
|
|
|
|
|
|
|
|
|
| |
* ucf (TEMP): Use readlink to canonicalize the path names presented to
ucf. This ensures that we keep track of information about the correct
file in ucf, even if it is referred to differently (like, multiple
///s, or a/../a/)
git-archimport-id: srivasta@debian.org--etch/ucf--devel--2.0--patch-18
|
|
|
|
|
|
|
|
|
|
| |
* ucf (safe_dest_file): Improve the handling of finding a sensible
pager. This now handles a messed up /etc/alternatives/paper
setting. Also included sensible pager as an alternative, and fall back
to /bin/more if needed.
(choice_shell): Cater to readlink failures.
git-archimport-id: srivasta@debian.org--etch/ucf--devel--2.0--patch-13
|
|
|
|
|
|
|
|
| |
* ucf (safe_dest_file): mention that we are setting the source directory
for verbose output.
git-archimport-id: srivasta@debian.org--etch/ucf--devel--2.0--patch-12
|
|
|
|
|
|
|
|
| |
* ucf (safe_dest_file): Use Perl \Q\E mechanisms instead of sed to create
a safer version of the file name to use in grep.
git-archimport-id: srivasta@debian.org--etch/ucf--devel--2.0--patch-11
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ucf (DIST_SUFFIX): Added a new variable to hold the suffix we use to
denote the maintainers version of a ucf handled file. Used to be
dpkg-dist, is now ucf-dist.
(NEW_SUFFIX): Added a new variable to hold the suffix we use to denote
the new version of the file. Used to be dpkg-new, is now ucf-new.
(OLD_SUFFIX): Added a new variable to hold the suffix we use to denote
the old version of the file. Used to be dpkg-old, is now ucf-old.
git-archimport-id: srivasta@debian.org--etch/ucf--devel--2.0--patch-8
|
|
|
|
|
|
|
|
|
|
|
| |
* ucf: Allow ucf to be run as non-root. This entailed not loading debconf
related stuff, since that seems to require root privileges. Instead, we
just emit a diagnostic and go on. Hopefully this is enough to let the
user know when debconf does not work as expected. Also, if ucf is not
running as root, automatically transition into the no-action mode, so a
non-root user can still be able run ucf in diagnostic mode.
git-archimport-id: srivasta@debian.org--etch/ucf--devel--2.0--patch-7
|
|
|
|
|
|
|
|
| |
* ucf: Added support for side-by-side diffs, This is very similar to
doing a standard diff, apart from calling sdiff instead (and change the
option switches around as needed.
git-archimport-id: srivasta@debian.org--etch/ucf--devel--2.0--patch-5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ucf.1: Document UCF_FORCE_CONFFMISS. This environment variable is only
applicable when the installed destination file does not exist (perhaps
due to user removal),and forces ucf to recreate the missing file (the
default behaviour is to honor the users wishes and not recreate the
locally deleted file).
* ucf: Add code to determine the value of UCF_FORCE_CONFFMISS, looking at
the command line, env variable, config file, or default (the default
being unset). No command line option is currently available, but the
underpinning are there. Replace the destination file, if missing, and
iff the variable is set.
git-archimport-id: srivasta@debian.org--etch/ucf--devel--2.0--patch-2
|
|
|
|
|
|
|
|
|
|
| |
* ucf (safe_dest_file): Well, setting VERBOSE to 0 is the same as being
quiet, according to the man page. Unfortunately, the code actually
looked to see if VERBOSE was set (even if set to 0). Now, we unset
VERBOSE if the user had set it to 0, making everyone happy.
git-archimport-id: srivasta@debian.org--etch/ucf--devel--2.0--patch-1
|