Bug#885443: debsnap: should allow writing output to existing directory without -f

Marvin Renich mrvn at renich.org
Wed Dec 27 05:25:33 UTC 2017


Package: devscripts
Version: 2.17.11
Severity: wishlist
File: /usr/bin/debsnap

It is clear that it was a conscious decision to give an error when
downloading a source or binary package to an existing directory (without
-f), but I don't understand what real problem this solves.  On the other
hand, I would expect an error if the output file already exists, and
would expect -f to override this and replace the output file.

The documentation does not specify what happens, with or without -f,
when the destination file exists.  Does -f allow overwriting an existing
.deb file, or just writing the .deb to an existing directory if the .deb
file doesn't exist?

I am writing a script to back out of an upgrade that had unintended
consequences.  The script generates a list of (package, version,
architecture) tuples (a multiarch system with amd64 and i386 packages)
that are not necessarily sorted, and uses debsnap to download the .deb
files.  This script fails because I want both amd64 and i386 versions of
some packages, but because they are requested via separate invocations
of debsnap, the destination dir (but not destination file) already
exists when the second architecture is requested.  The script would
require significant extra logic to sort the tuples and combine different
architectures for the same package into a single debsnap invocation.

I would like to see the behavior changed so that the existence of the
destination directory is irrelevant, and the presence of -f determines
whether to give an error if the output file exists (no -f) or overwrite
a pre-existing output file (-f).

Perhaps if I understood the real use case for the current behavior, I
would be less eager to ask for a change, but it sounds like the current
behavior was designed to guard against unrealistic circumstances, but
fails at doing so.  How do you guarantee that no other process writes to
the destination directory after debsnap creates it?  Under what
circumstances would some other process be trying to write to the
destination directory, and why?

The best you can do is ensure that debsnap does not overwrite an
existing file, and creating a new output directory is neither necessary
nor sufficient to accomplish that.

...Marvin

-- Package-specific info:

--- /etc/devscripts.conf ---

--- ~/.devscripts ---
Not present

-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'stable'), (200, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.13.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages devscripts depends on:
ii  dpkg-dev              1.19.0.4
ii  libc6                 2.25-3
ii  libfile-homedir-perl  1.002-1
ii  perl                  5.26.1-3
ii  python3               3.6.4~rc1-2
ii  sensible-utils        0.0.11

Versions of packages devscripts recommends:
ii  apt                         1.6~alpha5
ii  at                          3.1.20-3.1
ii  curl                        7.57.0-1
ii  dctrl-tools                 2.24-2+b1
ii  debian-keyring              2017.11.24
ii  dput-ng [dput]              1.15
pn  equivs                      <none>
ii  fakeroot                    1.22-2
ii  file                        1:5.32-1
ii  gnupg                       2.2.3-1
ii  libdistro-info-perl         0.17
ii  libdpkg-perl                1.19.0.4
ii  libencode-locale-perl       1.05-1
ii  libgit-wrapper-perl         0.047-1
ii  liblist-compare-perl        0.53-1
ii  liblwp-protocol-https-perl  6.07-2
ii  libsoap-lite-perl           1.23-1
ii  liburi-perl                 1.72-2
ii  libwww-perl                 6.29-1
ii  licensecheck                3.0.31-2
ii  lintian                     2.5.65
ii  man-db                      2.7.6.1-4
ii  patch                       2.7.5-1+b2
ii  patchutils                  0.3.4-2
ii  python3-apt                 1.4.0~beta3+b1
ii  python3-debian              0.1.31
ii  python3-magic               1:5.32-1
ii  python3-requests            2.18.1-1
pn  python3-unidiff             <none>
ii  python3-xdg                 0.25-4
ii  strace                      4.19-1
ii  unzip                       6.0-21
ii  wdiff                       1.2.2-2
ii  wget                        1.19.2-1
ii  xz-utils                    5.2.2-1.3

Versions of packages devscripts suggests:
pn  adequate                     <none>
pn  autopkgtest                  <none>
pn  bls-standalone               <none>
ii  bsd-mailx [mailx]            8.1.2-0.20160123cvs-4
ii  build-essential              12.4
pn  check-all-the-things         <none>
pn  cvs-buildpackage             <none>
pn  devscripts-el                <none>
pn  diffoscope                   <none>
pn  disorderfs                   <none>
pn  dose-extra                   <none>
pn  duck                         <none>
pn  faketime                     <none>
ii  gnuplot                      5.2.2+dfsg1-2
ii  gnuplot-qt [gnuplot]         5.2.2+dfsg1-2
ii  gpgv                         2.2.3-1
pn  how-can-i-help               <none>
ii  libauthen-sasl-perl          2.1600-1
ii  libfile-desktopentry-perl    0.22-1
pn  libnet-smtps-perl            <none>
pn  libterm-size-perl            <none>
ii  libtimedate-perl             2.3000-2
pn  libyaml-syck-perl            <none>
ii  mailutils [mailx]            1:3.4-1
pn  mozilla-devscripts           <none>
ii  mutt                         1.9.2-1
ii  openssh-client [ssh-client]  1:7.6p1-2
pn  piuparts                     <none>
ii  quilt                        0.63-8.1
pn  ratt                         <none>
pn  reprotest                    <none>
pn  svn-buildpackage             <none>
ii  w3m                          0.5.3-34.1

-- no debconf information



More information about the devscripts-devel mailing list