#560587 dpkg-source: Use $TMPDIR for .orig.tar.gz extraction

#560587#5
Date:
2009-12-11 10:03:30 UTC
From:
To:
There are currently 2 problems with the way the .orig.tar.gz file is
extracted during dpkg-source -b:
- When a package-ver.orig directory pre-exists, it gets removed.
- The orig tarball is unpacked just to be removed afterwards. On SSD disks
  and big tarballs, it is a waste of write cycles.

For the first issue, I would suggest to *not to anything* if the directory
pre-exists, and output an error message.

For the latter, I'd suggest to use $TMPDIR when it is set.

Cheers

#560587#10
Date:
2009-12-11 12:40:34 UTC
From:
To:
With format 1.0, there are many -s* options precisely to control this
(you may want to try -ss or -sk). Those options do not exist anymore with
newer formats however. Newer formats also don't wipe out the .orig dir,
they create temporary directories near the source tree.

Seems reasonable. We must take care where the diff file is generated as
this one is put into place with rename currently but otherwise it should
not create any problem.

Cheers,

#560587#15
Date:
2009-12-11 12:47:53 UTC
From:
To:
The problem is that the .orig directory may not be corresponding to the
tarball, and i see no option in dpkg-source that prevents bad things
from happening.

#560587#20
Date:
2009-12-11 13:08:36 UTC
From:
To:
It's also partly due to this that those options are gone in newer formats.
I think -sk is fine though, it overwrites the .orig but leaves it in
place.

For -ss the warning is in the manual page:
	      This option must be used with  care - if the directory and
	      tarfile do not match a bad source archive will be generated.

Cheers,

#560587#25
Date:
2009-12-11 13:19:36 UTC
From:
To:
Overwriting something that is there is considered fine ?
I learnt the bad way that one should not name a directory
package-ver.orig need a package-ver directory, which means I avoid this
problem now, but that definitely doesn't make overwriting a good behaviour.