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

New ftp method for dselect



-----BEGIN PGP SIGNED MESSAGE-----


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

To install, untar the attached file and copy into
/usr/lib/dpkg/methods/ftp

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:

Setup:

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

Update:

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

Install:

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).

WARNING:

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.

NOTE:

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.

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



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

iQCVAwUBMNCmaF994FoFqUU1AQH+QgP/elS8uPG2MTPqZnyFAUqZdSe35EsMZJKp
gHOpmXc+NfyjGkJC7twFtpj4VQ31s1GVDnpW/7Hop2hJth6QF6Rsyag5FVvOszjJ
EdoDCnjcTTbXANzFxDxTOXBg41CYvowa3/pD3lcQm/a6BkFOq4EjXj/X8K9rhpsP
dTJBTE6r+44=
=A+JX
-----END PGP SIGNATURE-----

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


Reply to: