[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Updating dpkg-cross: file moving question

"Nikita V. Youshchenko" <yoush@cs.msu.su> writes:

> Hello.
> I'm going to update dpkg-cross package, to follow post-sarge changes in 
> dpkg and company.
> Dpkg-cross is a tool to create cross-compile environment, useful to 
> cross-compile debian packages and other software.
> One of dpkg-cross's functions is to process a native library or libdev 
> package for some arch, and turn it into arch-all packages that install 
> libraries info /usr/$DEB_TARGET_GNU_ARCH)/lib/, and headers 
> info /usr/$(DEB_TARGET_GNU_ARCH)/include/. E.g. arm cross-compile 
> environment was created under /usr/arm-linux/. This was consistent with 
> cross-binutils and cross-gcc packages file placement.

That isn't where the multiarch proposals for Debian and FHS place
files and I think it is best if you follow their lead. Use


> In newer dpkg tools, target names changed, e.g. arm-linux turned into 
> arm-linux-gnu. So, to keep system consistent, dpkg-cross should now place 
> things under /usr/arm-linux/gnu/.
> The question is - how to process existing cross-compile environment, 
> created by earlier versions of dpkg-cross.
> I am thinking to make the following trick. In postinst of new dpkg-cross, 
> it will check for /usr/arm-linux, /usr/powerpc-linux/, and other places 
> where packages created by earlier versions could place files. If any of 
> such directories is found:
> - a directory with the new name will be created if not exists yet,
> - complete file hierarchy from the old directory will be copied to the new 
> directory,
> - old directory will be replaces with a sympink to the new one.
> Looks that this procedure is more or less safe. E.g. removals of packages 
> which files have been moved in this way, would remove correct files.

The target directory would not be removed.

> Is it OK to go this way? Maybe, something better could be suggested?
> This is still not perfect: for example, it is never safe to remove created 
> symlinks; also cross-compile environment will become broken if -arch-cross 
> packages created with old and new dpkg-cross are mixed and dpkg-cross 
> itself is either old or not installed. However, isn't it better than doing 
> nothing (in which case any mixing of -arch-cross packages created by old 
> and new dpkg-cross will be broken)?
> Nikita


Reply to: