Re: dh_movefiles, tar vs. mv
Christoph Berg <cb@df7cb.de> schrieb:
> Re: Daniel Burrows in <[🔎] 200502251314.09459.dburrows@debian.org>
>> I'd imagine that it doesn't use mv for the same reason "install" doesn't;
>> ie, its purpose is to COPY files, not MOVE them.
>
> As I understood it, the question was about moving stuff from
> debian/tmp to debian/package. The stuff in debian/tmp should get
> removed by the clean target anyway, so it doesn't hurt to move instead
> of copying it.
Indeed. Especially when people tell me that dh_install is the successor
of dh_movefiles, which even has move in its name...
>> Anyway, I thought you were joking in your first message, but it looks like
>> you're serious, so I'll answer this time. If you're copying between files on
>> the same device, mv will use the rename(2) system call, which is an atomic
>> operation: ie, it doesn't "copy" the source files at all, it just links them
>> into the target directory.
That's why I want to use it. It would speed things up tremendously for
packages with lots of files that need to be separated into different
binary packages.
>> If you're copying between devices, mv will
>> presumably copy the whole file before deleting it -- to actually remove a
>> file "block-by-block" would mean a whole lot of totally pointless extra work
>> in order to make the program less robust (there's no direct way to delete the
>> first block of a file, so you'd have to either copy from the back or shift
>> the whole file back a block at a time and then truncate it).
>
> I doubt that any subdirs of a package build directory will ever be on
> a different mount point than the directory itself ;-)
Correct. So, why not use mv?
Regards, Frank
--
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer
Reply to: