From 4862ae37a46904bc8529ffca00deed1c9627dab9 Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Sun, 9 Jan 2000 15:35:30 +0000 Subject: [PATCH] various text and manpage updates dselect/method.cc: don't abort if locking fails but give a warning THANKS: fix various small errors --- ChangeLog | 8 ++ THANKS | 6 +- doc/deb-control.5 | 203 ++++++++++++++++++++++--------------------- doc/deb-old.5 | 46 +++++----- doc/deb.5 | 100 ++++++++++----------- dselect/dselect.8 | 110 ++++++++++++----------- dselect/helpmsgs.src | 6 +- dselect/main.cc | 9 +- dselect/method.cc | 46 +++++++--- 9 files changed, 281 insertions(+), 253 deletions(-) diff --git a/ChangeLog b/ChangeLog index 10b969e6..26f1afa8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sun Jan 9 16:11:39 CET 2000 Wichert Akkerman + + * Merge patches from Josip Rodin: + + various text and manpage updates + + dselect/method.cc: don't abort if locking fails but give a + warning + + THANKS: fix various small errors + Sun Jan 9 01:40:23 CET 2000 Wichert Akkerman * scripts/cl-debian.pl: Allow space between `#' and the bugnumber in the diff --git a/THANKS b/THANKS index c3c9ccda..3de3a821 100644 --- a/THANKS +++ b/THANKS @@ -1,4 +1,4 @@ -Adam Heath +Adam Heath Andrew Hobson Ben Collins Branko Lankester @@ -20,10 +20,8 @@ Ian Murdock J.H.M. Dassen Jim Pick Jim Van Zandt -Jim Van Zandt Joel Klecker -Josip Rodin -Juan Cespedes +Josip Rodin Juan Cespedes Juergen Menden Juho Vuori diff --git a/doc/deb-control.5 b/doc/deb-control.5 index 5951e480..ba0ff3b3 100644 --- a/doc/deb-control.5 +++ b/doc/deb-control.5 @@ -1,45 +1,45 @@ .\" Hey, Emacs! This is an -*- nroff -*- source file. .\" Author: Raul Miller .\" Includes text from the debian Guidelines by Ian Jackson, Ian Murdock -.TH DEB-CONTROL 5 "29th November 1995" "Debian Project" "Debian GNU/Linux" +.TH DEB-CONTROL 5 "January 2000" "Debian Project" "Debian GNU/Linux" .SH NAME deb\-control \- Debian GNU/Linux packages' master control file format .SH SYNOPSIS control .SH DESCRIPTION -Master control file format: -.LP -The `control' file contains a number of fields. Each field begins -with a tag, such as +Each Debian package contains the master `control' file, which contains +a number of fields. Each field begins with a tag, such as .B Package or .B Version -(case insensitive), -followed by a colon, and the body of the field. Fields are delimited -only by field tags. In other words, field text may be multiple lines -in length, but the installation tools will generally join lines when -processing the body of the field (except in the case of the +(case insensitive), followed by a colon, and the body of the field. +Fields are delimited only by field tags. In other words, field text +may be multiple lines in length, but the installation tools will +generally join lines when processing the body of the field (except +in the case of the .B Description field, see below). .SH REQUIRED FIELDS .TP -.BR Package: \ -The value of this field is used to generate file names by some -installation tools. +.BR "Package: " "" +The value of this field determines the package name, and is used to +generate file names by most installation tools. .TP -.BR Version: \ -Typically, this is the original portable package's version -number in whatever form the program's author uses. It may also include -a Debian revision number (for non-native packages). If both version and -revision are supplied, they are seperated by a '-'. For this reason, -the original version cannot have a '-' in its version number. +.BR "Version: " "" +Typically, this is the original package's version number in whatever form +the program's author uses. It may also include a Debian revision number +(for non-native packages). If both version and revision are supplied, +they are seperated by a hyphen, `-'. For this reason, the original version +may not have a hyphen in its version number. .TP -.BR Maintainer: \ +.BR "Maintainer: " "" Should be in the format `Joe Bloggs ', and is typically -the person who created the package as opposed to the author of the -software that was packages. +the person who created the package, as opposed to the author of the +software that was packaged. .TP -.BR Description: \ +.BR "Description: " "" +.BR " " "" +.br The format for the package description is a short brief summary on the first line (after the "Description" field). The following lines can be used as a longer, more detailed description. Each line of the long description @@ -47,75 +47,72 @@ must be preceded by a space, and blank lines in the long desription must contain a single '.' following the preceding space. .SH OPTIONAL FIELDS .TP -.BR Section: \
-This is a general field that gives the package a category based on the software -that it installs. Some common sections are `mail', `text' and `new'. +.BR "Section: " "
" +This is a general field that gives the package a category based on the +software that it installs. Some common sections are `utils', `net', +`mail', `text', `x11' etc. .TP -.BR Priority: \ -Sets the importance of this package in relation to the system as a whole. Common -priorities are `base', `standard' and `optional'. +.BR "Priority: " "" +Sets the importance of this package in relation to the system as a whole. +Common priorities are `required', `standard', `optional', `extra' etc. .LP In Debian, the .B Section and .B Priority -fields have a defined set of accepted values based on policy. They are used to -decide how the packages are layed out in the archive. A list of these can be -obtained from the latest +fields have a defined set of accepted values based on the Policy Manual. +They are used to decide how the packages are layed out in the archive. +A list of these can be obtained from the latest version of .B debian-policy package. .TP -.BR Essential: \ -This field is usually only needed when the answer is `yes'. It denotes a -package that is required for proper operation of the system. Dpkg will not -allow this an +.BR "Essential: " "" +This field is usually only needed when the answer is `yes'. It denotes +a package that is required for proper operation of the system. Dpkg +or any other installation tool will not allow an .B Essential -package to be removed without using one of the force options. +package to be removed (at least not without using one of the force options). .TP -.BR Architecture: \ +.BR "Architecture: " "" The architecture specifies which type of hardware this package was compiled -for. Common architectures are `i386', `sparc' and `alpha'. Note that the +for. Common architectures are `i386', `m68k', `sparc', `alpha', `powerpc' +etc. Note that the .B all option is meant for packages that are architecture independent. Some examples -of this are perl scripts and documentation. +of this are shell or Perl scripts, or documentation. .TP -.BR Source: \ -The name of the source that this package came from, if different than the -name of the package itself. +.BR "Source: " "" +The name of the source package that this binary package came from, if +different than the name of the package itself. .TP -.BR Depends: \ +.BR "Depends: " "" List of packages that are required for this package to provide a non-trivial amount of functionality. The package maintenance software -will not allow a package to be installed without also installing -packages listed in its +will not allow a package to be installed if the packages listed in its .B Depends -field, and will run the postinst scripts of packages listed in DEPENDS -fields before those of the packages which depend on them, and run -prerm scripts before. +field aren't installed (at least not without using the force options), +and will run the postinst scripts of packages listed in Depends: fields +before those of the packages which depend on them, and run prerm scripts +before. .TP -.BR Pre-Depends: \ +.BR "Pre-Depends: " "" List of packages that must be installed .B and configured before this one can be installed. This is usually used in the -case where this package requires the pre depend for running its preinst +case where this package requires another package for running its preinst script. .TP -.BR Recommends: \ -Lists packages that would be found together with -this one in all but unusual installations. The package maintenance -software will warn the user if they install a package without those -listed in its +.BR "Recommends: " "" +Lists packages that would be found together with this one in all but +unusual installations. The package maintenance software will warn the +user if they install a package without those listed in its .B Recommends field. .TP .BR Suggests: \ Lists packages that are related to this one and can perhaps enhance its usefulness, but without which installing this package is perfectly -reasonable. The package maintenance software will not moan at the -user for not selecting suggested packages, but may use the information -in the -.B Suggests -field to assist the user during package selection. +reasonable. .LP The syntax of .B Depends , @@ -123,60 +120,60 @@ The syntax of .B Recommends and .B Suggests -is a list of groups of alternative packages. Each group is a list of -packages separated by vertical bar (or `pipe') symbols, `|'. The -groups are separated by commas. Each package is a package name +fields is a list of groups of alternative packages. Each group is a list +of packages separated by vertical bar (or `pipe') symbols, `|'. The +groups are separated by commas. Commas are to be read as `AND', and pipes +as `OR', with pipes binding more tightly. Each item is a package name optionally followed by a version number specification in parentheses. -A version number may start with a `>>', in which case any later version -will match, and may specify or omit the Debian packaging revision -(separated by a hyphen). Commas are to be read as `AND', and pipes as -`OR', with pipes binding more tightly. .LP -Accepted version relationships are ">>" for greater than, "<<" for less than, -">=" for greater than or equal to, "<=" for less than or equal to, and "=" -for equal to. +A version number may start with a `>>', in which case any later version +will match, and may specify or omit the Debian packaging revision (separated +by a hyphen). Accepted version relationships are ">>" for greater than, +"<<" for less than, ">=" for greater than or equal to, "<=" for less than +or equal to, and "=" for equal to. .TP -.BR Conflicts: \ +.BR "Conflicts: " "" Lists packages that conflict with this one, for example by containing -files with the same names (an example would be Smail vs. Sendmail). -The package maintenance software will not allow conflicting packages -to be installed at the same time. Two conflicting packages should each include a +files with the same names. The package maintenance software will not +allow conflicting packages to be installed at the same time. Two +conflicting packages should each include a .B Conflicts line mentioning the other. .TP -.BR Replaces: \ -List of packages that this one replaces. This is used for allowing this package -to overwrite the files of another package and is usually used with the +.BR "Replaces: " "" +List of packages files from which this one replaces. This is used for +allowing this package to overwrite the files of another package and +is usually used with the .B Conflicts -field to force removal of the other package, if this one also has the same files -as the conflicted package. +field to force removal of the other package, if this one also has the +same files as the conflicted package. .TP .BR Provides: \ -This is a list of virtual packages that this one provides. Usuaully this is used -in the case of several packages all providing the same service. For example, -sendmail and smail both can serve as a mail server, so they provide a common package -on which other packages can depend. This will allow sendmail or smail to serve -as a valid option to satisy the one dependency. This prevents the packages that -depend on a mail server from having to know the package names for all of them, -and using `|' to seperate the list. +This is a list of virtual packages that this one provides. Usuaully this is +used in the case of several packages all providing the same service. +For example, sendmail and exim can can serve as a mail server, so they +provide a common package (`mail-transport-agent') on which other packages +can depend. This will allow sendmail or exim to serve as a valid option +to satisy the dependency. This prevents the packages that depend on a mail +server from having to know the package names for all of them, and using +`|' to separate the list. .LP The syntax of .B Conflicts , .B Replaces and .B Provides -is a list of package names, separated by commas (and optional -whitespace). In the +is a list of package names, separated by commas (and optional whitespace). +In the .B Conflicts -field, the comma should be read as `OR'. An optional version can also be given -with the same syntax as above for the +field, the comma should be read as `OR'. An optional version can also be +given with the same syntax as above for the .B Conflicts and .B Replaces fields. .SH EXAMPLE -.PP -.RS +.\" .RS .nf Package: grep Essential: yes @@ -184,16 +181,22 @@ Priority: required Section: base Maintainer: Wichert Akkerman Architecture: sparc -Version: 2.3-7 +Version: 2.4-1 Pre-Depends: libc6 (>= 2.0.105) +Provides: rgrep +Conflicts: rgrep Description: GNU grep, egrep and fgrep. - The GNU set of grep tools. Many times faster than standard - unix grep. + The GNU family of grep utilities may be the "fastest grep in the west". + GNU grep is based on a fast lazy-state deterministic matcher (about + twice as fast as stock Unix egrep) hybridized with a Boyer-Moore-Gosper + search for a fixed string that eliminates impossible text from being + considered by the full regexp matcher without necessarily having to + look at every character. The result is typically many times faster + than Unix grep or egrep. (Regular expressions containing backreferencing + will run more slowly, however.) .fi -.RE -.PP +.\" .RE .SH SEE ALSO .BR deb (5), .BR dpkg (8), -.BR dpkg-deb (1), -.BR dselect (8). +.BR dpkg-deb (1). diff --git a/doc/deb-old.5 b/doc/deb-old.5 index d415281d..00542695 100644 --- a/doc/deb-old.5 +++ b/doc/deb-old.5 @@ -1,55 +1,55 @@ .\" Hey, Emacs! This is an -*- nroff -*- source file. .\" Author: Raul Miller, Ian Jackson -.TH DEB-OLD 5 "1st July 1996" "Debian Project" "Debian GNU/Linux" +.TH DEB-OLD 5 "January 2000" "Debian Project" "Debian GNU/Linux" .SH NAME -deb-old - Debian GNU/Linux binary package old style format +deb-old \- old style Debian GNU/Linux binary package format .SH SYNOPSIS .IB filename .deb .SH DESCRIPTION -Old style Debian binary package format. - The .B .deb -format is the Debian binary package file format. The format has -changed since Debian 0.93 and the new format is being phased in. - -The old format is described here. Please see +format is the Debian binary package file format. This manual page +describes the +.B old +format, used before Debian 0.93. Please see .BR deb (5) for details of the new format. .SH FORMAT The file is two lines of format information as ASCII text, followed by two concatenated gzipped ustar files. - +.PP The first line is the format version number padded to 8 digits, and is .B 0.939000 for all old-format archives. - +.PP The second line is a decimal string (without leading zeroes) giving the length of the first gzipped tarfile. - +.PP Each of these lines is terminated with a single newline character. - -The first tarfile contains the control information (see the -.IR "dpkg Programmer's manual" ) -as a series of ordinary files. The file +.PP +The first tarfile contains the control information, as a series of +ordinary files, described in +.IR "Debian Packaging Manual, section 2.2". +The file .B control -must be present, and contains the core control information. The files -in the control tarfile may optionally be in a +must be present, as it contains the core control information. +.PP +In some very old archives, the files in the control tarfile may +optionally be in a .B DEBIAN -subdirectory in some very old archives - in this case the +subdirectory. In that case, the .B DEBIAN subdirectory will be in the control tarfile too, and the control tarfile will have only files in that directory. Optionally the control tarfile may contain an entry for .RB ` . ', that is, the current directory. - +.PP The second gzipped tarfile is the filesystem archive, containing pathnames relative to the root directory of the system to be installed on. The pathnames do not have leading slashes. - .SH SEE ALSO .BR deb (5), -.BR deb\-control (5), -.IR "dpkg Programmers' manual" , -.BR dpkg\-deb (8) +.BR dpkg-deb (8), +.BR deb-control (5), +.IR "Debian Packaging Manual". diff --git a/doc/deb.5 b/doc/deb.5 index c36f89ef..a933b09c 100644 --- a/doc/deb.5 +++ b/doc/deb.5 @@ -1,85 +1,75 @@ .\" Hey, Emacs! This is an -*- nroff -*- source file. .\" Authors: Raul Miller, Ian Jackson -.TH DEB 5 "1st July 1996" "Debian Project" "Debian GNU/Linux" +.TH DEB 5 "January 2000" "Debian Project" "Debian GNU/Linux" .SH NAME -deb - Debian GNU/Linux binary package format +deb \- Debian GNU/Linux binary package format .SH SYNOPSIS .IB filename .deb .SH DESCRIPTION The .B .deb -format is the Debian binary package file format. The format has -changed since Debian 0.93 and the new format is being phased in. It -is understood by dpkg 0.93.76 and later, and is generated by default -by all versions of dpkg since 1.2.0 and all i386/ELF versions since -1.1.1elf. - -The new format is described here. Please see -.BR deb-old (5) -for details of the old format. +format is the Debian binary package file format. It is understood by +dpkg 0.93.76 and later, and is generated by default by all versions +of dpkg since 1.2.0 and all i386/ELF versions since 1.1.1elf. +.PP +The format described here is used since Debian 0.93; details of the +old format are described in +.BR deb-old (5). .SH FORMAT The file is an .B ar archive with a magic number of .BR ! . -Note that many modern versions of -.B ar -create archives with different magic numbers. Archives created in -this way will not be recognised by -.BR dpkg\-deb , -though these -.B ar -programs do understand the magic number used by -.BR dpkg\-deb . - +.PP The first member is named .B debian-binary and contains a series of lines, separated by newlines. Currently only -one line is present, the format version number, which is currently -.BR 2.0 . +one line is present, the format version number, +.BR 2.0 +at the time this manual page was written. Programs which read new-format archives should be prepared for the minor number to be increased and new lines to be present, and should ignore these if this is the case. - -If the major number has changed an incompatible change has been made -and the program should stop; if it has not then the program can safely -continue, unless it encounters an unexpected member in the archive -(except at the end), as described below. - +.PP +If the major number has changed, an incompatible change has been made +and the program should stop. If it has not, then the program should +be able to safely continue, unless it encounters an unexpected member +in the archive (except at the end), as described below. +.PP The second required member is named -.B control.tar.gz -and is a gzipped ustar containing the package control information, as -a series of plain files, of which the file +.B control.tar.gz . +It is a gzipped tar archive containing the package control information, +as a series of plain files, of which the file .B control -is mandatory and contains the core control information. See the -.I dpkg Programmers' manual -for details of these files. The control tarfile may optionally -contain an entry for +is mandatory and contains the core control information. Please see the +.I "Debian Packaging Manual, section 2.2" +for details of these files. The control tarball may optionally contain +an entry for .RB ` . ', the current directory. - -The third and final required member is named -.B data.tar.gz -and contains the filesystem archive as a gzipped ustar. - -These members must occur in this order. Further members may be -defined in the future, and will if possible be placed after these -three. Current implementations should ignore any additional members -after +.PP +The third, last required member is named +.B data.tar.gz . +It contains the filesystem archive as a gzipped tar archive. +.PP +These members must occur in this exact order. Current implementations +should ignore any additional members after .BR data.tar.gz . -Additional members defined in the future which need to be inserted -before +Further members may be defined in the future, and (if possible) will be +placed after these three. Any additional members that may need to be +inserted before .B data.tar.gz -and which can safely be ignored by older programs will have names -starting with an underscore +and which should be safely ignored by older programs, will have names +starting with an underscore, .RB ` _ '. - -New members which cannot safely be ignored will be inserted before +.PP +Those new members which won't be able to be safely ignored will be +inserted before .B data.tar.gz with names starting with something other than underscores, or will -cause the major version number to be increased. +(more likely) cause the major version number to be increased. .SH SEE ALSO .BR deb (5), -.BR deb\-control (5), -.IR "dpkg Programmers' manual" , -.BR dpkg\-deb (8) +.BR dpkg-deb (8), +.BR deb-control (5), +.IR "Debian Packaging Manual". diff --git a/dselect/dselect.8 b/dselect/dselect.8 index 8e7e6d50..2055da73 100644 --- a/dselect/dselect.8 +++ b/dselect/dselect.8 @@ -1,15 +1,11 @@ .\" Hey, Emacs! This is an -*- nroff -*- source file. -.TH DSELECT 8 "29th November 1995" "Debian Project" "Debian GNU/Linux" +.TH DSELECT 8 "January 2000" "Debian Project" "Debian GNU/Linux" .SH NAME -dselect \- a user tool to manage Debian GNU/Linux packages - +dselect \- console Debian package handling frontend .SH SYNOPSIS .B dselect -[options] -.br -.B dselect -[options] action ... - +[--admindir ] [--help] [--version] [--licence | --license] +[--expert] [--debug | -D ] [\fI\fP] .SH DESCRIPTION .B dselect is the primary user interface for installing, removing and managing @@ -19,71 +15,79 @@ Normally .B dselect is invoked without parameters, but some commandline parameters are still available. - +.PP The usage of .B dselect -is pretty self-explanatory, and also an internal help-system is -included, which describes the keystrokes and some general concepts. +is pretty self-explanatory, and an internal help-system is included, +which describes the keystrokes and some general concepts. .I Read the help. - .SS ACTIONS .TP -.B access, update, select, install, config, remove -These actions automatically selects corresponding commands from the main -menu, without even showing the main menu to you. +.B Access +Chooses an access `method' to use to find package repository. By default, +there exist several methods such as "floppy", "harddisk", "cdrom", but +other packages you install can provide additional methods, e.g. "apt" +or "multi_cd" etc. .TP -.B quit -Do nothing but quit. +.B Update +Updates list of packages available to dpkg/dselect with data from the +chosen repository Packages file(s). .TP -.B menu -Displays the default menu. This is equivalent to starting -.B dselect -with no parameters. - -.SS OPTIONS +.B Select +Selects individual packages to install. +.TP +.B Install +Installs selected packages. +.TP +.B Config +Configures any previously not configured packages. +.TP +.B Remove +Removes or purges deselected packages. +.TP +.B Quit +Exit dselect (successfully). +.SH OPTIONS .TP .B --admindir -Changes the directory where datafiles are located. This defaults to -.I /var/lib/dpkg. -Note, that these files are just some internal datafiles, actual Debian -packages doesn't have to be located here. +Changes the directory where the dpkg `status', `available' and similar +files are located. This defaults to +.I /var/lib/dpkg +and normally there shouldn't be any need to change it. .TP .B --debug | -D Turn on debugging. Debugging information is sent to .I . .TP +.B --expert +Turns on expert mode, i.e. doesn't display possibly annoying help messages. +.TP .B --help -Print a brief help text. +Print a brief help text and exit successfully. .TP -.B --licence -Print the licence of -.B dselect. +.B --licence | --license +Displays the dselect copyright and license information and exits successfully. .TP .B --version -Print version information. - +Print version information and exit successfully. .SH BUGS -This manpage doesn't document the options quite correctly, and has -formatting inconsistent with other manpages. - The .B dselect -package selection interface is confusing or even alarming to the new -user. - -There is no easy way automatically to download and install packages -via anonymous FTP. - +package selection interface is confusing or even alarming to a new user. +.sp +.B dselect +doesn't handle Recommends: field very well, and doesn't understand +Replaces: at all. +.sp +There is no easy way to automatically download and install packages +via anonymous FTP with default access methods (APT does this). .SH SEE ALSO -.B deb(5) -, -.B dpkg-deb(8) -, -.B dpkg(8) -and -.B deb-control(5) - -.SH AUTHOR +.BR dpkg (8), +.BR deb (5). +.SH AUTHORS .B dselect -was written by Ian Jackson (ijackson@gnu.ai.mit.edu). -This manual page is by Juho Vuori (javuori@cc.helsinki.fi). +was written by Ian Jackson (ijackson@gnu.ai.mit.edu). Full list of +contributors may be found in `dselect --license'. +.br +This manual page was written by Juho Vuori +and updated by Josip Rodin. diff --git a/dselect/helpmsgs.src b/dselect/helpmsgs.src index bff0a00f..2790420f 100644 --- a/dselect/helpmsgs.src +++ b/dselect/helpmsgs.src @@ -25,7 +25,7 @@ Quit, exit, overwrite (note capitals!): ?, F1 request help (also Help) @@@ mainintro Introduction to package list -Welcome to the main package listing. Please read the help that is available ! +Welcome to the main package listing. Please read the help that is available! You will be presented with a list of packages which are installed or available for installation. You can navigate around the list using the cursor keys, @@ -53,7 +53,7 @@ Press Space to leave help and enter the list; press `?' at any time for help. Welcome to dselect's main package listing. Since you do not have the privilege necessary to update package states you are in read-only mode. -Much on-line help is available, please make use of it ! Press `?' for help. +Much on-line help is available, please make use of it! Press `?' for help. You should read the list of keys and the explanations of the display. You will be presented with a list of packages which are installed or available @@ -63,7 +63,7 @@ help screen) and observe the status of the packages and read information about them. Press Space to leave help and enter the list; press `?' at any time for help. -When you have finished browsing, press `q' or Return to quit. +When you have finished browsing, press `Q' or to quit. @@@ recurintro Introduction to conflict/dependency resolution sub-list diff --git a/dselect/main.cc b/dselect/main.cc index bf683cdd..59d0b00f 100644 --- a/dselect/main.cc +++ b/dselect/main.cc @@ -250,13 +250,18 @@ int refreshmenu(void) { attrset(A_BOLD); addstr(_("\n\n" - "Use ^P and ^N, cursor keys, initial letters, or digits to select;\n" - "Press ENTER to confirm selection. ^L to redraw screen.\n\n")); + "Move around with ^P and ^N, cursor keys, initial letters, or digits;\n" + "Press to confirm selection. ^L redraws screen.\n\n")); attrset(A_NORMAL); sprintf(buf,gettext(copyrightstring),DPKG_VERSION_ARCH); addstr(buf); + if (!readwrite) { + addstr(_("\n\n" + "Read-only access: only preview of selections is available!")); + } + return i; } diff --git a/dselect/method.cc b/dselect/method.cc index 5295fd48..69b372f8 100644 --- a/dselect/method.cc +++ b/dselect/method.cc @@ -75,7 +75,7 @@ static enum urqresult ensureoptions(void) { if (!newoptions) { curseson(); addstr(_("No access methods are available.\n\n" - "Press RETURN to continue.")); + "Press to continue.")); refresh(); getch(); return urqr_fail; } @@ -85,7 +85,20 @@ static enum urqresult ensureoptions(void) { return urqr_normal; } -static void lockmethod(void) { +static void lockfailed(const char * reasoning) { + char buf[2048]; + + curseson(); + clear(); + sprintf(buf,_("\n\n%s: %s\n"),DSELECT,reasoning); + addstr(buf); + attrset(A_BOLD); + addstr(_("\nPress to continue.")); + attrset(A_NORMAL); + refresh(); getch(); +} + +static enum urqresult lockmethod(void) { if (!methodlockfile) { int l; l= strlen(admindir); @@ -96,17 +109,24 @@ static void lockmethod(void) { if (methlockfd == -1) { methlockfd= open(methodlockfile, O_RDWR|O_CREAT|O_TRUNC, 0660); if (methlockfd == -1) { - if (errno == EPERM) - ohshit(_("you do not have permission to change the access method")); - ohshite(_("unable to open/create access method lockfile")); + if ((errno == EPERM) || (errno == EACCES)) { + lockfailed("requested operation requires superuser privilege"); + return urqr_fail; + } + lockfailed("unable to open/create access method lockfile"); + return urqr_fail; } } if (flock(methlockfd,LOCK_EX|LOCK_NB)) { - if (errno == EWOULDBLOCK || errno == EAGAIN) - ohshit(_("the access method area is already locked")); - ohshite(_("unable to lock access method area")); + if (errno == EWOULDBLOCK || errno == EAGAIN) { + lockfailed("the access method area is already locked"); + return urqr_fail; + } + lockfailed("unable to lock access method area"); + return urqr_fail; } push_cleanup(cu_unlockmethod,~0, 0,0, 0); + return urqr_normal; } static int catchsignals[]= { SIGQUIT, SIGINT, 0 }; @@ -172,7 +192,7 @@ urqresult falliblesubprocess(const char *exepath, const char *name, } else { fprintf(stderr,_("failed with an unknown wait return code %d.\n"),status); } - fprintf(stderr,_("Press RETURN to continue.\n")); + fprintf(stderr,_("Press to continue.\n")); if (ferror(stderr)) ohshite(_("write error on standard error")); do { c= fgetc(stdin); } while (c != EOF && c != '\n'); @@ -182,10 +202,10 @@ urqresult falliblesubprocess(const char *exepath, const char *name, } static urqresult runscript(const char *exepath, const char *name) { - urqresult ur; + urqresult ur; ur= ensureoptions(); if (ur != urqr_normal) return ur; - lockmethod(); + ur=lockmethod(); if (ur != urqr_normal) return ur; getcurrentopt(); if (coption) { @@ -201,7 +221,7 @@ static urqresult runscript(const char *exepath, const char *name) { } else { curseson(); addstr(_("No access method is selected/configured.\n\n" - "Press RETURN to continue.")); + "Press to continue.")); refresh(); getch(); ur= urqr_fail; } @@ -246,7 +266,7 @@ urqresult urq_setup(void) { urqresult ur; ur= ensureoptions(); if (ur != urqr_normal) return ur; - lockmethod(); + ur=lockmethod(); if (ur != urqr_normal) return ur; getcurrentopt(); curseson(); -- 2.39.5