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

New ftp method for dselect


I have written a new method for dselect that uses ftp.

To install, untar the attached file and copy into

Compile the dvercmp.c file, and put the executable some where in the
default path (/usr/local/bin)

Create a directory /var/lib/dpkg/methods/ftp

Use dselect and select ftp from the access method.  You will then be
prompted for a ftp site and directory.  The directory should be a
debian binary distribution (ie contain a Packages.gz file, along with
.deb files in base/, net/ etc.)  

What the methods do:


Prompts for site/dir.  Gets a listing of the directory and checks
there is a file beginning with Packages.  


Uses ftp to get Packages.gz and a ls -lR listing of the directory and
then merges using dpkg --merge-avail.


Checks the ftp/binary directory for short or corrupted .deb files and
remove them.

Munges status and Packages file to find the names of packages to get,
looks them up in the listing and uses ftp to get them in
/var/lib/dpkg/methods/ftp/binary if they don't already exist.

Checks the .deb files again and then installs them.
[  you can interrupt the ftp session and it will continue with the
   rest of the script after deleting any half got files (useful eh?) ]

Prompts if you want to remove the binary directory (and therefore all
the .deb files).


Although I have tested this and it works for me, it may do anything
including but not limited to deleting everything on your harddisk,
sending nasty email to Bill Clinton or actual work as planned.

To interface to ftp program it creates a .netrc file (there is no way
to use an alternate .netrc file from ftp -- arrggghhh), it tries to
keep your current .netrc intact and not leave a .netrc lying around at
the end - but it may.


This all assumes that the .deb file for a package is
pkgname-ver[-rev].deb this isn't the case for at least shellutils
whose .deb file starts sh-utils (I think this should be a bug).

NOTE to Ian Jackson (and comments from others):

If you think this is solid enough put it in the dpkg distribution
(although I have put in a warning about .netrc's being left around I
think I have fixed it.)

I have pulled the version compare stuff out of dpkg, I think it would
be useful to have this as a seperate executable (as well as in dpkg of
course) for various shell script purposes.  

It would also be useful if dpkg was extended to do some of the work
that I am currently doing with awk scripts - ie extract the names of
packages that have new versions and packages that have been selected
but not installed.

Also useful to have an option to dpkg that checks a .deb file.
(see functions.sh for how I do it at the moment)

I am leaving for xmas holiday on Saturday until the 4th of Jan and may
well be off-line so don't expect any email responses in this period.

ca5e120e986ac01fc3a44438de8eb833  /home/andy/ftp.method.tar.gz

Version: 2.6.2i
Comment: Processed by Mailcrypt 3.3, an Emacs/PGP interface


Attachment: binaAc00uLmHA.bin
Description: ftp.tar.gz

Reply to: