pkgvm/derived/PkgVMBundle.m3


MODULE PkgVMBundle;
Generated by m3bundle; see its manpage.

IMPORT Bundle, BundleRep, Text;
IMPORT Thread, Wr, TextWr;

TYPE T = Bundle.T OBJECT OVERRIDES
           get      := LookUp;
           getNames := GetNames;
         END;

TYPE Texts = REF ARRAY OF TEXT;

VAR
  bundle: T     := NIL;
  names : Texts := NIL;

PROCEDURE Get(): Bundle.T =
  BEGIN
    IF (bundle = NIL) THEN bundle := NEW (T) END;
    RETURN bundle;
  END Get;

PROCEDURE GetNames (<*UNUSED*> self: T): Texts =
  BEGIN
    IF names = NIL THEN
      names := NEW (Texts, NUMBER (Names));
      names^ := Names;
    END;
    RETURN names;
  END GetNames;

PROCEDURE LookUp (<*UNUSED*> self: T;  element: TEXT): TEXT =
  BEGIN
    FOR i := 0 TO LAST (Names)-1 DO
      IF Text.Equal (Names[i], element) THEN
        IF Elements[i] = NIL THEN Elements[i] := GetElt (i) END;
        RETURN Elements[i];
      END;
    END;
    RETURN NIL;
  END LookUp;

CONST Names = ARRAY [0..3] OF TEXT {
  "pkgvm.desc",
  "compactrc",
  "pkgvm.help",
  NIL
};

VAR Elements := ARRAY [0..3] OF TEXT {
  NIL (* E0 .. E0_6 *),
  E1,
  NIL (* E2 .. E2_0 *),
  NIL
};

PROCEDURE GetElt (n: INTEGER): TEXT =
  <*FATAL Thread.Alerted, Wr.Failure *>
  VAR wr := TextWr.New ();
  BEGIN
    CASE n OF
    | 0 =>
        Wr.PutText (wr, E0);
        Wr.PutText (wr, E0_0);
        Wr.PutText (wr, E0_1);
        Wr.PutText (wr, E0_2);
        Wr.PutText (wr, E0_3);
        Wr.PutText (wr, E0_4);
        Wr.PutText (wr, E0_5);
        Wr.PutText (wr, E0_6);
    | 2 =>
        Wr.PutText (wr, E2);
        Wr.PutText (wr, E2_0);
    ELSE (*skip*)
    END;
    RETURN TextWr.ToText (wr);
  END GetElt;

CONST E0 =
   "\nSYNTAX\n\n  pkgvm [gopt] ( -help | -h | -man | -desc)\n        [gopt]"
 & " -version\n        [gopt] ( -copyright | -cr )\n        [gopt] ( -newco"
 & "llection | -newcol | -newc ) <pathname>\n        [gopt] ( -newpackage  "
 & "  | -newpkg | -newp ) <package-name>\n        [gopt] [ -c <collection> "
 & "] ( -checkout | -co ) <tag> <pkgname>*\n        [gopt] ( -update | -up "
 & ") <tag>\n        [gopt] -merge <tag1> [<tag2>]\n        [gopt] [-TRL|-T"
 & "R|-TL|-RL|-T|-R|-L] -log <file>*\n        [gopt] -cvslog <file>*\n     "
 & "   [gopt] -diff  [-t <tag1> -t <tag2>] <file>+\n        [gopt] -cdiff ["
 & "-t <tag1> -t <tag2>] <file>+\n        [gopt] -udiff [-t <tag1> -t <tag2"
 & ">] <file>+\n        [gopt] -annotate <file>+\n        [gopt] [copt] ( -"
 & "commit  | -ci )  ( major | minor | patch )\n        [gopt] [copt] ( -re"
 & "lease | -rel ) ( major | minor | patch )\n        [gopt] [ropt] [iopt] "
 & "[bopt] ( -addfile | -add ) <file>+\n        [gopt] [ropt] [iopt] ( -rem"
 & "ove  | -rm ) <file>+\n        [gopt] [ -branch | -b ] -tag <tag>\n     "
 & "   [gopt] ( -vclist            | -vcl )\n        [gopt] ( -uptodate    "
 & "      | -utd )\n        [gopt] ( -modified          | -mod )\n        ["
 & "gopt] ( -conflicts         | -con )\n        [gopt] ( -showtags        "
 & "  | -tags ) [ tag-prefix ]\n        [gopt] ( -isrelease         | -isre"
 & "l )\n        [gopt] ( -isreleasebranch   | -isrelb | -irb )\n        [g"
 & "opy] ( -currenttag        | -ct )\n        [gopt] ( -lastreleasetag    "
 & "| -lrt    | -lastreleasebranch | -lrb )\n        [gopt] ( -currentstick"
 & "ytags | -cst )\n        [gopt] ( -currentreleasetag | -crt )\n        ["
 & "gopt] ( -lastdeveltag      | -ldt    | -currentdeveltag   | -cdt )\n   "
 & "     [gopt] ( -nextreleasetag    | -nrt ) ( major | minor | patch )\n  "
 & "      [gopt] ( -nextdeveltag      | -ndt ) ( major | minor | patch )\n "
 & "       [gopt] ( -status      | -stat )\n        [gopt] ( -shortstatus |"
 & " -sstat )\n        [gopt] ( -listlabels  | -labels )\n        [gopt] ( "
 & "-listlabel   | -getlabel ) [ <tag> ]\n        [gopt] ( -label       | -"
 & "setlabel ) <tag> <label>\n        [gopt] [ropt] ( -ed";

