[Piuparts-devel] Bug#825487: Bug#825487: Patch

Andreas Beckmann anbe at debian.org
Thu Jun 2 09:02:59 UTC 2016


Hi Sean,

thanks for your patch!

> +            tmp_files = [os.path.join("./tmp", name) for name in
tmp_files]

Can't we use just an absolute path? /tmp?

> +            apt_get_install = ["apt-get", "-y", "--allow-downgrades"]

NACK as said by Holger.
Testing reinstalls this way does not seem to be a valid usecase.
An option might enable this though.

>              apt_get_install.extend(settings.distro_config.get_target_flags(
>                  os.environ["PIUPARTS_DISTRIBUTION"]))
>              apt_get_install.append("install")
> @@ -1174,18 +1181,12 @@ class Chroot:
>              if settings.list_installed_files:
>                  pre_info = self.save_meta_data()

> -            (ret, out) = self.run(["dpkg", "-i"] + tmp_files, ignore_errors=True)

We need to keep the dpkg code for older releases,
so we need to have either an option that there is a new apt
(or better better a test whether we have apt >= 1.2 (is that the correct
version?))

> -            if settings.list_installed_files:
> -                self.list_installed_files(pre_info, self.save_meta_data())

That breaks some options that are not frequently used, not sure how to
solve this.

> -
> -            self.run(apt_get_install)
> +            self.run(apt_get_install + tmp_files)
>  
>              if settings.list_installed_files:
>                  self.list_installed_files(pre_info, self.save_meta_data())


disregarding the list_installed_files bits (or maybe continue using dpkg
for them in any case) it should roughly look like this:

if (apt_get_can_install_debs) {
    apt-get -y install the.deb
} else {
    dpkg -i the.deb
    apt-get -y install
}


Andreas



More information about the Piuparts-devel mailing list