On 23/10/06 12:16:05, Wookey wrote:
On 2006-10-23 09:45 +0100, Martin Guy wrote: > >One thing that strikes me straight away is to remove the need to > >specify a mirror each time. If it's to be apt-cross it should use > >/etc/apt/sources.list IMHO along with the usual version handling.
OK, an update. I've got a perl version that uses the sources listed in /etc/apt/sources.list but it's not yet fully usable.
I've implemented it within a modified dpkg-cross and, for now, it's called only cross-get.pl. See later for the final name.
$ perl ./cross-get.pl libqof1 results in a local file: libqof1_0.7.1-3_arm.debretrieved from ftp://mirror.ox.ac.uk/debian//pool/main/q/qof/libqof1_0.7.1-3_arm.deb
(the first mirror in my sources list).I've now got to handles the files in /var/lib/apt-cross internally so that if a source is specified (or should that be a mirror ?) then this overrides the sources that could be obtained from /etc/apt/sources.list - currently it relies on the files created by Wookey's bash version of cross-get.
I also need to implement --arch (it assumes arm right now) and --suite (it assumes unstable).
The eventual usage could be: $ dpkg-cross --get libqof1 or $ dpkg-cross --arm m68k --get libqof1 (which results in libqof1_0.7.1-3_m68k.deb) $ dpkg-cross --suite testing --get pilot-qof $ dpkg-cross --mirror ftp.jp.debian.org/debian --get libqof11. If no mirror is specified, it tries each source in /etc/apt/sources.list until the file size is non-zero or reports a fail if no mirrors can provide a non-zero file size. If a different mirror is specified, it can report failure if the file size is zero.
2. It can be improved to test that the file is binary and that the size matches the Size: field of apt-cache show for that architecture.
3. It now uses a package list so that any strings specified after --get will be assumed to be package names to retrieve.
dpkg-cross [--get|-g] <packages...>(Not sure if this will mean that options to --get need to be specified before --get itself.)
4. Do we want to use 'apt-cache madison' rather than 'apt-cache show' as the underlying query? That could allow version pinning:
$ dpkg-cross --get libqof1=0.7.1-25. Currently, it overwrites the .deb if it already exists (because it no longer calls wget) - presumably that would be better if it simply skips the --get if the .deb filename exists?
6. It adds a single module to the requirements of dpkg-cross, namely use File::Basename;
> By default, maybe, but I currently need to fetch binary packages > for the host system from a private repository which has its own> modified source packages, fetch sources for cross-compilation from > a different one, the main one (though this may also need to become > a local source repo), and *also* fetch arch-independent binaries> from the main repo.
That should be fine with this one - once complete - because you will be able to specify a mirror or let it use the ones in /etc/apt/sources.list - my original problem with cross-get was that it used it's own default if no source was specified, rather than the sources already in use on the system.
Is it best to work on this now as a patch for dpkg-cross instead of a dedicated apt-cross or cross-get? This will mean using /var/lib/dpkg-cross for the necessary cache files.
Should I look at modifying dpkg-cross so that it can GET implicitly ?i.e. there seems little point getting the file - parsing the filename in the process - and then requiring the user to enter the name of the file the previous dpkg-cross run has just created.
Maybe dpkg-cross --install and/or dpkg-cross --build can check for a local file and use --get if one is not found?
-- Neil Williams ============= http://www.data-freedom.org/ http://www.nosoftwarepatents.com/ http://www.linux.codehelp.co.uk/
Description: PGP signature