CONST E0_0 =
   "it            | -lock ) <file|dir>*\n        [gopt] [ropt] ( -unedit   "
 & "       | -revert ) <file|dir>*\n        [gopt] [ropt] ( -showeditors   "
 & "  | -editors ) <file|dir>*\n        [gopt] [ropt] ( -strictlocking   | "
 & "-strict ) <file|dir>*\n        [gopt] [ropt] ( -nostrictlocking | -nost"
 & "rict ) <file|dir>*\n\n  gopt ::= -v | -q | -n | -l  ; verbose | quite |"
 & " no action | long list\n        |  -usegui | -nostdin ; don\'t use stdi"
 & "n for confirmations\n\n  copt ::= ( -message | -msg | -m )  \"log messa"
 & "ge\"\n        |  ( -file    | -f )         file-containing-log-message\n"
 & "\n  ropt ::= -recursive | -r\n\n  iopt ::= -interactive | -i\n\n  bopt "
 & "::= -binary | -bin\n\nSEMANTICS\n\n  Pkgvm is the standalone version ma"
 & "nager of Elego ComPact for\n  C/C++/Modula-3 and other software package"
 & "s. It implements all the\n  procedures needed for the development and m"
 & "aintenance of software\n  packages by a group of developers.\n  \n  Pkg"
 & "vm automatically detects the root directory of a software package and\n"
 & "  its name (by trying to locate an m3makefile or PkgDesc file). It then"
 & "\n  applies version control actions to the whole package as one entity."
 & "\n  Conceptually, pkgvm is independent of the underlying version contro"
 & "l\n  system (if certain requirements are fulfilled). Currently, only CV"
 & "S\n  is supported (more version control systems will be supported in \n"
 & "  future releases).\n\n  --- DEVELOPMENT MODEL ---\n\n  Pkgvm uses `tag"
 & "s\' to label all revisions of all elements of a package\n  that togethe"
 & "r form releases or development snapshots. Theses tags are\n  of the for"
 & "m\n\n    devel_<pkgname>_<major>_<minor>_<patchlevel>\n    release_<pkg"
 & "name>_<major>_<minor>_<patchlevel>\n    release_<pkgname>_<major>_<mino"
 & "r>_stable\n\n  The tag `head\' always refers to the head of the main de"
 & "velopment\n  trunk. There are some more special tag names:\n    top,\n "
 & "   topoftrunk,\n    headoftrunk,\n    top-of-trunk,\n    head-of-trunk "
 & "        = top of development trunk (= head)\n\n    tip,\n    tipofbranc"
 & "h,\n    tip-of-branch,\n    headofbranch,\n    head-of-branch        = ";

