dselect-methods.txt 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. From ian Sun May 14 18:21:53 +0100 1995
  2. To: Debian developers list <debian-devel@pixar.com>
  3. Subject: dselect installation method scripts
  4. Below is a (somewhat amended) repost of the posting I made a little
  5. while ago about the interface between dselect and the installation
  6. scripts it can run to extract packages.
  7. Carl Streeter has some hard disk scripts that look fairly good (I
  8. haven't tested them). Anyone else looking to write such scripts
  9. should see his code (Carl, can you upload them please ?).
  10. Howevever, there are a few points to note:
  11. * Each set of scripts can support several `options' as they're called
  12. - this saves having different code for the CD-ROM, hard disk, &c
  13. methods.
  14. * You have to supply a /usr/[local]/lib/dpkg/methods/<method>/names
  15. file listing the options - see below.
  16. dselect *will* look in /usr/local/lib/dpkg/methods as well as
  17. /usr/lib. Put your scripts there until you send them to me for
  18. inclusion in dpkg.
  19. Details if the installation method handling is below, and in
  20. method-scripts.txt; an example `test' method that just shows you how
  21. to write a `names' file and how dselect reacts is available as:
  22. ab2022c57a1198838034c5f87ea501b1 dselect-example-test-method.tar
  23. -rw-rw-r-- 1 ian ian 10240 May 14 18:19 dselect-example-test-method.tar
  24. NB that the code in dselect to select and call installation scripts is
  25. ALPHA !
  26. Ian.
  27. Each `installation method' will have three scripts:
  28. * Setup installation parameters.
  29. * Update list of available packages.
  30. * Unpack.
  31. Which set of scripts is to be used is selectable by the user, from the
  32. `[S]etup' menu option. Basically, the user hits `Setup', gets
  33. presented with a menu of choices and picks one.
  34. This (a) sets that `choice' to be the default installation method and
  35. (b) runs the `setup' script for that choice.
  36. The setup script should prompt the user for parameters like the site
  37. to NFS-mount or FTP from, the directory to use, or the directory or
  38. filesystem where the .deb files can be found, or the tape or floppy
  39. device to install from. It should store the responses under
  40. /var/lib/dpkg/methods - see below.
  41. The update script should obtain a list of available packages if
  42. possible (this is the Packages file from the FTP sites), and copy it
  43. to /var/lib/dpkg/available. Be careful not to overwrite the available
  44. file if something goes wrong - I'd suggest copying to `available.new'
  45. and renaming. If no available list is available :-) it should print a
  46. message saying so.
  47. The unpack script should feed all the available .deb files to
  48. dpkg --unpack --no-also-select
  49. (the --auto option may also be useful here). In the future there will
  50. be a mechanism to allow (for example) a floppy-based installation
  51. scheme to tell the user which packages are still to be processed; in
  52. the meantime you should just keep going until the user says `stop'.
  53. If any of these scripts needs to display a message for the user, it
  54. should wait for the user to hit `return' before exiting so that
  55. dselect doesn't immediately rewrite the screen.
  56. If a script gives a non-zero exit status dselect will print a message
  57. about it and prompt the user for an acknowledgement. If it exits with
  58. a zero exit status then dselect will immediately go back into curses
  59. and any message that the script printed just before exiting will not
  60. be visible.
  61. The scripts will be kept in /usr/lib/dpkg/methods/. Each method
  62. should have a directory under methods, containing:
  63. `names' - a list of `user-visible options', see below.
  64. `setup', `update', `unpack' - executable programs.
  65. `desc.<option>' - description file.
  66. A method may provide several options on the `main menu' with different
  67. behaviour. For example, there might be a generic get-packages-by-FTP
  68. method which might provide entries in the main menu for installation
  69. directly from one of the Debian mirror sites as well as for
  70. installation from a user-specified site.
  71. The `setup', `update' and `unpack' will be invoked with three
  72. arguments.
  73. The first argument is the directory with the dpkg status information,
  74. usually /var/lib/dpkg. They should $1/methods/<method-name> to store
  75. their data (remember that the user can give a --admindir option to
  76. dselect).
  77. The second and third argument are the name of the method and the
  78. option within that method, respectively. This information is provided
  79. by dselect (from the user's choice of installation option).
  80. `names' will be formatted as a list of lines, each containing:
  81. <sequence> <option> <summary>
  82. <sequence> is a two-digit number that will be used much like rc.d
  83. prefixes to control the order in the main menu. If in doubt use 50.
  84. <option> is a name which will be passed to `setup', `update' and
  85. `unpack' as their third argument (see above).
  86. <summary> is the menu entry string.
  87. Each option may have an extended description in `desc.<option>'. This
  88. should be formatted like a Description: field entry *shifted one
  89. character to the left*.
  90. /var/lib/dpkg/methods will exist, and a method may use a
  91. /var/lib/dpkg/methods/<method> directory or file (or <method>.* files)
  92. to store its state.
  93. <method> and <option> must follow the rules for C identifiers.
  94. -- Ian Jackson 14th May 1995