Complementary to 1127 on integration side
This commit is contained in:
parent
6a970ccd41
commit
1e6c4472a5
|
@ -82,7 +82,7 @@ validate () {
|
||||||
echo "expected not empty directory var/cache/apt/archives/"
|
echo "expected not empty directory var/cache/apt/archives/"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ -z "$( diff -Nup .subiquity/etc/locale.gen .subiquity/etc/locale.gen-)" ] ; then
|
if [ -z "$( diff -Nup .subiquity/etc/locale.gen .subiquity/etc/locale.gen.test)" ] ; then
|
||||||
echo "expected changes in etc/locale.gen"
|
echo "expected changes in etc/locale.gen"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -143,11 +143,6 @@ class ConfigureController(SubiquityController):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
packages = [pkg for pkg in cp.stdout.strip().split(' ') if pkg]
|
packages = [pkg for pkg in cp.stdout.strip().split(' ') if pkg]
|
||||||
if len(packages) == 0:
|
|
||||||
log.debug("%s didn't recommend any packages. Nothing to do.",
|
|
||||||
clsCommand)
|
|
||||||
return True
|
|
||||||
|
|
||||||
cache = apt.Cache()
|
cache = apt.Cache()
|
||||||
if self.app.opts.dry_run:
|
if self.app.opts.dry_run:
|
||||||
packs_dir = os.path.join(self.model.root,
|
packs_dir = os.path.join(self.model.root,
|
||||||
|
@ -155,17 +150,28 @@ class ConfigureController(SubiquityController):
|
||||||
.find_dir("Dir::Cache::Archives")[1:])
|
.find_dir("Dir::Cache::Archives")[1:])
|
||||||
os.makedirs(packs_dir, exist_ok=True)
|
os.makedirs(packs_dir, exist_ok=True)
|
||||||
try:
|
try:
|
||||||
|
if len(packages) == 0:
|
||||||
|
message = "{} didn't recommend any packages." \
|
||||||
|
" Nothing to do.".format(clsCommand)
|
||||||
|
log.debug(message)
|
||||||
|
msgFile = os.path.join(packs_dir, "msgFile")
|
||||||
|
with open(msgFile, "wt") as f:
|
||||||
|
f.write(message)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
for package in packages:
|
for package in packages:
|
||||||
# Just write the package uri to a file.
|
# Just write the package uri to a file.
|
||||||
archive = os.path.join(packs_dir, cache[package].fullname)
|
archive = os.path.join(packs_dir, cache[package].fullname)
|
||||||
with open(archive, "wt") as f:
|
with open(archive, "wt") as f:
|
||||||
f.write(cache[package].candidate.uri)
|
f.write(cache[package].candidate.uri)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
except IOError:
|
except IOError:
|
||||||
log.error("Failed to write %s file.", archive)
|
log.error("Failed to write %s file.", archive)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
cache.update()
|
cache.update()
|
||||||
cache.open(None)
|
cache.open(None)
|
||||||
with cache.actiongroup():
|
with cache.actiongroup():
|
||||||
|
|
Loading…
Reference in New Issue