CONST E0_1 =
   "tip of the current release branch \n                            (if the"
 & " package is checkd out on one)\n    lasttip,\n    last-tip,\n    latest"
 & "tip,\n    latest-tip,\n    lastreleasebranch,\n    last-release-branch,"
 & "\n    latestreleasebranch,\n    latest-release-branch = tip of the late"
 & "st release branch\n \n  Additionally, the following tags are reserved f"
 & "or future version\n  control purposes:\n\n    alpha_<pkgname>_<major>_<"
 & "minor>_<patchlevel>\n    beta_<pkgname>_<major>_<minor>_<patchlevel>\n "
 & "   gamma_<pkgname>_<major>_<minor>_<patchlevel>\n    alpha_<pkgname>\n "
 & "   beta_<pkgname>\n    gamma_<pkgname>\n\n  Several threads of tags for"
 & "m the ordinary development history.\n  Development tags are used to lab"
 & "el important development phases,\n  release tags and stable release bra"
 & "nches are used to label ongoing\n  work on releases:\n\n    devel_pkg_0"
 & "_0_0\n           |\n           V\n    devel_pkg_0_0_1\n           |\n  "
 & "         V\n    devel_pkg_0_0_2\n           |\n           V\n    devel_"
 & "pkg_0_1_0\n           |\n           V\n    devel_pkg_0_1_1\n           "
 & "|\n           V\n    devel_pkg_0_2_0\n           |\n           V\n    d"
 & "evel_pkg_0_2_1 = release_pkg_0_1_0 \n           |            -> release"
 & "_pkg_0_1_1 \n           |               -> release_pkg_0_1_2\n         "
 & "  |                  = release_pkg_0_1_stable (tip)\n           V\n    "
 & "devel_pkg_0_3_0\n           |\n           V\n    devel_pkg_0_3_1\n     "
 & "      |\n           V\n    devel_pkg_0_3_2\n           |\n           V\n"
 & "    devel_pkg_0_3_3 = release_pkg_1_0_0 \n           |            -> re"
 & "lease_pkg_1_0_1\n           |               = release_pkg_1_0_stable = "
 & "lasttip (tip)\n           V\n          head\n\n  --- LOCKING ---\n\n  E"
 & "lego ComPact basically features free concurrent development for all\n  "
 & "mergeable files, which means that files are not locked while\n  somebod"
 & "y is working on them in her/his workspace. Experience shows\n  that ser"
 & "ious conflicts arise very rarely, and most conflicts can be\n  easily s"
 & "olved. As this is not true for binary and other non-mergable\n  files, "
 & "Elego ComPa";

CONST E0_2 =
   "ct now defaults to strict locking for all files\n  that have been check"
 & "ed-in as `binary\'. Additionally, any other files\n  or directories can"
 & " be subjected to strict locking explicitly telling\n  ComPact to do so."
 & "\n\n  All files which are subject to strict locking are checked-out\n  "
 & "without write permissions, and may only be changed after the `edit\'\n "
 & " or `lock\' command. The `commit\' and `release\' commands will clear\n"
 & "  the lock and again set the file readonly. Changes can also be\n  aban"
 & "doned by using `revert\' or `unedit\'.\n\n  The locking behaviour can b"
 & "e controlled by the configuration\n  variable `vc-locking\' in the comp"
 & "actrc file, which may be set to\n  one of the following values: none|la"
 & "zy, binary|default, all|strict.\n\n  --- COMMANDS ---\n\n  The followin"
 & "g commands may be used to manage the versioning of\n  software packages"
 & ":\n\n   -newcollection\n     create a new (empty) `collection\' of pack"
 & "ages, that is a new \n     directory to contain packages under version "
 & "control\n\n   -newpackage     \n     create a new empty package inside "
 & "an existing collection.\n     This package has the following structure:"
 & "\n      <package-name>/src             sub-directory for sources\n     "
 & "               /PkgTags         empty tags file\n\n     To create other"
 & " kinds of packages you must use the\n     comprehensive package manager"
 & " pkgm.\n\n   -checkout \n     checkout one ore more packages from the C"
 & "VS repository. \n     The package names on the command line are relativ"
 & "e to the\n     environment variable PRJ_ROOT if no collection is specif"
 & "ied\n     on the command line. <tag> may have the special value `head\'"
 & ".\n     If only a tag and a collection are specified on the command lin"
 & "e\n     but no package, the whole collection is checked out.\n\n   -upd"
 & "ate <tag>\n     All changes made to the repository on the currently che"
 & "cked-out branch\n     since the last update are merged into the local w"
 & "orkspace for the\n     package. <tag> may have the special value `head\'"
 & ".\n\n   -merge <tag1> [<tag2>]\n     (1) Merge in all new changes fro";

