Complementary to 1127 on integration side

This commit is contained in:
Carlos Nihelton 2021-11-17 13:26:41 -03:00
parent 6a970ccd41
commit 1e6c4472a5
2 changed files with 14 additions and 8 deletions

View File

@ -82,7 +82,7 @@ validate () {
echo "expected not empty directory var/cache/apt/archives/"
exit 1
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"
exit 1
fi

View File

@ -143,11 +143,6 @@ class ConfigureController(SubiquityController):
return False
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()
if self.app.opts.dry_run:
packs_dir = os.path.join(self.model.root,
@ -155,17 +150,28 @@ class ConfigureController(SubiquityController):
.find_dir("Dir::Cache::Archives")[1:])
os.makedirs(packs_dir, exist_ok=True)
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:
# Just write the package uri to a file.
archive = os.path.join(packs_dir, cache[package].fullname)
with open(archive, "wt") as f:
f.write(cache[package].candidate.uri)
return True
except IOError:
log.error("Failed to write %s file.", archive)
return False
return True
cache.update()
cache.open(None)
with cache.actiongroup():