gen-preseed always errors
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
installation-report (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
In this code:
```
# A bit of a hack..
my $di_path;
if (-d "/var/log/
$di_
} else {
$di_
}
if (! -f "$di_path") {
print("Unable to find debconf database: $di_path\n");
exit(1);
}
Debconf:
$Debconf:
driver => "File",
name => "di_questions",
filename => "$di_path/
readonly => "true",
);
```
If `cdebconf` is a directory, the second `if` is true and the script exits with "Unable to find debconf database". Yet the `makedriver` instance(s) require `$di_path` to be set to a directory name (which contains files such as `questions.dat`.
If `cdebconf` is a file then the `! -f` test passes and `makedriver` tries to use a filename as a directory name and errors with a "could not open" message.
If `cdebconf` doesn't exist, then the `-! -f` test does the right thing.
In each of those cases, the script is exited and the remainder never runs.
To fix this issue, the test should be changed from `! -f` to `! -d`:
```
if (! -d "$di_path") {
print("Unable to find debconf database: $di_path\n");
exit(1);
}
```
As seen in Bionic and other releases.
```$ apt-cache policy installation-report
installation-
Installed: 2.62ubuntu1
```