CONST E0_3 =
   "m the release branch identified by tag\n         <tag1>. Tag the new me"
 & "rge point with a merge tag for the next\n         merge from this branc"
 & "h.\n     (2) Merge the differences between versions identified by <tag1"
 & ">\n         and <tag2> into the current workspace.\n\n   -log <file>*\n"
 & "     Show the package log, i.e. all commit and release messages\n     o"
 & "f the package. Additional log options: any combination of\n     T (tags"
 & ", header), R (revisions), L (log message)\n\n   -cvslog <file>*\n     S"
 & "how the original CVS log.\n\n   -diff  [<tag1> <tag2>]\n   -cdiff [<tag"
 & "1> <tag2>]\n   -udiff [<tag1> <tag2>]\n     Produce a diff-listing eith"
 & "er between the checked-out version and\n     the local workspace or bet"
 & "ween versions identified by <tag1> and\n     <tag2>. Cdiff produces a c"
 & "ontext diff, udiff a unified context diff.\n\n   -annotate <file>+\n   "
 & "  Produce an annotated listing of one or more files, which\n     states"
 & " the origin of every line of the file(s).\n\n   -commit ( major | minor"
 & " | patch )\n     If the whole package is up-to-date, then all local add"
 & "itions, changes,\n     removals are committed to the repository. After "
 & "a successful commit,\n     a development tag is put onto the whole pack"
 & "age.\n\n   -release ( major | minor | patch )\n     If the whole packag"
 & "e is up-to-date, then all local additions, changes,\n     removals are "
 & "committed to the repository. After a successful commit,\n     a release"
 & " tag is put onto the whole package.\n     If the commit is a new major "
 & "or minor release, a new stable release\n     branch is created. If it i"
 & "s a patch to an existing release, this\n     patch will be committed to"
 & " a stable release branch.\n\n   -add <file>+\n     Add the given files "
 & "or directories to the CVS repository. Objects\n     named `CVS\' are al"
 & "ways ignored. If -r is specified, all directories\n     will be inspect"
 & "ed recursively for elements to add. If -i is\n     specified, the user "
 & "will be asked for confirmation before each \n     addition takes place."
 & "\n\n   -remove <file>+\n     Remove the given files or dire";

CONST E0_4 =
   "ctories from the CVS repository and from \n     the local workspace. Ob"
 & "jects named `CVS\' are always ignored. Directories\n     are not actual"
 & "ly removed, since this cannot be done using CVS.\n     If -r is specifi"
 & "ed, all directories will be inspected recursively for \n     elements t"
 & "o be removed. If -i is specified, the user will be asked \n     for con"
 & "firmation before each removal takes place.\n\n   -tag <tag>\n     Put t"
 & "he given `tag\' on all elements of the package. `Tag\' must be\n     of"
 & " an approved form and it must not exist on any element of the\n     pac"
 & "kage.\n\n   -edit <file|dir>*\n   -lock <file|dir>*\n     Lock a file s"
 & "ubject to strict locking and make it writable for\n     editing. If no "
 & "file is given, all files in the package are locked.\n     If any file o"
 & "r directory is given, only the specified objects are\n     concerned an"
 & "d recursion must be explicitly requested with the -r\n     option. The "
 & "lock will be removed by the -commit, -release, and\n     -revert comman"
 & "ds. -edit also tries to call an appropriate editor\n     based on the s"
 & "ettings of the httpd-editor-EXT, httpd-editor, \n     editor variables "
 & "in compactrc and the filename-editor-mapping.\n\n   -unedit <file|dir>*"
 & "\n   -revert <file|dir>*\n     Unlock a file subject to strict locking,"
 & " revert all local\n     modifications, and make it readonly again.\n   "
 & "  If no file is given, all files in the package are reverted.\n     If "
 & "any file or directory is given, only the specified objects are\n     co"
 & "ncerned and recursion must be explicitly requested with the -r\n     op"
 & "tion. \n\n   -editors <file|dir>*\n     Show a list of all users who ha"
 & "ve locked the specified object(s)\n     for editing. If only one object"
 & " is concerned and noone has\n     bypassed the Elego ComPact locking me"
 & "chanism, the result will be\n     no or exactly one user.\n     The sam"
 & "e files as explained for the -edit and -revert commands\n     are conce"
 & "rned.\n\n   -strictlocking <file|dir>*\n     Make the specified files a"
 & "nd directories subject to strict\n     locking, i.e. they";

