Bug#944684: mmdebstrap: APT list files for /etc/apt/sources.list.d/*.list remain in image

2020-01-06 Thread Johannes Schauer
Hi,

Quoting Benjamin Drung (2020-01-06 11:17:46)
> The bug is that some files in /var/lib/apt/lists/ remain. Example:
> 
> $ mmdebstrap --keyring=/usr/share/keyrings/debian-archive-keyring.gpg \
>   -v --component=main \
>   --setup-hook="echo \"deb http://deb.debian.org/debian buster contrib\" > 
> \"\$1/etc/apt/sources.list.d/example.list\"" \
>   buster /tmp/buster.tar.xz
> $ tar -tf /tmp/buster.tar.xz | grep '/var/lib/apt/lists'
> ./var/lib/apt/lists/
> ./var/lib/apt/lists/deb.debian.org_debian_dists_buster_InRelease
> ./var/lib/apt/lists/deb.debian.org_debian_dists_buster_contrib_binary-amd64_Packages
> ./var/lib/apt/lists/deb.debian.org_debian_dists_buster_contrib_i18n_Translation-en
> ./var/lib/apt/lists/lock
> ./var/lib/apt/lists/partial/
> 
> I expect that these deb.debian.org_debian_dists_buster_* files in
> /var/lib/apt/lists/ are removed.

I agree. You again found a nice corner-case bug. Thanks! :)

The problem here is, that you place stuff into /etc/apt/sources.list.d/. When
cleaning, mmdebstrap passes /dev/null to apt instead of /etc/apt/sources.list,
so that apt will remove everything in /var/lib/apt/lists/ that was before
downloaded due to the content in /etc/apt/sources.list. But mmdebstrap does
*not* overwrite the /etc/apt/sources.list.d/ directory and hence apt will still
keep all the Packages files associated with these lists. That's the effect you
are seeing here. Apt indeed does clean everything except the "buster_contrib"
lists that come from /etc/apt/sources.list.d/. Gladly the fix is simple.

Thanks!

cheers, josch


signature.asc
Description: signature


Bug#944684: mmdebstrap: APT list files for /etc/apt/sources.list.d/*.list remain in image

