Debian Bug report logs - #379474
debconf-copydb: fails, "source does not exist"

version graph

Package: debconf; Maintainer for debconf is Debconf Developers <[email protected]>; Source for debconf is src:debconf (PTS, buildd, popcon).

Reported by: Eduard Bloch <[email protected]>

Date: Sun, 23 Jul 2006 21:18:02 UTC

Severity: normal

Found in version debconf/1.5.2

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Debconf Developers <[email protected]>:
Bug#379474; Package debconf. (full text, mbox, link).


Acknowledgement sent to Eduard Bloch <[email protected]>:
New Bug report received and forwarded. Copy sent to Debconf Developers <[email protected]>. (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Eduard Bloch <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: debconf-copydb: fails, "source does not exist"
Date: Sun, 23 Jul 2006 22:34:26 +0200
Package: debconf
Version: 1.5.2
Severity: normal

Hello,

I was going to setup a new chroot and this time I decided to look for a
better way than "cp" to get the database over to the new ___location. So I
found the debconf-copydb utility which seems to do the job. After RTFM I
tried:

debconf-copydb /var/cache/debconf/config.dat var/cache/debconf/config.dat
/usr/bin/debconf-copydb: source database, "/var/cache/debconf/config.dat" does not exist

Uhm, what am I doing wrong? The database file does exist and I think it
is exactly what the manpage talks about. So either there is a program
bug (as demonstrated) or a documentation problem, or both ("does not
exist" is not correct after all).

Eduard.


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17.6
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages debconf depends on:
ii  debconf-i18n                  1.5.2      full internationalization support 
ii  perl-base                     5.8.8-6    The Pathologically Eclectic Rubbis

Versions of packages debconf recommends:
ii  apt-utils                     0.6.44.2   APT utility programs

-- debconf information:
  debconf-apt-progress/title:
  debconf-apt-progress/info:
* debconf/priority: medium
  debconf-apt-progress/preparing:
* debconf/frontend: Dialog



Information forwarded to [email protected], Debconf Developers <[email protected]>:
Bug#379474; Package debconf. (full text, mbox, link).


Acknowledgement sent to Colin Watson <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <[email protected]>. (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Colin Watson <[email protected]>
To: Eduard Bloch <[email protected]>, [email protected]
Subject: Re: Bug#379474: debconf-copydb: fails, "source does not exist"
Date: Mon, 7 Aug 2006 16:55:28 +0100
On Sun, Jul 23, 2006 at 10:34:26PM +0200, Eduard Bloch wrote:
> I was going to setup a new chroot and this time I decided to look for a
> better way than "cp" to get the database over to the new ___location. So I
> found the debconf-copydb utility which seems to do the job. After RTFM I
> tried:
> 
> debconf-copydb /var/cache/debconf/config.dat var/cache/debconf/config.dat
> /usr/bin/debconf-copydb: source database, "/var/cache/debconf/config.dat" does not exist
> 
> Uhm, what am I doing wrong? The database file does exist and I think it
> is exactly what the manpage talks about. So either there is a program
> bug (as demonstrated) or a documentation problem, or both ("does not
> exist" is not correct after all).

As it stands it's a documentation problem, but it might be possible to
educate debconf to do the right thing in this case anyway.

debconf-copydb (and all other places in debconf's command-line interface
that accept a database as a parameter) want a database name, not a file
name. Database names are configured in /etc/debconf.conf (etc.) or by
--config parameters. So something like the following would work:

  debconf-copydb olddb newdb \
    --config=Name:olddb --config=Driver:File \
    --config=Filename:/var/cache/debconf/config.dat \
    --config=Name:newdb --config=Driver:File \
    --config=Filename:var/cache/debconf/config.dat

You could abbreviate this by noticing that /var/cache/debconf/config.dat
is already configured in /etc/debconf.conf, so you can just copy the
'config' database without needing to configure it explicitly. In fact,
there's an example quite similar to this in the debconf-copydb(1) man
page. Note that you need to copy the config and passwords databases
separately, or else do more elaborate configuration on the target
databases to make them accept/reject passwords as appropriate.

(cp is a perfectly good way to copy debconf databases, by the way, if
you're already referring to them as files anyway. If you're referring to
them using database names with more elaborate configuration, then
debconf-copydb is certainly useful, but the above doesn't really add any
value over plain cp.)


All that said, it might be possible to make debconf transparently do
something approaching the right thing here. Joey, what do you think of
doing something like this?

Index: Debconf/DbDriver.pm
===================================================================
--- Debconf/DbDriver.pm	(revision 2088)
+++ Debconf/DbDriver.pm	(working copy)
@@ -177,6 +177,17 @@
 	my $this=shift;
 	my $name=shift;
 	
+	if (not exists $drivers{$name} and -e $name) {
+		# Transparently turn filenames into database drivers if
+		# possible.
+		my %config = (
+			name => $name,
+			driver => 'File',
+			filename => $name,
+		);
+		Debconf::Db->makedriver(%config);
+	}
+
 	return $drivers{$name};
 }
 

Cheers,

-- 
Colin Watson                                       [[email protected]]



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Fri May 16 09:38:00 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.