CONST E0_5 =
   " will be checked out readonly until explicitly\n     locked for editing"
 & ". \n     The same files as explained for the -edit and -revert commands"
 & "\n     are concerned.\n\n   -nostrictlocking <file|dir>*\n     Make the"
 & " specified files and directories subject to lazy\n     locking, i.e. th"
 & "ey will always be writable by anyone.\n     The same files as explained"
 & " for the -edit and -revert commands\n     are concerned.\n\n  The follo"
 & "wing commands produce information about the current state\n  of the sof"
 & "tware package:\n\n   -vclist\n     List all files known to be under ver"
 & "sion control.\n\n   -modified\n     Exits TRUE (0) if no elements of th"
 & "e local workspace are modified\n     compared to the repository, FALSE "
 & "else.\n     List all modified, added, removed, conflicting, and unknown"
 & " elements\n     on stdout.\n\n   -uptodate\n     Exits TRUE (0) if all "
 & "elements of the local workspace are up-to-date\n     compared to the re"
 & "pository, FALSE else.\n     List all modified, added, removed, conflict"
 & "ing, and unknown elements\n     on stdout.\n\n   -conflicts\n     Exits"
 & " TRUE (0) if any elements of the local workspace are in conflict\n     "
 & "with the repository, FALSE else.\n     List all modified, added, remove"
 & "d, conflicting, and unknown elements\n     on stdout.\n\n   -isrelease\n"
 & "     Exits TRUE (0) if the local package is checked out as a release.\n"
 & "     The appropriate tag is written to stdout.\n\n   -isreleasebranch\n"
 & "     Exits TRUE (0) if the local package is checked out on a release\n "
 & "    branch. The appropriate tag is written to stdout.\n\n   -lastreleas"
 & "etag, -lastreleasebranch\n     Write the tag of the last release branch"
 & " to stdout.\n\n   -nextreleasetag ( major | minor | patch )\n     Write"
 & " the corresponding next release tag to stdout.\n\n   -nextdeveltag ( ma"
 & "jor | minor | patch )\n     Write the corresponding next development ta"
 & "g to stdout.\n\n   -tags [ <prefix> ]\n     List all tags of the curren"
 & "t package that begin with `prefix\', if\n     given, all tags by defaul"
 & "t.\n\n   -currentstickytags\n     List the sticky tags the package is";

CONST E0_6 =
   " checked out with.\n\n   -currentreleasetag\n     Show the release tag "
 & "the package is checked out with.\n\n   -lastdeveltag, -currentdeveltag\n"
 & "     Show the last used (current) development tag.\n\n   -currenttag\n "
 & "    Write the current tag of the package, which is either\n      (a) a "
 & "release branch tag (b) a sticky release tag\n      (c) any other sticky"
 & " tag, like an old development tag or\n      (d) the current development"
 & " tag.\n\n   -stat\n     Show a summary of all of the above.\n\n  Finall"
 & "y, the following commands display some information about\n  the pkgvm p"
 & "rogram:\n\n   -version\n     Display the pkgvm release version and lice"
 & "nse number.\n\n   -copyright\n     Display copyright information.\n\n  "
 & "--- VERSION CONTROL CONFIGURATION SETTINGS ---\n\n  The following varia"
 & "bles from the compactrc file are evaluated by the\n  version control ba"
 & "ckend:\n\n  editor          \"path to your preferred editor\"\n  reposi"
 & "tory      \"[:method:][user@]hostname:/path/to/repository\"\n  cvspath "
 & "        \"/path/to/cvs\"\n  user            \"username override\"\n  vc"
 & "-ignore       \"*~ *.bak *.obj *.o *.a\"\n  vc-options      \"prune|nop"
 & "rune|create|nocreate\"\n  vc-locking      \"none|lazy|binary|default|al"
 & "l|strict\"\n\n  --- INITIALIZATION AND RESOURCES ---\n\n  The version m"
 & "anager reads the same global `compactrc\' configuration\n  resources as"
 & " the package manager `pkgm\'. To learn more about the\n  process of loc"
 & "ating and evaluating these resources, type `pkgm\n  -man\'. \n\nBUGS\n\n"
 & " o Creating new packages is implemented in a very simple way in pkgvm.\n"
 & "   You must use pkgm to create packages of different kinds.\n\n o Proba"
 & "bly many more.\n\nVERSION\n\n This manual describes the pkgvm tool as p"
 & "rovided in Elego ComPact\n Release 1.2.\n\n To obtain the release versi"
 & "on and license number of the pkgvm\n program, please run the command \""
 & "pkgvm -version\".\n\n";