2020-01-06 Thread Benjamin Drung
Am Mittwoch, den 20.11.2019, 09:35 +0100 schrieb Johannes Schauer:
> Hi,
> 
> Quoting Benjamin Drung (2019-11-13 19:39:32)
> > Am Mittwoch, den 13.11.2019, 19:25 +0100 schrieb Johannes Schauer:
> > > Quoting Benjamin Drung (2019-11-13 19:22:14)
> > > > mmdebstrap fails to remove all APT list files at the cleanup
> > > > stage.
> > > > APT
> > > > list files for /etc/apt/sources.list.d/*.list remain in image.
> > > > You
> > > > can
> > > > reproduce it by running:
> > > > 
> > > > mmdebstrap --keyring=/usr/share/keyrings/debian-archive-
> > > > keyring.gpg 
> > > > \
> > > >   -v --component=main \
> > > >   --setup-hook="echo \"deb http://deb.debian.org/debian $suite
> > > > contrib\" > \"\$1/etc/apt/sources.list.d/example.list\""
> > > >   buster /tmp/buster.tar.xz
> > > > 
> > > 
> > > why do you think this is a bug?
> > 
> > Since mmdebstrap echos "cleaning package lists and apt cache..."
> > and
> > runs
> > 
> >apt-get --option Dir::Etc::SourceList=/dev/null update
> > 
> > Running 'rm -rf "$0/var/lib/apt/lists/"*' in a customize hook has
> > no effect.
> 
> yes, /etc/apt/sources.list.d/*.list files remain in the image.
> 
> files in /var/lib/apt/lists/ get purged by running "apt-get --option
> Dir::Etc::SourceList=/dev/null update".
> 
> Where is the bug?

The bug is that some files in /var/lib/apt/lists/ remain. Example:

$ mmdebstrap --keyring=/usr/share/keyrings/debian-archive-keyring.gpg \
  -v --component=main \
  --setup-hook="echo \"deb http://deb.debian.org/debian buster contrib\" > 
\"\$1/etc/apt/sources.list.d/example.list\"" \
  buster /tmp/buster.tar.xz
$ tar -tf /tmp/buster.tar.xz | grep '/var/lib/apt/lists'
./var/lib/apt/lists/
./var/lib/apt/lists/deb.debian.org_debian_dists_buster_InRelease
./var/lib/apt/lists/deb.debian.org_debian_dists_buster_contrib_binary-amd64_Packages
./var/lib/apt/lists/deb.debian.org_debian_dists_buster_contrib_i18n_Translation-en
./var/lib/apt/lists/lock
./var/lib/apt/lists/partial/

I expect that these deb.debian.org_debian_dists_buster_* files in
/var/lib/apt/lists/ are removed.

-- 
Benjamin Drung

System Developer and Debian & Ubuntu Developer
Platform Engineering Compute (IONOS Cloud)

1&1 IONOS SE | Greifswalder Str. 207 | 10405 Berlin | Germany
E-mail: benjamin.dr...@cloud.ionos.com | Web: www.ionos.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 24498
Vorstand: Dr. Christian Böing, Hüseyin Dogan, Hans-Henning Kettler,
Matthias Steinberg, Achim Weiß
Aufsichtsratsvorsitzender: Markus Kadelke
Member of United Internet


signature.asc
Description: This is a digitally signed message part


Bug#944684: mmdebstrap: APT list files for /etc/apt/sources.list.d/*.list remain in image

2019-11-20 Thread Johannes Schauer
Hi,

Quoting Benjamin Drung (2019-11-13 19:39:32)
> Am Mittwoch, den 13.11.2019, 19:25 +0100 schrieb Johannes Schauer:
> > Quoting Benjamin Drung (2019-11-13 19:22:14)
> > > mmdebstrap fails to remove all APT list files at the cleanup stage.
> > > APT
> > > list files for /etc/apt/sources.list.d/*.list remain in image. You
> > > can
> > > reproduce it by running:
> > > 
> > > mmdebstrap --keyring=/usr/share/keyrings/debian-archive-keyring.gpg 
> > > \
> > >   -v --component=main \
> > >   --setup-hook="echo \"deb http://deb.debian.org/debian $suite
> > > contrib\" > \"\$1/etc/apt/sources.list.d/example.list\""
> > >   buster /tmp/buster.tar.xz
> > > 
> > 
> > why do you think this is a bug?
> 
> Since mmdebstrap echos "cleaning package lists and apt cache..." and
> runs
> 
>apt-get --option Dir::Etc::SourceList=/dev/null update
> 
> Running 'rm -rf "$0/var/lib/apt/lists/"*' in a customize hook has no effect.

yes, /etc/apt/sources.list.d/*.list files remain in the image.

files in /var/lib/apt/lists/ get purged by running "apt-get --option
Dir::Etc::SourceList=/dev/null update".

Where is the bug?

Would you have expected that package lists remain in the result? Would you have
expected that sources lists get removed?

Thanks!

cheers, josch


signature.asc
Description: signature


Bug#944684: mmdebstrap: APT list files for /etc/apt/sources.list.d/*.list remain in image

2019-11-13 Thread Benjamin Drung
Am Mittwoch, den 13.11.2019, 19:25 +0100 schrieb Johannes Schauer:
> Hi,
> 
> Quoting Benjamin Drung (2019-11-13 19:22:14)
> > mmdebstrap fails to remove all APT list files at the cleanup stage.
> > APT
> > list files for /etc/apt/sources.list.d/*.list remain in image. You
> > can
> > reproduce it by running:
> > 
> > mmdebstrap --keyring=/usr/share/keyrings/debian-archive-keyring.gpg 
> > \
> >   -v --component=main \
> >   --setup-hook="echo \"deb http://deb.debian.org/debian $suite
> > contrib\" > \"\$1/etc/apt/sources.list.d/example.list\""
> >   buster /tmp/buster.tar.xz
> > 
> 
> why do you think this is a bug?

Since mmdebstrap echos "cleaning package lists and apt cache..." and
runs

   apt-get --option Dir::Etc::SourceList=/dev/null update

Running 'rm -rf "$0/var/lib/apt/lists/"*' in a customize hook has no
effect.

-- 
Benjamin Drung

Debian & Ubuntu Developer
Platform Engineering Compute (Enterprise Cloud)

1&1 IONOS SE | Greifswalder Str. 207 | 10405 Berlin | Germany
E-mail: benjamin.dr...@cloud.ionos.com | Web: www.ionos.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 24498
Vorstand: Dr. Christian Böing, Hüseyin Dogan, Hans-Henning Kettler,
Matthias Steinberg, Achim Weiß
Aufsichtsratsvorsitzender: Markus Kadelke
Member of United Internet


signature.asc
Description: This is a digitally signed message part


Bug#944684: mmdebstrap: APT list files for /etc/apt/sources.list.d/*.list remain in image

2019-11-13 Thread Johannes Schauer
Hi,

Quoting Benjamin Drung (2019-11-13 19:22:14)
> mmdebstrap fails to remove all APT list files at the cleanup stage. APT
> list files for /etc/apt/sources.list.d/*.list remain in image. You can
> reproduce it by running:
> 
> mmdebstrap --keyring=/usr/share/keyrings/debian-archive-keyring.gpg \
>   -v --component=main \
>   --setup-hook="echo \"deb http://deb.debian.org/debian $suite contrib\" > 
> \"\$1/etc/apt/sources.list.d/example.list\""
>   buster /tmp/buster.tar.xz
> 

why do you think this is a bug?

Thanks!

cheers, josch


signature.asc
Description: signature


Bug#944684: mmdebstrap: APT list files for /etc/apt/sources.list.d/*.list remain in image

2019-11-13 Thread Benjamin Drung
Package: mmdebstrap
Version: 0.5.1-2
Severity: normal

Hi,

mmdebstrap fails to remove all APT list files at the cleanup stage. APT
list files for /etc/apt/sources.list.d/*.list remain in image. You can
reproduce it by running:

mmdebstrap --keyring=/usr/share/keyrings/debian-archive-keyring.gpg \
  -v --component=main \
  --setup-hook="echo \"deb http://deb.debian.org/debian $suite contrib\" > 
\"\$1/etc/apt/sources.list.d/example.list\""
  buster /tmp/buster.tar.xz

-- 
Benjamin Drung

Debian & Ubuntu Developer
Platform Engineering Compute (Enterprise Cloud)

1&1 IONOS SE | Greifswalder Str. 207 | 10405 Berlin | Germany
E-mail: benjamin.dr...@cloud.ionos.com | Web: www.ionos.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 24498
Vorstand: Dr. Christian Böing, Hüseyin Dogan, Hans-Henning Kettler,
Matthias Steinberg, Achim Weiß
Aufsichtsratsvorsitzender: Markus Kadelke
Member of United Internet