CONST E1 =
   "\n# default settings for pkgvm (ComPact Version Manager)\n\ncvspath\t\t"
 & "\"cvs\"\nrepository\t\"/usr/cvs\"\neditor\t\t\"emacsclient\"\n";

CONST E2 =
   "NAME\n\n  pkgvm  --  The Elego ComPact Version Manager\n\nSHORT DESCRIP"
 & "TION\n\n  Pkgvm is the standalone package version manager of Elego ComP"
 & "act,\n  which implements most of the functions of pkgm concerned with\n"
 & "  version control of single packages, but without the overhead of the\n"
 & "  complex ComPact build system.\n\nUSE\n\n  pkgvm -update (head | other"
 & "-symbolic-revision-name)\n    gets the named version from the repositor"
 & "y to the local workspace\n\n  pkgvm -commit  (major | minor | patch)\n "
 & " pkgvm -release (major | minor | patch)\n    to commit changes as a new"
 & " development version or as a release\n\n  pkgvm ([-TRL|-TR|-TL|-RL|-T|-"
 & "R|-L] -log | -cvslog) <file>*\n    to view the change history of the pa"
 & "ckage (or some file(s))\n\n  pkgvm (-modified | -uptodate | -conflicts)"
 & "\n    to list modified, up-to-date, or conflicting files\n  pkgvm (-sta"
 & "tus | -stat | -shortstatus | -sstat)\n    to display a comprehensive / "
 & "short version status of the package\n  pkgvm (-diff | -cdiff | -udiff) "
 & "[-t <tag1> -t <tag2>] <file>+\n    to view differences between versions"
 & " of particular/all files\n\n  pkgvm (-annotate | -ann) <file>+\n    to "
 & "get an annotated listing of one or more files\n\n  pkgvm ( -newcollecti"
 & "on | -newcol | -newc ) <pathname>\n    to create a new collection of pa"
 & "ckages\n  pkgvm ( -newpackage    | -newpkg | -newp ) <package-name>+\n "
 & "   to create one or more new packages\n  pkgvm [ -c <collection> ] ( -c"
 & "heckout | -co ) <tag> <pkgname>*\n    to checkout a package from the re"
 & "pository for the first time\n\n  pkgvm [-r][-i] (-add | -rm) <file>+\n "
 & "   to add / remove files to / from the package (recursively)(interactiv"
 & "ely)\n  pkgvm -vclist\n    to list all files under version control\n\n "
 & " pkgvm [-r] (-edit | -lock) <file|dir>*\n    to lock objects subject to"
 & " strict locking for editing\n\n  pkgvm [-r] (-unedit | -revert) <file|d"
 & "ir>*\n    to unlock objects subject to strict locking and abandon all c"
 & "hanges\n\n  pkgvm [-r] -editors  <file|dir>*\n    to list all editors o"
 & "f objects subject to strict locking\n\n  pkgvm [-r] (-strictlockin";

CONST E2_0 =
   "g | -nostrictlocking) <file|dir>*\n    to explicitly enable or disable "
 & "strict locking\n\n  pkgvm (-man | -desc) \n    to get a thorough descri"
 & "ption of all commands and options\n\n  pkgvm -copyright\n    to display"
 & " the pkgvm copyright\n\n  pkgvm -version\n    to display the pkgvm rele"
 & "ase version and license number\n\nFILES AND RESOURCES\n\n  ~/.compactrc"
 & ", ~/compact/compactrc  -- global configuration\n  PkgDesc              "
 & "              -- package description file\n  pkgconf.cbcl              "
 & "         -- ComPact backend configuration\n  PkgBase.DefaultData       "
 & "         -- package kind/structure definition\n";

BEGIN
END PkgVMBundle.