home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / aegis-2.1 / part06 < prev    next >
Text File  |  1993-09-24  |  157KB  |  6,695 lines

  1. Newsgroups: comp.sources.unix
  2. From: pmiller@bmr.gov.au (Peter Miller)
  3. Subject: v27i041: aegis - project change supervisor (V2.1), Part06/19
  4. References: <1.748951883.12788@gw.home.vix.com>
  5. Sender: unix-sources-moderator@gw.home.vix.com
  6. Approved: vixie@gw.home.vix.com
  7.  
  8. Submitted-By: pmiller@bmr.gov.au (Peter Miller)
  9. Posting-Number: Volume 27, Issue 41
  10. Archive-Name: aegis-2.1/part06
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 6 (of 19)."
  19. # Contents:  aegis/aena.c aegis/aend.c aegis/aeni.c aegis/aenrv.c
  20. #   aegis/aera.c aegis/aerd.c aegis/aeri.c aegis/aerrv.c aegis/lex.c
  21. #   common/trace.c doc/c1.3.so doc/c2.4.so doc/c4.2.so
  22. #   fmtgen/type_list.c man1/aegis.1 test/00/t0005a.sh
  23. #   test/00/t0008a.sh test/00/t0017a.sh
  24. # Wrapped by vixie@gw.home.vix.com on Sat Sep 25 03:00:35 1993
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f 'aegis/aena.c' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'aegis/aena.c'\"
  28. else
  29. echo shar: Extracting \"'aegis/aena.c'\" \(8357 characters\)
  30. sed "s/^X//" >'aegis/aena.c' <<'END_OF_FILE'
  31. X/*
  32. X *    aegis - project change supervisor
  33. X *    Copyright (C) 1991, 1992, 1993 Peter Miller.
  34. X *    All rights reserved.
  35. X *
  36. X *    This program is free software; you can redistribute it and/or modify
  37. X *    it under the terms of the GNU General Public License as published by
  38. X *    the Free Software Foundation; either version 2 of the License, or
  39. X *    (at your option) any later version.
  40. X *
  41. X *    This program is distributed in the hope that it will be useful,
  42. X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  43. X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  44. X *    GNU General Public License for more details.
  45. X *
  46. X *    You should have received a copy of the GNU General Public License
  47. X *    along with this program; if not, write to the Free Software
  48. X *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  49. X *
  50. X * MANIFEST: functions to implement new administrator
  51. X */
  52. X
  53. X#include <stdio.h>
  54. X#include <stdlib.h>
  55. X
  56. X#include <aena.h>
  57. X#include <ael.h>
  58. X#include <arglex2.h>
  59. X#include <commit.h>
  60. X#include <error.h>
  61. X#include <help.h>
  62. X#include <lock.h>
  63. X#include <option.h>
  64. X#include <os.h>
  65. X#include <project.h>
  66. X#include <trace.h>
  67. X#include <user.h>
  68. X#include <word.h>
  69. X
  70. X
  71. Xstatic void new_administrator_usage _((void));
  72. X
  73. Xstatic void
  74. Xnew_administrator_usage()
  75. X{
  76. X    char        *progname;
  77. X
  78. X    progname = option_progname_get();
  79. X    fprintf(stderr, "usage: %s -New_Administrator [ <option>... ] <username>...\n", progname);
  80. X    fprintf(stderr, "       %s -New_Administrator -List [ <option>... ]\n", progname);
  81. X    fprintf(stderr, "       %s -New_Administrator -Help\n", progname);
  82. X    quit(1);
  83. X}
  84. X
  85. X
  86. Xstatic void new_administrator_help _((void));
  87. X
  88. Xstatic void
  89. Xnew_administrator_help()
  90. X{
  91. X    static char *text[] =
  92. X    {
  93. X"NAME",
  94. X"    %s -New_Administrator - add a new administrator to a",
  95. X"    project",
  96. X"",
  97. X"SYNOPSIS",
  98. X"    %s -New_Administrator <user-name>... [ <option>... ]",
  99. X"    %s -New_Administrator -List [ <option>... ]",
  100. X"    %s -New_Administrator -Help",
  101. X"",
  102. X"DESCRIPTION",
  103. X"    The %s -New_Administrator command is used to add a new",
  104. X"    administrator to a project.",
  105. X"",
  106. X"OPTIONS",
  107. X"    The following options are understood:",
  108. X"",
  109. X"    -Help",
  110. X"        This option may be used to obtain more",
  111. X"        information about how to use the %s program.",
  112. X"",
  113. X"    -List",
  114. X"        This option may be used to obtain a list of",
  115. X"        suitable subjects for this command.  The list may",
  116. X"        be more general than expected.",
  117. X"",
  118. X"    -Project <name>",
  119. X"        This option may be used to select the project of",
  120. X"        interest.  When no -Project option is specified, the",
  121. X"        AEGIS_PROJECT environment variable is consulted.  If",
  122. X"        that does not exist, the user's $HOME/.aegisrc file",
  123. X"        is examined for a default project field (see",
  124. X"        aeuconf(5) for more information).  If that does not",
  125. X"        exist, when the user is only working on changes",
  126. X"        within a single project, the project name defaults",
  127. X"        to that project.  Otherwise, it is an error.",
  128. X"",
  129. X"    -TERse",
  130. X"        This option may be used to cause listings to",
  131. X"        produce the bare minimum of information.  It is",
  132. X"        usually useful for shell scripts.",
  133. X"",
  134. X"    -Verbose",
  135. X"        This option may be used to cause %s to produce",
  136. X"        more output.  By default %s only produces",
  137. X"        output on errors.  When used with the -List",
  138. X"        option this option causes column headings to be",
  139. X"        added.",
  140. X"",
  141. X"    All options may be abbreviated; the abbreviation is",
  142. X"    documented as the upper case letters, all lower case",
  143. X"    letters and underscores (_) are optional.  You must use",
  144. X"    consecutive sequences of optional letters.",
  145. X"",
  146. X"    All options are case insensitive, you may type them in",
  147. X"    upper case or lower case or a combination of both, case",
  148. X"    is not important.",
  149. X"",
  150. X"    For example: the arguments \"-project, \"-PROJ\" and \"-p\"",
  151. X"    are all interpreted to mean the -Project option.  The",
  152. X"    argument \"-prj\" will not be understood, because",
  153. X"    consecutive optional characters were not supplied.",
  154. X"",
  155. X"    Options and other command line arguments may be mixed",
  156. X"    arbitrarily on the command line, after the function",
  157. X"    selectors.",
  158. X"",
  159. X"    The GNU long option names are understood.  Since all",
  160. X"    option names for aegis are long, this means ignoring the",
  161. X"    extra leading '-'.  The \"--option=value\" convention is",
  162. X"    also understood.",
  163. X"",
  164. X"RECOMMENDED ALIAS",
  165. X"    The recommended alias for this command is",
  166. X"    csh%%    alias aena '%s -na \\!* -v'",
  167. X"    sh$    aena(){%s -na $* -v}",
  168. X"",
  169. X"ERRORS",
  170. X"    It is an error if the current user is not an",
  171. X"    administrator of the project.",
  172. X"    It is an error if any of the named users have a uid of",
  173. X"    less than 100.",
  174. X"",
  175. X"EXIT STATUS",
  176. X"    The %s command will exit with a status of 1 on any",
  177. X"    error.  The %s command will only exit with a status of",
  178. X"    0 if there are no errors.",
  179. X"",
  180. X"COPYRIGHT",
  181. X"    %C",
  182. X"",
  183. X"AUTHOR",
  184. X"    %A",
  185. X    };
  186. X
  187. X    help(text, SIZEOF(text), new_administrator_usage);
  188. X}
  189. X
  190. X
  191. Xstatic void new_administrator_list _((void));
  192. X
  193. Xstatic void
  194. Xnew_administrator_list()
  195. X{
  196. X    string_ty    *project_name;
  197. X
  198. X    trace(("new_administrator_list()\n{\n"/*}*/));
  199. X    arglex();
  200. X    project_name = 0;
  201. X    while (arglex_token != arglex_token_eoln)
  202. X    {
  203. X        switch (arglex_token)
  204. X        {
  205. X        default:
  206. X            generic_argument(new_administrator_usage);
  207. X            continue;
  208. X
  209. X        case arglex_token_project:
  210. X            if (arglex() != arglex_token_string)
  211. X                new_administrator_usage();
  212. X            if (project_name)
  213. X                fatal("duplicate -Project option");
  214. X            project_name = str_from_c(arglex_value.alv_string);
  215. X            break;
  216. X        }
  217. X        arglex();
  218. X    }
  219. X    list_administrators(project_name, 0);
  220. X    if (project_name)
  221. X        str_free(project_name);
  222. X    trace((/*{*/"}\n"));
  223. X}
  224. X
  225. X
  226. Xstatic void new_administrator_main _((void));
  227. X
  228. Xstatic void
  229. Xnew_administrator_main()
  230. X{
  231. X    wlist        wl;
  232. X    string_ty    *s1;
  233. X    pstate        pstate_data;
  234. X    int        j;
  235. X    string_ty    *project_name;
  236. X    project_ty    *pp;
  237. X    user_ty        *up;
  238. X
  239. X    trace(("new_administrator_main()\n{\n"/*}*/));
  240. X    wl_zero(&wl);
  241. X    project_name = 0;
  242. X    while (arglex_token != arglex_token_eoln)
  243. X    {
  244. X        switch (arglex_token)
  245. X        {
  246. X        default:
  247. X            generic_argument(new_administrator_usage);
  248. X            continue;
  249. X
  250. X        case arglex_token_string:
  251. X            s1 = str_from_c(arglex_value.alv_string);
  252. X            if (wl_member(&wl, s1))
  253. X                fatal("user \"%s\" named more than once", s1->str_text);
  254. X            wl_append(&wl, s1);
  255. X            str_free(s1);
  256. X            break;
  257. X
  258. X        case arglex_token_project:
  259. X            if (arglex() != arglex_token_string)
  260. X                new_administrator_usage();
  261. X            if (project_name)
  262. X                fatal("duplicate -Project option");
  263. X            project_name = str_from_c(arglex_value.alv_string);
  264. X            break;
  265. X        }
  266. X        arglex();
  267. X    }
  268. X    if (!wl.wl_nwords)
  269. X        fatal("no users named");
  270. X
  271. X    /*
  272. X     * locate project data
  273. X     */
  274. X    if (!project_name)
  275. X        project_name = user_default_project();
  276. X    pp = project_alloc(project_name);
  277. X    str_free(project_name);
  278. X    project_bind_existing(pp);
  279. X
  280. X    /*
  281. X     * locate user data
  282. X     */
  283. X    up = user_executing(pp);
  284. X
  285. X    /*
  286. X     * lock the project for change
  287. X     */
  288. X    project_pstate_lock_prepare(pp);
  289. X    lock_take();
  290. X    pstate_data = project_pstate_get(pp);
  291. X
  292. X    /*
  293. X     * check they are allowed to do this
  294. X     */
  295. X    if (!project_administrator_query(pp, user_name(up)))
  296. X    {
  297. X        project_fatal
  298. X        (
  299. X            pp,
  300. X            "user \"%S\" is not an administrator",
  301. X            user_name(up)
  302. X        );
  303. X    }
  304. X
  305. X    /*
  306. X     * check they they are OK users
  307. X     */
  308. X    for (j = 0; j < wl.wl_nwords; ++j)
  309. X    {
  310. X        user_ty        *candidate;
  311. X
  312. X        /*
  313. X         * make sure the user isn't already there
  314. X         */
  315. X        candidate = user_symbolic(pp, wl.wl_word[j]);
  316. X        if (project_administrator_query(pp, user_name(candidate)))
  317. X        {
  318. X            project_fatal
  319. X            (
  320. X                pp,
  321. X                "user \"%S\" is already an administrator",
  322. X                user_name(candidate)
  323. X            );
  324. X        }
  325. X
  326. X        /*
  327. X         * make sure the user exists
  328. X         *    (should we check s/he is in the project's group?)
  329. X         * this is to avoid security holes
  330. X         */
  331. X        if (!user_uid_check(user_name(candidate)))
  332. X        {
  333. X            fatal
  334. X            (
  335. X                "user \"%s\" is too privileged",
  336. X                user_name(candidate)->str_text
  337. X            );
  338. X        }
  339. X
  340. X        /*
  341. X         * add it to the list
  342. X         */
  343. X        project_administrator_add(pp, user_name(candidate));
  344. X        user_free(candidate);
  345. X    }
  346. X
  347. X    /*
  348. X     * write out and release lock
  349. X     */
  350. X    project_pstate_write(pp);
  351. X    commit();
  352. X    lock_release();
  353. X
  354. X    /*
  355. X     * verbose success message
  356. X     */
  357. X    for (j = 0; j < wl.wl_nwords; ++j)
  358. X    {
  359. X        project_verbose
  360. X        (
  361. X            pp,
  362. X            "user \"%S\" is now an administrator",
  363. X            wl.wl_word[j]
  364. X        );
  365. X    }
  366. X    project_free(pp);
  367. X    user_free(up);
  368. X    trace((/*{*/"}\n"));
  369. X}
  370. X
  371. X
  372. Xvoid
  373. Xnew_administrator()
  374. X{
  375. X    trace(("new_administrator()\n{\n"/*}*/));
  376. X    switch (arglex())
  377. X    {
  378. X    default:
  379. X        new_administrator_main();
  380. X        break;
  381. X
  382. X    case arglex_token_help:
  383. X        new_administrator_help();
  384. X        break;
  385. X
  386. X    case arglex_token_list:
  387. X        new_administrator_list();
  388. X        break;
  389. X    }
  390. X    trace((/*{*/"}\n"));
  391. X}
  392. END_OF_FILE
  393. if test 8357 -ne `wc -c <'aegis/aena.c'`; then
  394.     echo shar: \"'aegis/aena.c'\" unpacked with wrong size!
  395. fi
  396. # end of 'aegis/aena.c'
  397. fi
  398. if test -f 'aegis/aend.c' -a "${1}" != "-c" ; then 
  399.   echo shar: Will not clobber existing file \"'aegis/aend.c'\"
  400. else
  401. echo shar: Extracting \"'aegis/aend.c'\" \(8112 characters\)
  402. sed "s/^X//" >'aegis/aend.c' <<'END_OF_FILE'
  403. X/*
  404. X *    aegis - project change supervisor
  405. X *    Copyright (C) 1991, 1992, 1993 Peter Miller.
  406. X *    All rights reserved.
  407. X *
  408. X *    This program is free software; you can redistribute it and/or modify
  409. X *    it under the terms of the GNU General Public License as published by
  410. X *    the Free Software Foundation; either version 2 of the License, or
  411. X *    (at your option) any later version.
  412. X *
  413. X *    This program is distributed in the hope that it will be useful,
  414. X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  415. X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  416. X *    GNU General Public License for more details.
  417. X *
  418. X *    You should have received a copy of the GNU General Public License
  419. X *    along with this program; if not, write to the Free Software
  420. X *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  421. X *
  422. X * MANIFEST: functions to implement new developer
  423. X */
  424. X
  425. X#include <stdio.h>
  426. X#include <stdlib.h>
  427. X
  428. X#include <ael.h>
  429. X#include <aend.h>
  430. X#include <arglex2.h>
  431. X#include <commit.h>
  432. X#include <error.h>
  433. X#include <help.h>
  434. X#include <lock.h>
  435. X#include <option.h>
  436. X#include <os.h>
  437. X#include <project.h>
  438. X#include <trace.h>
  439. X#include <user.h>
  440. X#include <word.h>
  441. X
  442. X
  443. Xstatic void new_developer_usage _((void));
  444. X
  445. Xstatic void
  446. Xnew_developer_usage()
  447. X{
  448. X    char        *progname;
  449. X
  450. X    progname = option_progname_get();
  451. X    fprintf(stderr, "usage: %s -New_Developer <username>... [ <option>... ]\n", progname);
  452. X    fprintf(stderr, "       %s -New_Developer -List [ <option>... ]\n", progname);
  453. X    fprintf(stderr, "       %s -New_Developer -Help\n", progname);
  454. X    quit(1);
  455. X}
  456. X
  457. X
  458. Xstatic void new_developer_help _((void));
  459. X
  460. Xstatic void
  461. Xnew_developer_help()
  462. X{
  463. X    static char *text[] =
  464. X    {
  465. X"NAME",
  466. X"    %s -New_Developer - add new developers to a project",
  467. X"",
  468. X"SYNOPSIS",
  469. X"    %s -New_Developer <username>... [ <option>... ]",
  470. X"    %s -New_Developer -List [ <option>... ]",
  471. X"    %s -New_Developer -Help",
  472. X"",
  473. X"DESCRIPTION",
  474. X"    The %s -New_Developer command is used to add new",
  475. X"    developers to a project.",
  476. X"",
  477. X"OPTIONS",
  478. X"    The following options are understood:",
  479. X"",
  480. X"    -Help",
  481. X"        This option may be used to obtain more",
  482. X"        information about how to use the %s program.",
  483. X"",
  484. X"    -List",
  485. X"        This option may be used to obtain a list of",
  486. X"        suitable subjects for this command.  The list may",
  487. X"        be more general than expected.",
  488. X"",
  489. X"    -Project <name>",
  490. X"        This option may be used to select the project of",
  491. X"        interest.  When no -Project option is specified, the",
  492. X"        AEGIS_PROJECT environment variable is consulted.  If",
  493. X"        that does not exist, the user's $HOME/.aegisrc file",
  494. X"        is examined for a default project field (see",
  495. X"        aeuconf(5) for more information).  If that does not",
  496. X"        exist, when the user is only working on changes",
  497. X"        within a single project, the project name defaults",
  498. X"        to that project.  Otherwise, it is an error.",
  499. X"",
  500. X"    -TERse",
  501. X"        This option may be used to cause listings to",
  502. X"        produce the bare minimum of information.  It is",
  503. X"        usually useful for shell scripts.",
  504. X"",
  505. X"    -Verbose",
  506. X"        This option may be used to cause %s to produce",
  507. X"        more output.  By default %s only produces",
  508. X"        output on errors.  When used with the -List",
  509. X"        option this option causes column headings to be",
  510. X"        added.",
  511. X"",
  512. X"    All options may be abbreviated; the abbreviation is",
  513. X"    documented as the upper case letters, all lower case",
  514. X"    letters and underscores (_) are optional.  You must use",
  515. X"    consecutive sequences of optional letters.",
  516. X"",
  517. X"    All options are case insensitive, you may type them in",
  518. X"    upper case or lower case or a combination of both, case",
  519. X"    is not important.",
  520. X"",
  521. X"    For example: the arguments \"-project, \"-PROJ\" and \"-p\"",
  522. X"    are all interpreted to mean the -Project option.  The",
  523. X"    argument \"-prj\" will not be understood, because",
  524. X"    consecutive optional characters were not supplied.",
  525. X"",
  526. X"    Options and other command line arguments may be mixed",
  527. X"    arbitrarily on the command line, after the function",
  528. X"    selectors.",
  529. X"",
  530. X"    The GNU long option names are understood.  Since all",
  531. X"    option names for aegis are long, this means ignoring the",
  532. X"    extra leading '-'.  The \"--option=value\" convention is",
  533. X"    also understood.",
  534. X"",
  535. X"RECOMMENDED ALIAS",
  536. X"    The recommended alias for this command is",
  537. X"    csh%%    alias aend '%s -nd \\!* -v'",
  538. X"    sh$    aend(){%s -nd $* -v}",
  539. X"",
  540. X"ERRORS",
  541. X"    It is an error if the current user is not an",
  542. X"    administrator of the project.",
  543. X"",
  544. X"EXIT STATUS",
  545. X"    The %s command will exit with a status of 1 on any",
  546. X"    error.    The %s command will only exit with a status of",
  547. X"    0 if there are no errors.",
  548. X"",
  549. X"COPYRIGHT",
  550. X"    %C",
  551. X"",
  552. X"AUTHOR",
  553. X"    %A",
  554. X    };
  555. X
  556. X    help(text, SIZEOF(text), new_developer_usage);
  557. X}
  558. X
  559. X
  560. Xstatic void new_developer_list _((void (*)(void)));
  561. X
  562. Xstatic void
  563. Xnew_developer_list(usage)
  564. X    void        (*usage)_((void));
  565. X{
  566. X    string_ty    *project_name;
  567. X
  568. X    trace(("new_developer_list()\n{\n"/*}*/));
  569. X    arglex();
  570. X    project_name = 0;
  571. X    while (arglex_token != arglex_token_eoln)
  572. X    {
  573. X        switch (arglex_token)
  574. X        {
  575. X        default:
  576. X            generic_argument(usage);
  577. X            continue;
  578. X
  579. X        case arglex_token_project:
  580. X            if (arglex() != arglex_token_string)
  581. X                usage();
  582. X            if (project_name)
  583. X                fatal("duplicate -Project option");
  584. X            project_name = str_from_c(arglex_value.alv_string);
  585. X            break;
  586. X        }
  587. X        arglex();
  588. X    }
  589. X    list_developers(project_name, 0);
  590. X    trace((/*{*/"}\n"));
  591. X}
  592. X
  593. X
  594. Xstatic void new_developer_main _((void));
  595. X
  596. Xstatic void
  597. Xnew_developer_main()
  598. X{
  599. X    wlist        wl;
  600. X    string_ty    *s1;
  601. X    pstate        pstate_data;
  602. X    int        j;
  603. X    string_ty    *project_name;
  604. X    project_ty    *pp;
  605. X    user_ty        *up;
  606. X
  607. X    trace(("new_developer_main()\n{\n"/*}*/));
  608. X    wl_zero(&wl);
  609. X    project_name = 0;
  610. X    while (arglex_token != arglex_token_eoln)
  611. X    {
  612. X        switch (arglex_token)
  613. X        {
  614. X        default:
  615. X            generic_argument(new_developer_usage);
  616. X            continue;
  617. X
  618. X        case arglex_token_string:
  619. X            s1 = str_from_c(arglex_value.alv_string);
  620. X            if (wl_member(&wl, s1))
  621. X                fatal("user \"%s\" named more than once", s1->str_text);
  622. X            wl_append(&wl, s1);
  623. X            str_free(s1);
  624. X            break;
  625. X
  626. X        case arglex_token_project:
  627. X            if (arglex() != arglex_token_string)
  628. X                new_developer_usage();
  629. X            if (project_name)
  630. X                fatal("duplicate -Project option");
  631. X            project_name = str_from_c(arglex_value.alv_string);
  632. X            break;
  633. X        }
  634. X        arglex();
  635. X    }
  636. X    if (!wl.wl_nwords)
  637. X        fatal("no users named");
  638. X
  639. X    /*
  640. X     * locate project data
  641. X     */
  642. X    if (!project_name)
  643. X        project_name = user_default_project();
  644. X    pp = project_alloc(project_name);
  645. X    str_free(project_name);
  646. X    project_bind_existing(pp);
  647. X
  648. X    /*
  649. X     * locate user data
  650. X     */
  651. X    up = user_executing(pp);
  652. X
  653. X    /*
  654. X     * lock the project for change
  655. X     */
  656. X    project_pstate_lock_prepare(pp);
  657. X    lock_take();
  658. X    pstate_data = project_pstate_get(pp);
  659. X
  660. X    /*
  661. X     * check they are allowed to do this
  662. X     */
  663. X    if (!project_administrator_query(pp, user_name(up)))
  664. X    {
  665. X        project_fatal
  666. X        (
  667. X            pp,
  668. X            "user \"%S\" is not an administrator",
  669. X            user_name(up)
  670. X        );
  671. X    }
  672. X
  673. X    /*
  674. X     * check they they are OK users
  675. X     */
  676. X    for (j = 0; j < wl.wl_nwords; ++j)
  677. X    {
  678. X        user_ty        *candidate;
  679. X
  680. X        /*
  681. X         * make sure the user isn't already there
  682. X         */
  683. X        candidate = user_symbolic(pp, wl.wl_word[j]);
  684. X        if (project_developer_query(pp, user_name(candidate)))
  685. X        {
  686. X            project_fatal
  687. X            (
  688. X                pp,
  689. X                "user \"%S\" is already a developer",
  690. X                user_name(candidate)
  691. X            );
  692. X        }
  693. X
  694. X        /*
  695. X         * make sure the user exists
  696. X         *    (should we chech s/he is in the project's group?)
  697. X         * this is to avoid security holes
  698. X         */
  699. X        if (!user_uid_check(user_name(candidate)))
  700. X        {
  701. X            fatal
  702. X            (
  703. X                "user \"%s\" is too privileged",
  704. X                user_name(candidate)->str_text
  705. X            );
  706. X        }
  707. X
  708. X        /*
  709. X         * add it to the list
  710. X         */
  711. X        project_developer_add(pp, user_name(candidate));
  712. X        user_free(candidate);
  713. X    }
  714. X
  715. X    /*
  716. X     * write out and release lock
  717. X     */
  718. X    project_pstate_write(pp);
  719. X    commit();
  720. X    lock_release();
  721. X
  722. X    /*
  723. X     * verbose success message
  724. X     */
  725. X    for (j = 0; j < wl.wl_nwords; ++j)
  726. X    {
  727. X        project_verbose
  728. X        (
  729. X            pp,
  730. X            "user \"%S\" is now a developer",
  731. X            wl.wl_word[j]
  732. X        );
  733. X    }
  734. X    project_free(pp);
  735. X    user_free(up);
  736. X    trace((/*{*/"}\n"));
  737. X}
  738. X
  739. X
  740. Xvoid
  741. Xnew_developer()
  742. X{
  743. X    trace(("new_developer()\n{\n"/*}*/));
  744. X    switch (arglex())
  745. X    {
  746. X    default:
  747. X        new_developer_main();
  748. X        break;
  749. X
  750. X    case arglex_token_help:
  751. X        new_developer_help();
  752. X        break;
  753. X
  754. X    case arglex_token_list:
  755. X        new_developer_list(new_developer_usage);
  756. X        break;
  757. X    }
  758. X    trace((/*{*/"}\n"));
  759. X}
  760. END_OF_FILE
  761. if test 8112 -ne `wc -c <'aegis/aend.c'`; then
  762.     echo shar: \"'aegis/aend.c'\" unpacked with wrong size!
  763. fi
  764. # end of 'aegis/aend.c'
  765. fi
  766. if test -f 'aegis/aeni.c' -a "${1}" != "-c" ; then 
  767.   echo shar: Will not clobber existing file \"'aegis/aeni.c'\"
  768. else
  769. echo shar: Extracting \"'aegis/aeni.c'\" \(8195 characters\)
  770. sed "s/^X//" >'aegis/aeni.c' <<'END_OF_FILE'
  771. X/*
  772. X *    aegis - project change supervisor
  773. X *    Copyright (C) 1991, 1992, 1993 Peter Miller.
  774. X *    All rights reserved.
  775. X *
  776. X *    This program is free software; you can redistribute it and/or modify
  777. X *    it under the terms of the GNU General Public License as published by
  778. X *    the Free Software Foundation; either version 2 of the License, or
  779. X *    (at your option) any later version.
  780. X *
  781. X *    This program is distributed in the hope that it will be useful,
  782. X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  783. X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  784. X *    GNU General Public License for more details.
  785. X *
  786. X *    You should have received a copy of the GNU General Public License
  787. X *    along with this program; if not, write to the Free Software
  788. X *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  789. X *
  790. X * MANIFEST: functions to implement new integrator
  791. X */
  792. X
  793. X#include <stdio.h>
  794. X#include <stdlib.h>
  795. X
  796. X#include <aeni.h>
  797. X#include <ael.h>
  798. X#include <arglex2.h>
  799. X#include <commit.h>
  800. X#include <error.h>
  801. X#include <help.h>
  802. X#include <lock.h>
  803. X#include <option.h>
  804. X#include <os.h>
  805. X#include <project.h>
  806. X#include <trace.h>
  807. X#include <user.h>
  808. X#include <word.h>
  809. X
  810. X
  811. Xstatic void new_integrator_usage _((void));
  812. X
  813. Xstatic void
  814. Xnew_integrator_usage()
  815. X{
  816. X    char        *progname;
  817. X
  818. X    progname = option_progname_get();
  819. X    fprintf(stderr, "usage: %s -New_Integrator <username>... [ <option>... ]\n", progname);
  820. X    fprintf(stderr, "       %s -New_Integrator -List [ <option>... ]\n", progname);
  821. X    fprintf(stderr, "       %s -New_Integrator -Help\n", progname);
  822. X    quit(1);
  823. X}
  824. X
  825. X
  826. Xstatic void new_integrator_help _((void));
  827. X
  828. Xstatic void
  829. Xnew_integrator_help()
  830. X{
  831. X    static char *text[] =
  832. X    {
  833. X"NAME",
  834. X"    %s -New_Integrator - add new integrators to a project",
  835. X"",
  836. X"SYNOPSIS",
  837. X"    %s -New_Integrator <user-name>... [ <option>... ]",
  838. X"    %s -New_Integrator -List [ <option>... ]",
  839. X"    %s -New_Integrator -Help",
  840. X"",
  841. X"DESCRIPTION",
  842. X"    The %s -New_Integrator command is used to add new",
  843. X"    integrators to a project.",
  844. X"",
  845. X"OPTIONS",
  846. X"    The following options are understood:",
  847. X"",
  848. X"    -Help",
  849. X"        This option may be used to obtain more",
  850. X"        information about how to use the %s program.",
  851. X"",
  852. X"    -List",
  853. X"        This option may be used to obtain a list of",
  854. X"        suitable subjects for this command.  The list may",
  855. X"        be more general than expected.",
  856. X"",
  857. X"    -Project <name>",
  858. X"        This option may be used to select the project of",
  859. X"        interest.  When no -Project option is specified, the",
  860. X"        AEGIS_PROJECT environment variable is consulted.  If",
  861. X"        that does not exist, the user's $HOME/.aegisrc file",
  862. X"        is examined for a default project field (see",
  863. X"        aeuconf(5) for more information).  If that does not",
  864. X"        exist, when the user is only working on changes",
  865. X"        within a single project, the project name defaults",
  866. X"        to that project.  Otherwise, it is an error.",
  867. X"",
  868. X"    -TERse",
  869. X"        This option may be used to cause listings to",
  870. X"        produce the bare minimum of information.  It is",
  871. X"        usually useful for shell scripts.",
  872. X"",
  873. X"    -Verbose",
  874. X"        This option may be used to cause %s to produce",
  875. X"        more output.  By default %s only produces",
  876. X"        output on errors.  When used with the -List",
  877. X"        option this option causes column headings to be",
  878. X"        added.",
  879. X"",
  880. X"    All options may be abbreviated; the abbreviation is",
  881. X"    documented as the upper case letters, all lower case",
  882. X"    letters and underscores (_) are optional.  You must use",
  883. X"    consecutive sequences of optional letters.",
  884. X"",
  885. X"    All options are case insensitive, you may type them in",
  886. X"    upper case or lower case or a combination of both, case",
  887. X"    is not important.",
  888. X"",
  889. X"    For example: the arguments \"-project, \"-PROJ\" and \"-p\"",
  890. X"    are all interpreted to mean the -Project option.  The",
  891. X"    argument \"-prj\" will not be understood, because",
  892. X"    consecutive optional characters were not supplied.",
  893. X"",
  894. X"    Options and other command line arguments may be mixed",
  895. X"    arbitrarily on the command line, after the function",
  896. X"    selectors.",
  897. X"",
  898. X"    The GNU long option names are understood.  Since all",
  899. X"    option names for aegis are long, this means ignoring the",
  900. X"    extra leading '-'.  The \"--option=value\" convention is",
  901. X"    also understood.",
  902. X"",
  903. X"RECOMMENDED ALIAS",
  904. X"    The recommended alias for this command is",
  905. X"    csh%%    alias aeni '%s -ni \\!* -v'",
  906. X"    sh$    aeni(){%s -ni $* -v}",
  907. X"",
  908. X"ERRORS",
  909. X"    It is an error if the current user is not an",
  910. X"    administrator of the project.",
  911. X"",
  912. X"EXIT STATUS",
  913. X"    The %s command will exit with a status of 1 on any",
  914. X"    error.    The %s command will only exit with a status of",
  915. X"    0 if there are no errors.",
  916. X"",
  917. X"COPYRIGHT",
  918. X"    %C",
  919. X"",
  920. X"AUTHOR",
  921. X"    %A",
  922. X    };
  923. X
  924. X    help(text, SIZEOF(text), new_integrator_usage);
  925. X}
  926. X
  927. X
  928. Xstatic void new_integrator_list _((void (*)(void)));
  929. X
  930. Xstatic void
  931. Xnew_integrator_list(usage)
  932. X    void        (*usage)_((void));
  933. X{
  934. X    string_ty    *project_name;
  935. X
  936. X    trace(("new_integrator_list()\n{\n"/*}*/));
  937. X    arglex();
  938. X    project_name = 0;
  939. X    while (arglex_token != arglex_token_eoln)
  940. X    {
  941. X        switch (arglex_token)
  942. X        {
  943. X        default:
  944. X            generic_argument(usage);
  945. X            continue;
  946. X
  947. X        case arglex_token_project:
  948. X            if (arglex() != arglex_token_string)
  949. X                usage();
  950. X            if (project_name)
  951. X                fatal("duplicate -Project option");
  952. X            project_name = str_from_c(arglex_value.alv_string);
  953. X            break;
  954. X        }
  955. X        arglex();
  956. X    }
  957. X    list_integrators(project_name, 0);
  958. X    if (project_name)
  959. X        str_free(project_name);
  960. X    trace((/*{*/"}\n"));
  961. X}
  962. X
  963. X
  964. Xstatic void new_integrator_main _((void));
  965. X
  966. Xstatic void
  967. Xnew_integrator_main()
  968. X{
  969. X    wlist        wl;
  970. X    string_ty    *s1;
  971. X    pstate        pstate_data;
  972. X    int        j;
  973. X    string_ty    *project_name;
  974. X    project_ty    *pp;
  975. X    user_ty        *up;
  976. X
  977. X    trace(("new_integrator_main()\n{\n"/*}*/));
  978. X    wl_zero(&wl);
  979. X    project_name = 0;
  980. X    while (arglex_token != arglex_token_eoln)
  981. X    {
  982. X        switch (arglex_token)
  983. X        {
  984. X        default:
  985. X            generic_argument(new_integrator_usage);
  986. X            continue;
  987. X
  988. X        case arglex_token_string:
  989. X            s1 = str_from_c(arglex_value.alv_string);
  990. X            if (wl_member(&wl, s1))
  991. X                fatal("user \"%s\" named more than once", s1->str_text);
  992. X            wl_append(&wl, s1);
  993. X            str_free(s1);
  994. X            break;
  995. X
  996. X        case arglex_token_project:
  997. X            if (arglex() != arglex_token_string)
  998. X                new_integrator_usage();
  999. X            if (project_name)
  1000. X                fatal("duplicate -Project option");
  1001. X            project_name = str_from_c(arglex_value.alv_string);
  1002. X            break;
  1003. X        }
  1004. X        arglex();
  1005. X    }
  1006. X    if (!wl.wl_nwords)
  1007. X        fatal("no users named");
  1008. X
  1009. X    /*
  1010. X     * locate project data
  1011. X     */
  1012. X    if (!project_name)
  1013. X        project_name = user_default_project();
  1014. X    pp = project_alloc(project_name);
  1015. X    str_free(project_name);
  1016. X    project_bind_existing(pp);
  1017. X
  1018. X    /*
  1019. X     * locate user data
  1020. X     */
  1021. X    up = user_executing(pp);
  1022. X
  1023. X    /*
  1024. X     * lock the project for change
  1025. X     */
  1026. X    project_pstate_lock_prepare(pp);
  1027. X    lock_take();
  1028. X    pstate_data = project_pstate_get(pp);
  1029. X
  1030. X    /*
  1031. X     * check they are allowed to do this
  1032. X     */
  1033. X    if (!project_administrator_query(pp, user_name(up)))
  1034. X    {
  1035. X        project_fatal
  1036. X        (
  1037. X            pp,
  1038. X            "user \"%S\" is not an administrator",
  1039. X            user_name(up)
  1040. X        );
  1041. X    }
  1042. X
  1043. X    /*
  1044. X     * check they they are OK users
  1045. X     */
  1046. X    for (j = 0; j < wl.wl_nwords; ++j)
  1047. X    {
  1048. X        user_ty        *candidate;
  1049. X
  1050. X        /*
  1051. X         * make sure the user isn't already there
  1052. X         */
  1053. X        candidate = user_symbolic(pp, wl.wl_word[j]);
  1054. X        if (project_integrator_query(pp, user_name(candidate)))
  1055. X        {
  1056. X            project_fatal
  1057. X            (
  1058. X                pp,
  1059. X                "user \"%S\" is already an integrator",
  1060. X                user_name(candidate)
  1061. X            );
  1062. X        }
  1063. X
  1064. X        /*
  1065. X         * make sure the user exists
  1066. X         *    (should we check s/he is in the project's group?)
  1067. X         * this is to avoid security holes
  1068. X         */
  1069. X        if (!user_uid_check(user_name(candidate)))
  1070. X        {
  1071. X            fatal
  1072. X            (
  1073. X                "user \"%s\" is too privileged",
  1074. X                user_name(candidate)->str_text
  1075. X            );
  1076. X        }
  1077. X
  1078. X        /*
  1079. X         * add it to the list
  1080. X         */
  1081. X        project_integrator_add(pp, user_name(candidate));
  1082. X        user_free(candidate);
  1083. X    }
  1084. X
  1085. X    /*
  1086. X     * write out and release lock
  1087. X     */
  1088. X    project_pstate_write(pp);
  1089. X    commit();
  1090. X    lock_release();
  1091. X
  1092. X    /*
  1093. X     * verbose success message
  1094. X     */
  1095. X    for (j = 0; j < wl.wl_nwords; ++j)
  1096. X    {
  1097. X        project_verbose
  1098. X        (
  1099. X            pp,
  1100. X            "user \"%S\" is now an integrator",
  1101. X            wl.wl_word[j]
  1102. X        );
  1103. X    }
  1104. X    project_free(pp);
  1105. X    user_free(up);
  1106. X    trace((/*{*/"}\n"));
  1107. X}
  1108. X
  1109. X
  1110. Xvoid
  1111. Xnew_integrator()
  1112. X{
  1113. X    trace(("new_integrator()\n{\n"/*}*/));
  1114. X    switch (arglex())
  1115. X    {
  1116. X    default:
  1117. X        new_integrator_main();
  1118. X        break;
  1119. X
  1120. X    case arglex_token_help:
  1121. X        new_integrator_help();
  1122. X        break;
  1123. X
  1124. X    case arglex_token_list:
  1125. X        new_integrator_list(new_integrator_usage);
  1126. X        break;
  1127. X    }
  1128. X    trace((/*{*/"}\n"));
  1129. X}
  1130. END_OF_FILE
  1131. if test 8195 -ne `wc -c <'aegis/aeni.c'`; then
  1132.     echo shar: \"'aegis/aeni.c'\" unpacked with wrong size!
  1133. fi
  1134. # end of 'aegis/aeni.c'
  1135. fi
  1136. if test -f 'aegis/aenrv.c' -a "${1}" != "-c" ; then 
  1137.   echo shar: Will not clobber existing file \"'aegis/aenrv.c'\"
  1138. else
  1139. echo shar: Extracting \"'aegis/aenrv.c'\" \(8124 characters\)
  1140. sed "s/^X//" >'aegis/aenrv.c' <<'END_OF_FILE'
  1141. X/*
  1142. X *    aegis - project change supervisor
  1143. X *    Copyright (C) 1991, 1992, 1993 Peter Miller.
  1144. X *    All rights reserved.
  1145. X *
  1146. X *    This program is free software; you can redistribute it and/or modify
  1147. X *    it under the terms of the GNU General Public License as published by
  1148. X *    the Free Software Foundation; either version 2 of the License, or
  1149. X *    (at your option) any later version.
  1150. X *
  1151. X *    This program is distributed in the hope that it will be useful,
  1152. X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1153. X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1154. X *    GNU General Public License for more details.
  1155. X *
  1156. X *    You should have received a copy of the GNU General Public License
  1157. X *    along with this program; if not, write to the Free Software
  1158. X *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1159. X *
  1160. X * MANIFEST: functions to implement new reviewer
  1161. X */
  1162. X
  1163. X#include <stdio.h>
  1164. X#include <stdlib.h>
  1165. X
  1166. X#include <ael.h>
  1167. X#include <aenrv.h>
  1168. X#include <arglex2.h>
  1169. X#include <commit.h>
  1170. X#include <error.h>
  1171. X#include <help.h>
  1172. X#include <lock.h>
  1173. X#include <option.h>
  1174. X#include <os.h>
  1175. X#include <project.h>
  1176. X#include <trace.h>
  1177. X#include <user.h>
  1178. X#include <word.h>
  1179. X
  1180. X
  1181. Xstatic void new_reviewer_usage _((void));
  1182. X
  1183. Xstatic void
  1184. Xnew_reviewer_usage()
  1185. X{
  1186. X    char        *progname;
  1187. X
  1188. X    progname = option_progname_get();
  1189. X    fprintf(stderr, "usage: %s -New_Reviewer <username>... [ <option>... ]\n", progname);
  1190. X    fprintf(stderr, "       %s -New_Reviewer -List [ <option>... ]\n", progname);
  1191. X    fprintf(stderr, "       %s -New_Reviewer -Help\n", progname);
  1192. X    quit(1);
  1193. X}
  1194. X
  1195. X
  1196. Xstatic void new_reviewer_help _((void));
  1197. X
  1198. Xstatic void
  1199. Xnew_reviewer_help()
  1200. X{
  1201. X    static char *text[] =
  1202. X    {
  1203. X"NAME",
  1204. X"    %s -New_ReViewer - add new reviewers to a project",
  1205. X"",
  1206. X"SYNOPSIS",
  1207. X"    %s -New_ReViewer <user-name>... [ <option>... ]",
  1208. X"    %s -New_ReViewer -List [ <option>... ]",
  1209. X"    %s -New_ReViewer -Help",
  1210. X"",
  1211. X"DESCRIPTION",
  1212. X"    The %s -New_ReViewer command is used to add new reviewers",
  1213. X"    to a project.",
  1214. X"",
  1215. X"OPTIONS",
  1216. X"    The following options are understood:",
  1217. X"",
  1218. X"    -Help",
  1219. X"        This option may be used to obtain more information",
  1220. X"        about how to use the %s program.",
  1221. X"",
  1222. X"    -List",
  1223. X"        This option may be used to obtain a list of suitable",
  1224. X"        subjects for this command.  The list may be more",
  1225. X"        general than expected.",
  1226. X"",
  1227. X"    -Project <name>",
  1228. X"        This option may be used to select the project of",
  1229. X"        interest.  When no -Project option is specified, the",
  1230. X"        AEGIS_PROJECT environment variable is consulted.  If",
  1231. X"        that does not exist, the user's $HOME/.aegisrc file",
  1232. X"        is examined for a default project field (see",
  1233. X"        aeuconf(5) for more information).  If that does not",
  1234. X"        exist, when the user is only working on changes",
  1235. X"        within a single project, the project name defaults",
  1236. X"        to that project.  Otherwise, it is an error.",
  1237. X"",
  1238. X"    -TERse",
  1239. X"        This option may be used to cause listings to produce",
  1240. X"        the bare minimum of information.  It is usually",
  1241. X"        useful for shell scripts.",
  1242. X"",
  1243. X"    -Verbose",
  1244. X"        This option may be used to cause %s to produce",
  1245. X"        more output.  By default %s only produces output",
  1246. X"        on errors.  When used with the -List option this",
  1247. X"        option causes column headings to be added.",
  1248. X"",
  1249. X"    All options may be abbreviated; the abbreviation is",
  1250. X"    documented as the upper case letters, all lower case",
  1251. X"    letters and underscores (_) are optional.  You must use",
  1252. X"    consecutive sequences of optional letters.",
  1253. X"",
  1254. X"    All options are case insensitive, you may type them in",
  1255. X"    upper case or lower case or a combination of both, case",
  1256. X"    is not important.",
  1257. X"",
  1258. X"    For example: the arguments \"-project, \"-PROJ\" and \"-p\"",
  1259. X"    are all interpreted to mean the -Project option.  The",
  1260. X"    argument \"-prj\" will not be understood, because",
  1261. X"    consecutive optional characters were not supplied.",
  1262. X"",
  1263. X"    Options and other command line arguments may be mixed",
  1264. X"    arbitrarily on the command line, after the function",
  1265. X"    selectors.",
  1266. X"",
  1267. X"    The GNU long option names are understood.  Since all",
  1268. X"    option names for aegis are long, this means ignoring the",
  1269. X"    extra leading '-'.  The \"--option=value\" convention is",
  1270. X"    also understood.",
  1271. X"",
  1272. X"RECOMMENDED ALIAS",
  1273. X"    The recommended alias for this command is",
  1274. X"    csh%%    alias aenrv '%s -nrv \\!* -v'",
  1275. X"    sh$    aenrv(){%s -nrv $* -v}",
  1276. X"",
  1277. X"ERRORS",
  1278. X"    It is an error if the current user is not an administrator",
  1279. X"    of the project.",
  1280. X"",
  1281. X"EXIT STATUS",
  1282. X"    The %s command will exit with a status of 1 on any error.",
  1283. X"    The %s command will only exit with a status of 0 if there",
  1284. X"    are no errors.",
  1285. X"",
  1286. X"COPYRIGHT",
  1287. X"    %C",
  1288. X"",
  1289. X"AUTHOR",
  1290. X"    %A",
  1291. X    };
  1292. X
  1293. X    help(text, SIZEOF(text), new_reviewer_usage);
  1294. X}
  1295. X
  1296. X
  1297. Xstatic void new_reviewer_list _((void (*)(void)));
  1298. X
  1299. Xstatic void
  1300. Xnew_reviewer_list(usage)
  1301. X    void    (*usage)_((void));
  1302. X{
  1303. X    string_ty    *project_name;
  1304. X
  1305. X    trace(("new_reviewer_list()\n{\n"/*}*/));
  1306. X    project_name = 0;
  1307. X    arglex();
  1308. X    while (arglex_token != arglex_token_eoln)
  1309. X    {
  1310. X        switch (arglex_token)
  1311. X        {
  1312. X        default:
  1313. X            generic_argument(usage);
  1314. X            continue;
  1315. X
  1316. X        case arglex_token_project:
  1317. X            if (arglex() != arglex_token_string)
  1318. X                usage();
  1319. X            if (project_name)
  1320. X                fatal("duplicate -Project option");
  1321. X            project_name = str_from_c(arglex_value.alv_string);
  1322. X            break;
  1323. X        }
  1324. X        arglex();
  1325. X    }
  1326. X    list_reviewers(project_name, 0);
  1327. X    if (project_name)
  1328. X        str_free(project_name);
  1329. X    trace((/*{*/"}\n"));
  1330. X}
  1331. X
  1332. X
  1333. Xstatic void new_reviewer_main _((void));
  1334. X
  1335. Xstatic void
  1336. Xnew_reviewer_main()
  1337. X{
  1338. X    wlist        wl;
  1339. X    string_ty    *s1;
  1340. X    pstate        pstate_data;
  1341. X    int        j;
  1342. X    string_ty    *project_name;
  1343. X    project_ty    *pp;
  1344. X    user_ty        *up;
  1345. X
  1346. X    trace(("new_reviewer_main()\n{\n"/*}*/));
  1347. X    project_name = 0;
  1348. X    wl_zero(&wl);
  1349. X    while (arglex_token != arglex_token_eoln)
  1350. X    {
  1351. X        switch (arglex_token)
  1352. X        {
  1353. X        default:
  1354. X            generic_argument(new_reviewer_usage);
  1355. X            continue;
  1356. X
  1357. X        case arglex_token_string:
  1358. X            s1 = str_from_c(arglex_value.alv_string);
  1359. X            if (wl_member(&wl, s1))
  1360. X                fatal("user \"%s\" named more than once", s1->str_text);
  1361. X            wl_append(&wl, s1);
  1362. X            str_free(s1);
  1363. X            break;
  1364. X
  1365. X        case arglex_token_project:
  1366. X            if (arglex() != arglex_token_string)
  1367. X                new_reviewer_usage();
  1368. X            if (project_name)
  1369. X                fatal("duplicate -Project option");
  1370. X            project_name = str_from_c(arglex_value.alv_string);
  1371. X            break;
  1372. X        }
  1373. X        arglex();
  1374. X    }
  1375. X    if (!wl.wl_nwords)
  1376. X        fatal("no users named");
  1377. X
  1378. X    /*
  1379. X     * locate project data
  1380. X     */
  1381. X    if (!project_name)
  1382. X        project_name = user_default_project();
  1383. X    pp = project_alloc(project_name);
  1384. X    str_free(project_name);
  1385. X    project_bind_existing(pp);
  1386. X
  1387. X    /*
  1388. X     * locate user data
  1389. X     */
  1390. X    up = user_executing(pp);
  1391. X
  1392. X    /*
  1393. X     * lock the project for change
  1394. X     */
  1395. X    project_pstate_lock_prepare(pp);
  1396. X    lock_take();
  1397. X    pstate_data = project_pstate_get(pp);
  1398. X
  1399. X    /*
  1400. X     * check they are allowed to do this
  1401. X     */
  1402. X    if (!project_administrator_query(pp, user_name(up)))
  1403. X    {
  1404. X        project_fatal
  1405. X        (
  1406. X            pp,
  1407. X            "user \"%S\" is not an administrator",
  1408. X            user_name(up)
  1409. X        );
  1410. X    }
  1411. X
  1412. X    /*
  1413. X     * check they they are OK users
  1414. X     */
  1415. X    for (j = 0; j < wl.wl_nwords; ++j)
  1416. X    {
  1417. X        user_ty        *candidate;
  1418. X
  1419. X        /*
  1420. X         * make sure the user isn't already there
  1421. X         */
  1422. X        candidate = user_symbolic(pp, wl.wl_word[j]);
  1423. X        if (project_reviewer_query(pp, user_name(candidate)))
  1424. X        {
  1425. X            project_fatal
  1426. X            (
  1427. X                pp,
  1428. X                "user \"%S\" is already a reviewer",
  1429. X                user_name(candidate)
  1430. X            );
  1431. X        }
  1432. X
  1433. X        /*
  1434. X         * make sure the user exists
  1435. X         *    (should we check s/he is in the project's group?)
  1436. X         * this is to avoid security holes
  1437. X         */
  1438. X        if (!user_uid_check(user_name(candidate)))
  1439. X        {
  1440. X            fatal
  1441. X            (
  1442. X                "user \"%s\" is too privileged",
  1443. X                user_name(candidate)->str_text
  1444. X            );
  1445. X        }
  1446. X
  1447. X        /*
  1448. X         * add them to the list
  1449. X         */
  1450. X        project_reviewer_add(pp, user_name(candidate));
  1451. X        user_free(candidate);
  1452. X    }
  1453. X
  1454. X    /*
  1455. X     * write out and release lock
  1456. X     */
  1457. X    project_pstate_write(pp);
  1458. X    commit();
  1459. X    lock_release();
  1460. X
  1461. X    /*
  1462. X     * verbose success message
  1463. X     */
  1464. X    for (j = 0; j < wl.wl_nwords; ++j)
  1465. X    {
  1466. X        project_verbose
  1467. X        (
  1468. X            pp,
  1469. X            "user \"%S\" is now a reviewer",
  1470. X            wl.wl_word[j]
  1471. X        );
  1472. X    }
  1473. X    project_free(pp);
  1474. X    user_free(up);
  1475. X    trace((/*{*/"}\n"));
  1476. X}
  1477. X
  1478. X
  1479. Xvoid
  1480. Xnew_reviewer()
  1481. X{
  1482. X    trace(("new_reviewer()\n{\n"/*}*/));
  1483. X    switch (arglex())
  1484. X    {
  1485. X    default:
  1486. X        new_reviewer_main();
  1487. X        break;
  1488. X
  1489. X    case arglex_token_help:
  1490. X        new_reviewer_help();
  1491. X        break;
  1492. X
  1493. X    case arglex_token_list:
  1494. X        new_reviewer_list(new_reviewer_usage);
  1495. X        break;
  1496. X    }
  1497. X    trace((/*{*/"}\n"));
  1498. X}
  1499. END_OF_FILE
  1500. if test 8124 -ne `wc -c <'aegis/aenrv.c'`; then
  1501.     echo shar: \"'aegis/aenrv.c'\" unpacked with wrong size!
  1502. fi
  1503. # end of 'aegis/aenrv.c'
  1504. fi
  1505. if test -f 'aegis/aera.c' -a "${1}" != "-c" ; then 
  1506.   echo shar: Will not clobber existing file \"'aegis/aera.c'\"
  1507. else
  1508. echo shar: Extracting \"'aegis/aera.c'\" \(8302 characters\)
  1509. sed "s/^X//" >'aegis/aera.c' <<'END_OF_FILE'
  1510. X/*
  1511. X *    aegis - project change supervisor
  1512. X *    Copyright (C) 1991, 1992, 1993 Peter Miller.
  1513. X *    All rights reserved.
  1514. X *
  1515. X *    This program is free software; you can redistribute it and/or modify
  1516. X *    it under the terms of the GNU General Public License as published by
  1517. X *    the Free Software Foundation; either version 2 of the License, or
  1518. X *    (at your option) any later version.
  1519. X *
  1520. X *    This program is distributed in the hope that it will be useful,
  1521. X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1522. X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1523. X *    GNU General Public License for more details.
  1524. X *
  1525. X *    You should have received a copy of the GNU General Public License
  1526. X *    along with this program; if not, write to the Free Software
  1527. X *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1528. X *
  1529. X * MANIFEST: functions to implement remove administrator
  1530. X */
  1531. X
  1532. X#include <stdio.h>
  1533. X#include <stdlib.h>
  1534. X
  1535. X#include <aera.h>
  1536. X#include <ael.h>
  1537. X#include <arglex2.h>
  1538. X#include <commit.h>
  1539. X#include <error.h>
  1540. X#include <help.h>
  1541. X#include <lock.h>
  1542. X#include <option.h>
  1543. X#include <os.h>
  1544. X#include <project.h>
  1545. X#include <trace.h>
  1546. X#include <user.h>
  1547. X#include <word.h>
  1548. X
  1549. X
  1550. Xstatic void remove_administrator_usage _((void));
  1551. X
  1552. Xstatic void
  1553. Xremove_administrator_usage()
  1554. X{
  1555. X    char        *progname;
  1556. X
  1557. X    progname = option_progname_get();
  1558. X    fprintf(stderr, "usage: %s -Remove_Administrator [ <option>... ] <username>...\n", progname);
  1559. X    fprintf(stderr, "       %s -Remove_Administrator -List [ <option>... ]\n", progname);
  1560. X    fprintf(stderr, "       %s -Remove_Administrator -Help\n", progname);
  1561. X    quit(1);
  1562. X}
  1563. X
  1564. X
  1565. Xstatic void remove_administrator_help _((void));
  1566. X
  1567. Xstatic void
  1568. Xremove_administrator_help()
  1569. X{
  1570. X    static char *text[] =
  1571. X    {
  1572. X"NAME",
  1573. X"    %s -Remove_Administrator - remove administrators from",
  1574. X"    a project",
  1575. X"",
  1576. X"SYNOPSIS",
  1577. X"    %s -Remove_Administrator user-name ... [ option...  ]",
  1578. X"    %s -Remove_Administrator -List [ option...  ]",
  1579. X"    %s -Remove_Administrator -Help",
  1580. X"",
  1581. X"DESCRIPTION",
  1582. X"    The %s -Remove_Administrator command is used to remove",
  1583. X"    administrators from a project.",
  1584. X"",
  1585. X"OPTIONS",
  1586. X"    The following options are understood:",
  1587. X"",
  1588. X"    -Help",
  1589. X"        This option may be used to obtain more",
  1590. X"        information about how to use the %s program.",
  1591. X"",
  1592. X"    -List",
  1593. X"        This option may be used to obtain a list of",
  1594. X"        suitable subjects for this command.  The list may",
  1595. X"        be more general than expected.",
  1596. X"",
  1597. X"    -Project <name>",
  1598. X"        This option may be used to select the project of",
  1599. X"        interest.  When no -Project option is specified, if",
  1600. X"        the user is only working on changes within a single",
  1601. X"        project, the project name defaults to that project;",
  1602. X"        if the user is currently working on changes to more",
  1603. X"        than one project, or is not working on changes to",
  1604. X"        any project, the user's $HOME/.%src file is",
  1605. X"        examined for a default project field (see aeuconf(5)",
  1606. X"        for more information).",
  1607. X"",
  1608. X"    -TERse",
  1609. X"        This option may be used to cause listings to",
  1610. X"        produce the bare minimum of information.  It is",
  1611. X"        usually useful for shell scripts.",
  1612. X"",
  1613. X"    -Verbose",
  1614. X"        This option may be used to cause %s to produce",
  1615. X"        more output.  By default %s only produces",
  1616. X"        output on errors.  When used with the -List",
  1617. X"        option this option causes column headings to be",
  1618. X"        added.",
  1619. X"",
  1620. X"    All options may be abbreviated; the abbreviation is",
  1621. X"    documented as the upper case letters, all lower case",
  1622. X"    letters and underscores (_) are optional.  You must use",
  1623. X"    consecutive sequences of optional letters.",
  1624. X"",
  1625. X"    All options are case insensitive, you may type them in",
  1626. X"    upper case or lower case or a combination of both, case",
  1627. X"    is not important.",
  1628. X"",
  1629. X"    For example: the arguments \"-project, \"-PROJ\" and \"-p\"",
  1630. X"    are all interpreted to mean the -Project option.  The",
  1631. X"    argument \"-prj\" will not be understood, because",
  1632. X"    consecutive optional characters were not supplied.",
  1633. X"",
  1634. X"    Options and other command line arguments may be mixed",
  1635. X"    arbitrarily on the command line, after the function",
  1636. X"    selectors.",
  1637. X"",
  1638. X"    The GNU long option names are understood.  Since all",
  1639. X"    option names for aegis are long, this means ignoring the",
  1640. X"    extra leading '-'.  The \"--option=value\" convention is",
  1641. X"    also understood.",
  1642. X"",
  1643. X"RECOMMENDED ALIAS",
  1644. X"    The recommended alias for this command is",
  1645. X"    csh%%    alias aera '%s -ra \\!* -v'",
  1646. X"    sh$    aera(){%s -ra $* -v}",
  1647. X"",
  1648. X"ERRORS",
  1649. X"    It is an error if the current user is not an",
  1650. X"    administrator of the project.",
  1651. X"",
  1652. X"    It is an error if an attempt is made to remove the last",
  1653. X"    administrator from the project.",
  1654. X"",
  1655. X"EXIT STATUS",
  1656. X"    The %s command will exit with a status of 1 on any",
  1657. X"    error.  The %s command will only exit with a status of",
  1658. X"    0 if there are no errors.",
  1659. X"",
  1660. X"COPYRIGHT",
  1661. X"    %C",
  1662. X"",
  1663. X"AUTHOR",
  1664. X"    %A",
  1665. X    };
  1666. X
  1667. X    help(text, SIZEOF(text), remove_administrator_usage);
  1668. X}
  1669. X
  1670. X
  1671. Xstatic void remove_administrator_list _((void));
  1672. X
  1673. Xstatic void
  1674. Xremove_administrator_list()
  1675. X{
  1676. X    string_ty    *project_name;
  1677. X
  1678. X    trace(("remove_administrator_list()\n{\n"/*}*/));
  1679. X    arglex();
  1680. X    project_name = 0;
  1681. X    while (arglex_token != arglex_token_eoln)
  1682. X    {
  1683. X        switch (arglex_token)
  1684. X        {
  1685. X        default:
  1686. X            generic_argument(remove_administrator_usage);
  1687. X            continue;
  1688. X
  1689. X        case arglex_token_project:
  1690. X            if (arglex() != arglex_token_string)
  1691. X                remove_administrator_usage();
  1692. X            if (project_name)
  1693. X                fatal("duplicate -Project option");
  1694. X            project_name = str_from_c(arglex_value.alv_string);
  1695. X            break;
  1696. X        }
  1697. X        arglex();
  1698. X    }
  1699. X    list_administrators(project_name, 0);
  1700. X    if (project_name)
  1701. X        str_free(project_name);
  1702. X    trace((/*{*/"}\n"));
  1703. X}
  1704. X
  1705. X
  1706. Xstatic void remove_administrator_main _((void));
  1707. X
  1708. Xstatic void
  1709. Xremove_administrator_main()
  1710. X{
  1711. X    wlist        wl;
  1712. X    string_ty    *s1;
  1713. X    pstate        pstate_data;
  1714. X    int        j;
  1715. X    string_ty    *project_name;
  1716. X    project_ty    *pp;
  1717. X    user_ty        *up;
  1718. X
  1719. X    trace(("remove_administrator_main()\n{\n"/*}*/));
  1720. X    wl_zero(&wl);
  1721. X    project_name = 0;
  1722. X    while (arglex_token != arglex_token_eoln)
  1723. X    {
  1724. X        switch (arglex_token)
  1725. X        {
  1726. X        default:
  1727. X            generic_argument(remove_administrator_usage);
  1728. X            continue;
  1729. X
  1730. X        case arglex_token_string:
  1731. X            s1 = str_from_c(arglex_value.alv_string);
  1732. X            if (wl_member(&wl, s1))
  1733. X                fatal("user \"%s\" named more than once", s1->str_text);
  1734. X            wl_append(&wl, s1);
  1735. X            str_free(s1);
  1736. X            break;
  1737. X
  1738. X        case arglex_token_project:
  1739. X            if (arglex() != arglex_token_string)
  1740. X                remove_administrator_usage();
  1741. X            if (project_name)
  1742. X                fatal("duplicate -Project option");
  1743. X            project_name = str_from_c(arglex_value.alv_string);
  1744. X            break;
  1745. X        }
  1746. X        arglex();
  1747. X    }
  1748. X    if (!wl.wl_nwords)
  1749. X        fatal("no users named");
  1750. X
  1751. X    /*
  1752. X     * locate project data
  1753. X     */
  1754. X    if (!project_name)
  1755. X        project_name = user_default_project();
  1756. X    pp = project_alloc(project_name);
  1757. X    str_free(project_name);
  1758. X    project_bind_existing(pp);
  1759. X
  1760. X    /*
  1761. X     * locate user data
  1762. X     */
  1763. X    up = user_executing(pp);
  1764. X
  1765. X    /*
  1766. X     * lock the project for change
  1767. X     */
  1768. X    project_pstate_lock_prepare(pp);
  1769. X    lock_take();
  1770. X    pstate_data = project_pstate_get(pp);
  1771. X
  1772. X    /*
  1773. X     * check they are allowed to do this
  1774. X     */
  1775. X    if (!project_administrator_query(pp, user_name(up)))
  1776. X    {
  1777. X        project_fatal
  1778. X        (
  1779. X            pp,
  1780. X            "user \"%S\" is not an administrator",
  1781. X            user_name(up)
  1782. X        );
  1783. X    }
  1784. X
  1785. X    /*
  1786. X     * check the users are actually administrators
  1787. X     */
  1788. X    for (j = 0; j < wl.wl_nwords; ++j)
  1789. X    {
  1790. X        user_ty    *candidate;
  1791. X
  1792. X        candidate = user_symbolic(pp, wl.wl_word[j]);
  1793. X        if (!project_administrator_query(pp, user_name(candidate)))
  1794. X        {
  1795. X            project_fatal
  1796. X            (
  1797. X                pp,
  1798. X                "user \"%S\" is not an administrator",
  1799. X                user_name(candidate)
  1800. X            );
  1801. X        }
  1802. X        project_administrator_delete(pp, user_name(candidate));
  1803. X        user_free(candidate);
  1804. X    }
  1805. X
  1806. X    /*
  1807. X     * make sure there will always be at least one administrator
  1808. X     */
  1809. X    if (pstate_data->administrator->length <= 0)
  1810. X    {
  1811. X        project_fatal
  1812. X        (
  1813. X            pp,
  1814. X            "must have at least one administrator at all times"
  1815. X        );
  1816. X    }
  1817. X
  1818. X    /*
  1819. X     * write out and release lock
  1820. X     */
  1821. X    project_pstate_write(pp);
  1822. X    commit();
  1823. X    lock_release();
  1824. X
  1825. X    /*
  1826. X     * verbose success message
  1827. X     */
  1828. X    for (j = 0; j < wl.wl_nwords; ++j)
  1829. X    {
  1830. X        project_verbose
  1831. X        (
  1832. X            pp,
  1833. X            "user \"%S\" is no longer an administrator",
  1834. X            wl.wl_word[j]
  1835. X        );
  1836. X    }
  1837. X    project_free(pp);
  1838. X    user_free(up);
  1839. X    trace((/*{*/"}\n"));
  1840. X}
  1841. X
  1842. X
  1843. Xvoid
  1844. Xremove_administrator()
  1845. X{
  1846. X    trace(("remove_administrator()\n{\n"/*}*/));
  1847. X    switch (arglex())
  1848. X    {
  1849. X    default:
  1850. X        remove_administrator_main();
  1851. X        break;
  1852. X
  1853. X    case arglex_token_help:
  1854. X        remove_administrator_help();
  1855. X        break;
  1856. X
  1857. X    case arglex_token_list:
  1858. X        remove_administrator_list();
  1859. X        break;
  1860. X    }
  1861. X    trace((/*{*/"}\n"));
  1862. X}
  1863. END_OF_FILE
  1864. if test 8302 -ne `wc -c <'aegis/aera.c'`; then
  1865.     echo shar: \"'aegis/aera.c'\" unpacked with wrong size!
  1866. fi
  1867. # end of 'aegis/aera.c'
  1868. fi
  1869. if test -f 'aegis/aerd.c' -a "${1}" != "-c" ; then 
  1870.   echo shar: Will not clobber existing file \"'aegis/aerd.c'\"
  1871. else
  1872. echo shar: Extracting \"'aegis/aerd.c'\" \(7837 characters\)
  1873. sed "s/^X//" >'aegis/aerd.c' <<'END_OF_FILE'
  1874. X/*
  1875. X *    aegis - project change supervisor
  1876. X *    Copyright (C) 1991, 1992, 1993 Peter Miller.
  1877. X *    All rights reserved.
  1878. X *
  1879. X *    This program is free software; you can redistribute it and/or modify
  1880. X *    it under the terms of the GNU General Public License as published by
  1881. X *    the Free Software Foundation; either version 2 of the License, or
  1882. X *    (at your option) any later version.
  1883. X *
  1884. X *    This program is distributed in the hope that it will be useful,
  1885. X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1886. X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1887. X *    GNU General Public License for more details.
  1888. X *
  1889. X *    You should have received a copy of the GNU General Public License
  1890. X *    along with this program; if not, write to the Free Software
  1891. X *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1892. X *
  1893. X * MANIFEST: functions to implement remove developer
  1894. X */
  1895. X
  1896. X#include <stdio.h>
  1897. X#include <stdlib.h>
  1898. X
  1899. X#include <ael.h>
  1900. X#include <aerd.h>
  1901. X#include <arglex2.h>
  1902. X#include <commit.h>
  1903. X#include <error.h>
  1904. X#include <help.h>
  1905. X#include <lock.h>
  1906. X#include <option.h>
  1907. X#include <os.h>
  1908. X#include <project.h>
  1909. X#include <trace.h>
  1910. X#include <user.h>
  1911. X#include <word.h>
  1912. X
  1913. X
  1914. Xstatic void remove_developer_usage _((void));
  1915. X
  1916. Xstatic void
  1917. Xremove_developer_usage()
  1918. X{
  1919. X    char        *progname;
  1920. X
  1921. X    progname = option_progname_get();
  1922. X    fprintf(stderr, "usage: %s -Remove_Developer [ <option>... ] <username>...\n", progname);
  1923. X    fprintf(stderr, "       %s -Remove_Developer -List [ <option>... ]\n", progname);
  1924. X    fprintf(stderr, "       %s -Remove_Developer -Help\n", progname);
  1925. X    quit(1);
  1926. X}
  1927. X
  1928. X
  1929. Xstatic void remove_developer_help _((void));
  1930. X
  1931. Xstatic void
  1932. Xremove_developer_help()
  1933. X{
  1934. X    static char *text[] =
  1935. X    {
  1936. X"NAME",
  1937. X"    %s -Remove_Developer - remove developers from a",
  1938. X"    project",
  1939. X"",
  1940. X"SYNOPSIS",
  1941. X"    %s -Remove_Developer <user-name>... [ <option>... ]",
  1942. X"    %s -Remove_Developer -List [ <option>... ]",
  1943. X"    %s -Remove_Developer -Help",
  1944. X"",
  1945. X"DESCRIPTION",
  1946. X"    The %s -Remove_Developer command is used to remove",
  1947. X"    developers from a project.",
  1948. X"",
  1949. X"OPTIONS",
  1950. X"    The following options are understood:",
  1951. X"",
  1952. X"    -Help",
  1953. X"        This option may be used to obtain more",
  1954. X"        information about how to use the %s program.",
  1955. X"",
  1956. X"    -List",
  1957. X"        This option may be used to obtain a list of",
  1958. X"        suitable subjects for this command.  The list may",
  1959. X"        be more general than expected.",
  1960. X"",
  1961. X"    -Project <name>",
  1962. X"        This option may be used to select the project of",
  1963. X"        interest.  When no -Project option is specified, the",
  1964. X"        AEGIS_PROJECT environment variable is consulted.  If",
  1965. X"        that does not exist, the user's $HOME/.aegisrc file",
  1966. X"        is examined for a default project field (see",
  1967. X"        aeuconf(5) for more information).  If that does not",
  1968. X"        exist, when the user is only working on changes",
  1969. X"        within a single project, the project name defaults",
  1970. X"        to that project.  Otherwise, it is an error.",
  1971. X"",
  1972. X"    -TERse",
  1973. X"        This option may be used to cause listings to",
  1974. X"        produce the bare minimum of information.  It is",
  1975. X"        usually useful for shell scripts.",
  1976. X"",
  1977. X"    -Verbose",
  1978. X"        This option may be used to cause %s to produce",
  1979. X"        more output.  By default %s only produces",
  1980. X"        output on errors.  When used with the -List",
  1981. X"        option this option causes column headings to be",
  1982. X"        added.",
  1983. X"",
  1984. X"    All options may be abbreviated; the abbreviation is",
  1985. X"    documented as the upper case letters, all lower case",
  1986. X"    letters and underscores (_) are optional.  You must use",
  1987. X"    consecutive sequences of optional letters.",
  1988. X"",
  1989. X"    All options are case insensitive, you may type them in",
  1990. X"    upper case or lower case or a combination of both, case",
  1991. X"    is not important.",
  1992. X"",
  1993. X"    For example: the arguments \"-project, \"-PROJ\" and \"-p\"",
  1994. X"    are all interpreted to mean the -Project option.  The",
  1995. X"    argument \"-prj\" will not be understood, because",
  1996. X"    consecutive optional characters were not supplied.",
  1997. X"",
  1998. X"    Options and other command line arguments may be mixed",
  1999. X"    arbitrarily on the command line, after the function",
  2000. X"    selectors.",
  2001. X"",
  2002. X"    The GNU long option names are understood.  Since all",
  2003. X"    option names for aegis are long, this means ignoring the",
  2004. X"    extra leading '-'.  The \"--option=value\" convention is",
  2005. X"    also understood.",
  2006. X"",
  2007. X"RECOMMENDED ALIAS",
  2008. X"    The recommended alias for this command is",
  2009. X"    csh%%    alias aerd '%s -rd \\!* -v'",
  2010. X"    sh$    aerd(){%s -rd $* -v}",
  2011. X"",
  2012. X"ERRORS",
  2013. X"    It is an error if the current user is not an",
  2014. X"    administrator of the project.",
  2015. X"",
  2016. X"EXIT STATUS",
  2017. X"    The %s command will exit with a status of 1 on any",
  2018. X"    error.    The %s command will only exit with a status of",
  2019. X"    0 if there are no errors.",
  2020. X"",
  2021. X"COPYRIGHT",
  2022. X"    %C",
  2023. X"",
  2024. X"AUTHOR",
  2025. X"    %A",
  2026. X    };
  2027. X
  2028. X    help(text, SIZEOF(text), remove_developer_usage);
  2029. X}
  2030. X
  2031. X
  2032. Xstatic void remove_developer_list _((void (*)(void)));
  2033. X
  2034. Xstatic void
  2035. Xremove_developer_list(usage)
  2036. X    void        (*usage)_((void));
  2037. X{
  2038. X    string_ty    *project_name;
  2039. X
  2040. X    trace(("remove_developer_list()\n{\n"/*}*/));
  2041. X    arglex();
  2042. X    project_name = 0;
  2043. X    while (arglex_token != arglex_token_eoln)
  2044. X    {
  2045. X        switch (arglex_token)
  2046. X        {
  2047. X        default:
  2048. X            generic_argument(usage);
  2049. X            continue;
  2050. X
  2051. X        case arglex_token_project:
  2052. X            if (arglex() != arglex_token_string)
  2053. X                usage();
  2054. X            if (project_name)
  2055. X                fatal("duplicate -Project option");
  2056. X            project_name = str_from_c(arglex_value.alv_string);
  2057. X            break;
  2058. X        }
  2059. X        arglex();
  2060. X    }
  2061. X    list_developers(project_name, 0);
  2062. X    trace((/*{*/"}\n"));
  2063. X}
  2064. X
  2065. X
  2066. Xstatic void remove_developer_main _((void));
  2067. X
  2068. Xstatic void
  2069. Xremove_developer_main()
  2070. X{
  2071. X    wlist        wl;
  2072. X    string_ty    *s1;
  2073. X    pstate        pstate_data;
  2074. X    int        j;
  2075. X    string_ty    *project_name;
  2076. X    project_ty    *pp;
  2077. X    user_ty        *up;
  2078. X
  2079. X    trace(("remove_developer_main()\n{\n"/*}*/));
  2080. X    wl_zero(&wl);
  2081. X    project_name = 0;
  2082. X    while (arglex_token != arglex_token_eoln)
  2083. X    {
  2084. X        switch (arglex_token)
  2085. X        {
  2086. X        default:
  2087. X            generic_argument(remove_developer_usage);
  2088. X            continue;
  2089. X
  2090. X        case arglex_token_string:
  2091. X            s1 = str_from_c(arglex_value.alv_string);
  2092. X            if (wl_member(&wl, s1))
  2093. X                fatal("user \"%s\" named more than once", s1->str_text);
  2094. X            wl_append(&wl, s1);
  2095. X            str_free(s1);
  2096. X            break;
  2097. X
  2098. X        case arglex_token_project:
  2099. X            if (arglex() != arglex_token_string)
  2100. X                remove_developer_usage();
  2101. X            if (project_name)
  2102. X                fatal("duplicate -Project option");
  2103. X            project_name = str_from_c(arglex_value.alv_string);
  2104. X            break;
  2105. X        }
  2106. X        arglex();
  2107. X    }
  2108. X    if (!wl.wl_nwords)
  2109. X        fatal("no users named");
  2110. X
  2111. X    /*
  2112. X     * locate project data
  2113. X     */
  2114. X    if (!project_name)
  2115. X        project_name = user_default_project();
  2116. X    pp = project_alloc(project_name);
  2117. X    str_free(project_name);
  2118. X    project_bind_existing(pp);
  2119. X
  2120. X    /*
  2121. X     * locate user data
  2122. X     */
  2123. X    up = user_executing(pp);
  2124. X
  2125. X    /*
  2126. X     * lock the project for change
  2127. X     */
  2128. X    project_pstate_lock_prepare(pp);
  2129. X    lock_take();
  2130. X    pstate_data = project_pstate_get(pp);
  2131. X
  2132. X    /*
  2133. X     * check they are allowed to do this
  2134. X     */
  2135. X    if (!project_administrator_query(pp, user_name(up)))
  2136. X    {
  2137. X        project_fatal
  2138. X        (
  2139. X            pp,
  2140. X            "user \"%S\" is not an administrator",
  2141. X            user_name(up)
  2142. X        );
  2143. X    }
  2144. X
  2145. X    /*
  2146. X     * check they they are OK users
  2147. X     */
  2148. X    for (j = 0; j < wl.wl_nwords; ++j)
  2149. X    {
  2150. X        user_ty    *candidate;
  2151. X
  2152. X        candidate = user_symbolic(pp, wl.wl_word[j]);
  2153. X        if (!project_developer_query(pp, user_name(candidate)))
  2154. X        {
  2155. X            project_fatal
  2156. X            (
  2157. X                pp,
  2158. X                "user \"%S\" is not a developer",
  2159. X                user_name(candidate)
  2160. X            );
  2161. X        }
  2162. X        project_developer_delete(pp, user_name(candidate));
  2163. X        user_free(candidate);
  2164. X    }
  2165. X
  2166. X    /*
  2167. X     * write out and release lock
  2168. X     */
  2169. X    project_pstate_write(pp);
  2170. X    commit();
  2171. X    lock_release();
  2172. X
  2173. X    /*
  2174. X     * verbose success message
  2175. X     */
  2176. X    for (j = 0; j < wl.wl_nwords; ++j)
  2177. X    {
  2178. X        project_verbose
  2179. X        (
  2180. X            pp,
  2181. X            "user \"%S\" is no longer a developer",
  2182. X            wl.wl_word[j]
  2183. X        );
  2184. X    }
  2185. X    project_free(pp);
  2186. X    user_free(up);
  2187. X    trace((/*{*/"}\n"));
  2188. X}
  2189. X
  2190. X
  2191. Xvoid
  2192. Xremove_developer()
  2193. X{
  2194. X    trace(("remove_developer()\n{\n"/*}*/));
  2195. X    switch (arglex())
  2196. X    {
  2197. X    default:
  2198. X        remove_developer_main();
  2199. X        break;
  2200. X
  2201. X    case arglex_token_help:
  2202. X        remove_developer_help();
  2203. X        break;
  2204. X
  2205. X    case arglex_token_list:
  2206. X        remove_developer_list(remove_developer_usage);
  2207. X        break;
  2208. X    }
  2209. X    trace((/*{*/"}\n"));
  2210. X}
  2211. END_OF_FILE
  2212. if test 7837 -ne `wc -c <'aegis/aerd.c'`; then
  2213.     echo shar: \"'aegis/aerd.c'\" unpacked with wrong size!
  2214. fi
  2215. # end of 'aegis/aerd.c'
  2216. fi
  2217. if test -f 'aegis/aeri.c' -a "${1}" != "-c" ; then 
  2218.   echo shar: Will not clobber existing file \"'aegis/aeri.c'\"
  2219. else
  2220. echo shar: Extracting \"'aegis/aeri.c'\" \(7902 characters\)
  2221. sed "s/^X//" >'aegis/aeri.c' <<'END_OF_FILE'
  2222. X/*
  2223. X *    aegis - project change supervisor
  2224. X *    Copyright (C) 1991, 1992, 1993 Peter Miller.
  2225. X *    All rights reserved.
  2226. X *
  2227. X *    This program is free software; you can redistribute it and/or modify
  2228. X *    it under the terms of the GNU General Public License as published by
  2229. X *    the Free Software Foundation; either version 2 of the License, or
  2230. X *    (at your option) any later version.
  2231. X *
  2232. X *    This program is distributed in the hope that it will be useful,
  2233. X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  2234. X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2235. X *    GNU General Public License for more details.
  2236. X *
  2237. X *    You should have received a copy of the GNU General Public License
  2238. X *    along with this program; if not, write to the Free Software
  2239. X *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2240. X *
  2241. X * MANIFEST: functions to implement remove administrator
  2242. X */
  2243. X
  2244. X#include <stdio.h>
  2245. X#include <stdlib.h>
  2246. X
  2247. X#include <ael.h>
  2248. X#include <aeri.h>
  2249. X#include <arglex2.h>
  2250. X#include <commit.h>
  2251. X#include <error.h>
  2252. X#include <help.h>
  2253. X#include <lock.h>
  2254. X#include <option.h>
  2255. X#include <os.h>
  2256. X#include <project.h>
  2257. X#include <trace.h>
  2258. X#include <user.h>
  2259. X#include <word.h>
  2260. X
  2261. X
  2262. Xstatic void remove_integrator_usage _((void));
  2263. X
  2264. Xstatic void
  2265. Xremove_integrator_usage()
  2266. X{
  2267. X    char        *progname;
  2268. X
  2269. X    progname = option_progname_get();
  2270. X    fprintf(stderr, "usage: %s -Remove_Integrator [ <option>... ] <username>...\n", progname);
  2271. X    fprintf(stderr, "       %s -Remove_Integrator -List [ <option>... ]\n", progname);
  2272. X    fprintf(stderr, "       %s -Remove_Integrator -Help\n", progname);
  2273. X    quit(1);
  2274. X}
  2275. X
  2276. X
  2277. Xstatic void remove_integrator_help _((void));
  2278. X
  2279. Xstatic void
  2280. Xremove_integrator_help()
  2281. X{
  2282. X    static char *text[] =
  2283. X    {
  2284. X"NAME",
  2285. X"    %s -Remove_Integrator - remove integrators from a",
  2286. X"    project",
  2287. X"",
  2288. X"SYNOPSIS",
  2289. X"    %s -Remove_Integrator <user-name>... [ <option>... ]",
  2290. X"    %s -Remove_Integrator -List [ <option>... ]",
  2291. X"    %s -Remove_Integrator -Help",
  2292. X"",
  2293. X"DESCRIPTION",
  2294. X"    The %s -Remove_Integrator command is used to remove",
  2295. X"    integrators from a project.",
  2296. X"",
  2297. X"OPTIONS",
  2298. X"    The following options are understood:",
  2299. X"",
  2300. X"    -Help",
  2301. X"        This option may be used to obtain more",
  2302. X"        information about how to use the %s program.",
  2303. X"",
  2304. X"    -List",
  2305. X"        This option may be used to obtain a list of",
  2306. X"        suitable subjects for this command.  The list may",
  2307. X"        be more general than expected.",
  2308. X"",
  2309. X"    -Project <name>",
  2310. X"        This option may be used to select the project of",
  2311. X"        interest.  When no -Project option is specified, if",
  2312. X"        the user is only working on changes within a single",
  2313. X"        project, the project name defaults to that project;",
  2314. X"        if the user is currently working on changes to more",
  2315. X"        than one project, or is not working on changes to",
  2316. X"        any project, the user's $HOME/.%src file is",
  2317. X"        examined for a default project field (see aeuconf(5)",
  2318. X"        for more information).",
  2319. X"",
  2320. X"    -TERse",
  2321. X"        This option may be used to cause listings to",
  2322. X"        produce the bare minimum of information.  It is",
  2323. X"        usually useful for shell scripts.",
  2324. X"",
  2325. X"    -Verbose",
  2326. X"        This option may be used to cause %s to produce",
  2327. X"        more output.  By default %s only produces",
  2328. X"        output on errors.  When used with the -List",
  2329. X"        option this option causes column headings to be",
  2330. X"        added.",
  2331. X"",
  2332. X"    All options may be abbreviated; the abbreviation is",
  2333. X"    documented as the upper case letters, all lower case",
  2334. X"    letters and underscores (_) are optional.  You must use",
  2335. X"    consecutive sequences of optional letters.",
  2336. X"",
  2337. X"    All options are case insensitive, you may type them in",
  2338. X"    upper case or lower case or a combination of both, case",
  2339. X"    is not important.",
  2340. X"",
  2341. X"    For example: the arguments \"-project, \"-PROJ\" and \"-p\"",
  2342. X"    are all interpreted to mean the -Project option.  The",
  2343. X"    argument \"-prj\" will not be understood, because",
  2344. X"    consecutive optional characters were not supplied.",
  2345. X"",
  2346. X"    Options and other command line arguments may be mixed",
  2347. X"    arbitrarily on the command line, after the function",
  2348. X"    selectors.",
  2349. X"",
  2350. X"    The GNU long option names are understood.  Since all",
  2351. X"    option names for aegis are long, this means ignoring the",
  2352. X"    extra leading '-'.  The \"--option=value\" convention is",
  2353. X"    also understood.",
  2354. X"",
  2355. X"RECOMMENDED ALIAS",
  2356. X"    The recommended alias for this command is",
  2357. X"    csh%%    alias aeri '%s -ri \\!* -v'",
  2358. X"    sh$    aeri(){%s -ri $* -v}",
  2359. X"",
  2360. X"ERRORS",
  2361. X"    It is an error if the current user is not an",
  2362. X"    administratot of the project.",
  2363. X"",
  2364. X"EXIT STATUS",
  2365. X"    The %s command will exit with a status of 1 on any",
  2366. X"    error.    The %s command will only exit with a status of",
  2367. X"    0 if there are no errors.",
  2368. X"",
  2369. X"COPYRIGHT",
  2370. X"    %C",
  2371. X"",
  2372. X"AUTHOR",
  2373. X"    %A",
  2374. X    };
  2375. X
  2376. X    help(text, SIZEOF(text), remove_integrator_usage);
  2377. X}
  2378. X
  2379. X
  2380. Xstatic void remove_integrator_list _((void (*)(void)));
  2381. X
  2382. Xstatic void
  2383. Xremove_integrator_list(usage)
  2384. X    void        (*usage)_((void));
  2385. X{
  2386. X    string_ty    *project_name;
  2387. X
  2388. X    trace(("remove_integrator_list()\n{\n"/*}*/));
  2389. X    arglex();
  2390. X    project_name = 0;
  2391. X    while (arglex_token != arglex_token_eoln)
  2392. X    {
  2393. X        switch (arglex_token)
  2394. X        {
  2395. X        default:
  2396. X            generic_argument(usage);
  2397. X            continue;
  2398. X
  2399. X        case arglex_token_project:
  2400. X            if (arglex() != arglex_token_string)
  2401. X                usage();
  2402. X            if (project_name)
  2403. X                fatal("duplicate -Project option");
  2404. X            project_name = str_from_c(arglex_value.alv_string);
  2405. X            break;
  2406. X        }
  2407. X        arglex();
  2408. X    }
  2409. X    list_integrators(project_name, 0);
  2410. X    if (project_name)
  2411. X        str_free(project_name);
  2412. X    trace((/*{*/"}\n"));
  2413. X}
  2414. X
  2415. X
  2416. Xstatic void remove_integrator_main _((void));
  2417. X
  2418. Xstatic void
  2419. Xremove_integrator_main()
  2420. X{
  2421. X    wlist        wl;
  2422. X    string_ty    *s1;
  2423. X    pstate        pstate_data;
  2424. X    int        j;
  2425. X    string_ty    *project_name;
  2426. X    project_ty    *pp;
  2427. X    user_ty        *up;
  2428. X
  2429. X    trace(("remove_integrator_main()\n{\n"/*}*/));
  2430. X    wl_zero(&wl);
  2431. X    project_name = 0;
  2432. X    while (arglex_token != arglex_token_eoln)
  2433. X    {
  2434. X        switch (arglex_token)
  2435. X        {
  2436. X        default:
  2437. X            generic_argument(remove_integrator_usage);
  2438. X            continue;
  2439. X
  2440. X        case arglex_token_string:
  2441. X            s1 = str_from_c(arglex_value.alv_string);
  2442. X            if (wl_member(&wl, s1))
  2443. X                fatal("user \"%s\" named more than once", s1->str_text);
  2444. X            wl_append(&wl, s1);
  2445. X            str_free(s1);
  2446. X            break;
  2447. X
  2448. X        case arglex_token_project:
  2449. X            if (arglex() != arglex_token_string)
  2450. X                remove_integrator_usage();
  2451. X            if (project_name)
  2452. X                fatal("duplicate -Project option");
  2453. X            project_name = str_from_c(arglex_value.alv_string);
  2454. X            break;
  2455. X        }
  2456. X        arglex();
  2457. X    }
  2458. X    if (!wl.wl_nwords)
  2459. X        fatal("no users named");
  2460. X
  2461. X    /*
  2462. X     * locate project data
  2463. X     */
  2464. X    if (!project_name)
  2465. X        project_name = user_default_project();
  2466. X    pp = project_alloc(project_name);
  2467. X    str_free(project_name);
  2468. X    project_bind_existing(pp);
  2469. X
  2470. X    /*
  2471. X     * locate user data
  2472. X     */
  2473. X    up = user_executing(pp);
  2474. X
  2475. X    /*
  2476. X     * lock the project for change
  2477. X     */
  2478. X    project_pstate_lock_prepare(pp);
  2479. X    lock_take();
  2480. X    pstate_data = project_pstate_get(pp);
  2481. X
  2482. X    /*
  2483. X     * check they are allowed to do this
  2484. X     */
  2485. X    if (!project_administrator_query(pp, user_name(up)))
  2486. X    {
  2487. X        project_fatal
  2488. X        (
  2489. X            pp,
  2490. X            "user \"%S\" is not an administrator",
  2491. X            user_name(up)
  2492. X        );
  2493. X    }
  2494. X
  2495. X    /*
  2496. X     * check they they are OK users
  2497. X     */
  2498. X    for (j = 0; j < wl.wl_nwords; ++j)
  2499. X    {
  2500. X        user_ty        *candidate;
  2501. X
  2502. X        candidate = user_symbolic(pp, wl.wl_word[j]);
  2503. X        if (!project_integrator_query(pp, user_name(candidate)))
  2504. X        {
  2505. X            project_fatal
  2506. X            (
  2507. X                pp,
  2508. X                "user \"%S\" is not an integrator",
  2509. X                user_name(candidate)
  2510. X            );
  2511. X        }
  2512. X        project_integrator_delete(pp, user_name(candidate));
  2513. X        user_free(candidate);
  2514. X    }
  2515. X
  2516. X    /*
  2517. X     * write out and release lock
  2518. X     */
  2519. X    project_pstate_write(pp);
  2520. X    commit();
  2521. X    lock_release();
  2522. X
  2523. X    /*
  2524. X     * verbose success message
  2525. X     */
  2526. X    for (j = 0; j < wl.wl_nwords; ++j)
  2527. X    {
  2528. X        project_verbose
  2529. X        (
  2530. X            pp,
  2531. X            "user \"%S\" is no longer an integrator",
  2532. X            wl.wl_word[j]
  2533. X        );
  2534. X    }
  2535. X    project_free(pp);
  2536. X    user_free(up);
  2537. X    trace((/*{*/"}\n"));
  2538. X}
  2539. X
  2540. X
  2541. Xvoid
  2542. Xremove_integrator()
  2543. X{
  2544. X    trace(("remove_integrator()\n{\n"/*}*/));
  2545. X    switch (arglex())
  2546. X    {
  2547. X    default:
  2548. X        remove_integrator_main();
  2549. X        break;
  2550. X
  2551. X    case arglex_token_help:
  2552. X        remove_integrator_help();
  2553. X        break;
  2554. X
  2555. X    case arglex_token_list:
  2556. X        remove_integrator_list(remove_integrator_usage);
  2557. X        break;
  2558. X    }
  2559. X    trace((/*{*/"}\n"));
  2560. X}
  2561. END_OF_FILE
  2562. if test 7902 -ne `wc -c <'aegis/aeri.c'`; then
  2563.     echo shar: \"'aegis/aeri.c'\" unpacked with wrong size!
  2564. fi
  2565. # end of 'aegis/aeri.c'
  2566. fi
  2567. if test -f 'aegis/aerrv.c' -a "${1}" != "-c" ; then 
  2568.   echo shar: Will not clobber existing file \"'aegis/aerrv.c'\"
  2569. else
  2570. echo shar: Extracting \"'aegis/aerrv.c'\" \(7843 characters\)
  2571. sed "s/^X//" >'aegis/aerrv.c' <<'END_OF_FILE'
  2572. X/*
  2573. X *    aegis - project change supervisor
  2574. X *    Copyright (C) 1991, 1992, 1993 Peter Miller.
  2575. X *    All rights reserved.
  2576. X *
  2577. X *    This program is free software; you can redistribute it and/or modify
  2578. X *    it under the terms of the GNU General Public License as published by
  2579. X *    the Free Software Foundation; either version 2 of the License, or
  2580. X *    (at your option) any later version.
  2581. X *
  2582. X *    This program is distributed in the hope that it will be useful,
  2583. X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  2584. X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2585. X *    GNU General Public License for more details.
  2586. X *
  2587. X *    You should have received a copy of the GNU General Public License
  2588. X *    along with this program; if not, write to the Free Software
  2589. X *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2590. X *
  2591. X * MANIFEST: functions to implement remove reviewer
  2592. X */
  2593. X
  2594. X#include <stdio.h>
  2595. X#include <stdlib.h>
  2596. X
  2597. X#include <ael.h>
  2598. X#include <aerrv.h>
  2599. X#include <arglex2.h>
  2600. X#include <commit.h>
  2601. X#include <error.h>
  2602. X#include <help.h>
  2603. X#include <lock.h>
  2604. X#include <option.h>
  2605. X#include <os.h>
  2606. X#include <project.h>
  2607. X#include <trace.h>
  2608. X#include <user.h>
  2609. X#include <word.h>
  2610. X
  2611. X
  2612. Xstatic void remove_reviewer_usage _((void));
  2613. X
  2614. Xstatic void
  2615. Xremove_reviewer_usage()
  2616. X{
  2617. X    char        *progname;
  2618. X
  2619. X    progname = option_progname_get();
  2620. X    fprintf(stderr, "usage: %s -Remove_Reviewer [ <option>... ] <username>...\n", progname);
  2621. X    fprintf(stderr, "       %s -Remove_Reviewer -List [ <option>... ]\n", progname);
  2622. X    fprintf(stderr, "       %s -Remove_Reviewer -Help\n", progname);
  2623. X    quit(1);
  2624. X}
  2625. X
  2626. X
  2627. Xstatic void remove_reviewer_help _((void));
  2628. X
  2629. Xstatic void
  2630. Xremove_reviewer_help()
  2631. X{
  2632. X    static char *text[] =
  2633. X    {
  2634. X"NAME",
  2635. X"    %s -Remove_ReViewer - remove reviewers from a project",
  2636. X"",
  2637. X"SYNOPSIS",
  2638. X"    %s -Remove_ReViewer <user-name>... [ <option>... ]",
  2639. X"    %s -Remove_ReViewer -List [ <option>... ]",
  2640. X"    %s -Remove_ReViewer -Help",
  2641. X"",
  2642. X"DESCRIPTION",
  2643. X"    The %s -Remove_ReViewer command is used to remove",
  2644. X"    reviewers from a project.",
  2645. X"",
  2646. X"OPTIONS",
  2647. X"    The following options are understood:",
  2648. X"",
  2649. X"    -Help",
  2650. X"        This option may be used to obtain more information",
  2651. X"        about how to use the %s program.",
  2652. X"",
  2653. X"    -List",
  2654. X"        This option may be used to obtain a list of suitable",
  2655. X"        subjects for this command.  The list may be more",
  2656. X"        general than expected.",
  2657. X"",
  2658. X"    -Project <name>",
  2659. X"        This option may be used to select the project of",
  2660. X"        interest.  When no -Project option is specified, the",
  2661. X"        AEGIS_PROJECT environment variable is consulted.  If",
  2662. X"        that does not exist, the user's $HOME/.aegisrc file",
  2663. X"        is examined for a default project field (see",
  2664. X"        aeuconf(5) for more information).  If that does not",
  2665. X"        exist, when the user is only working on changes",
  2666. X"        within a single project, the project name defaults",
  2667. X"        to that project.  Otherwise, it is an error.",
  2668. X"",
  2669. X"    -TERse",
  2670. X"        This option may be used to cause listings to produce",
  2671. X"        the bare minimum of information.  It is usually",
  2672. X"        useful for shell scripts.",
  2673. X"",
  2674. X"    -Verbose",
  2675. X"        This option may be used to cause %s to produce",
  2676. X"        more output.  By default %s only produces output",
  2677. X"        on errors.  When used with the -List option this",
  2678. X"        option causes column headings to be added.",
  2679. X"",
  2680. X"    All options may be abbreviated; the abbreviation is",
  2681. X"    documented as the upper case letters, all lower case",
  2682. X"    letters and underscores (_) are optional.  You must use",
  2683. X"    consecutive sequences of optional letters.",
  2684. X"",
  2685. X"    All options are case insensitive, you may type them in",
  2686. X"    upper case or lower case or a combination of both, case",
  2687. X"    is not important.",
  2688. X"",
  2689. X"    For example: the arguments \"-project, \"-PROJ\" and \"-p\"",
  2690. X"    are all interpreted to mean the -Project option.  The",
  2691. X"    argument \"-prj\" will not be understood, because",
  2692. X"    consecutive optional characters were not supplied.",
  2693. X"",
  2694. X"    Options and other command line arguments may be mixed",
  2695. X"    arbitrarily on the command line, after the function",
  2696. X"    selectors.",
  2697. X"",
  2698. X"    The GNU long option names are understood.  Since all",
  2699. X"    option names for aegis are long, this means ignoring the",
  2700. X"    extra leading '-'.  The \"--option=value\" convention is",
  2701. X"    also understood.",
  2702. X"",
  2703. X"RECOMMENDED ALIAS",
  2704. X"    The recommended alias for this command is",
  2705. X"    csh%%    alias aerrv '%s -rrv \\!* -v'",
  2706. X"    sh$    aerrv(){%s -rrv $* -v}",
  2707. X"",
  2708. X"ERRORS",
  2709. X"    It is an error if the current user is not an administrator",
  2710. X"    of the project.",
  2711. X"",
  2712. X"EXIT STATUS",
  2713. X"    The %s command will exit with a status of 1 on any error.",
  2714. X"    The %s command will only exit with a status of 0 if there",
  2715. X"    are no errors.",
  2716. X"",
  2717. X"COPYRIGHT",
  2718. X"    %C",
  2719. X"",
  2720. X"AUTHOR",
  2721. X"    %A",
  2722. X    };
  2723. X
  2724. X    help(text, SIZEOF(text), remove_reviewer_usage);
  2725. X}
  2726. X
  2727. X
  2728. Xstatic void remove_reviewer_list _((void (*)(void)));
  2729. X
  2730. Xstatic void
  2731. Xremove_reviewer_list(usage)
  2732. X    void        (*usage)_((void));
  2733. X{
  2734. X    string_ty    *project_name;
  2735. X
  2736. X    trace(("remove_reviewer_list()\n{\n"/*}*/));
  2737. X    project_name = 0;
  2738. X    arglex();
  2739. X    while (arglex_token != arglex_token_eoln)
  2740. X    {
  2741. X        switch (arglex_token)
  2742. X        {
  2743. X        default:
  2744. X            generic_argument(usage);
  2745. X            continue;
  2746. X
  2747. X        case arglex_token_project:
  2748. X            if (arglex() != arglex_token_string)
  2749. X                usage();
  2750. X            if (project_name)
  2751. X                fatal("duplicate -Project option");
  2752. X            project_name = str_from_c(arglex_value.alv_string);
  2753. X            break;
  2754. X        }
  2755. X        arglex();
  2756. X    }
  2757. X    list_reviewers(project_name, 0);
  2758. X    if (project_name)
  2759. X        str_free(project_name);
  2760. X    trace((/*{*/"}\n"));
  2761. X}
  2762. X
  2763. X
  2764. Xstatic void remove_reviewer_main _((void));
  2765. X
  2766. Xstatic void
  2767. Xremove_reviewer_main()
  2768. X{
  2769. X    wlist        wl;
  2770. X    string_ty    *s1;
  2771. X    pstate        pstate_data;
  2772. X    int        j;
  2773. X    string_ty    *project_name;
  2774. X    project_ty    *pp;
  2775. X    user_ty        *up;
  2776. X
  2777. X    trace(("remove_reviewer_main()\n{\n"/*}*/));
  2778. X    project_name = 0;
  2779. X    wl_zero(&wl);
  2780. X    while (arglex_token != arglex_token_eoln)
  2781. X    {
  2782. X        switch (arglex_token)
  2783. X        {
  2784. X        default:
  2785. X            generic_argument(remove_reviewer_usage);
  2786. X            continue;
  2787. X
  2788. X        case arglex_token_string:
  2789. X            s1 = str_from_c(arglex_value.alv_string);
  2790. X            if (wl_member(&wl, s1))
  2791. X                fatal("user \"%s\" named more than once", s1->str_text);
  2792. X            wl_append(&wl, s1);
  2793. X            str_free(s1);
  2794. X            break;
  2795. X
  2796. X        case arglex_token_project:
  2797. X            if (arglex() != arglex_token_string)
  2798. X                remove_reviewer_usage();
  2799. X            if (project_name)
  2800. X                fatal("duplicate -Project option");
  2801. X            project_name = str_from_c(arglex_value.alv_string);
  2802. X            break;
  2803. X        }
  2804. X        arglex();
  2805. X    }
  2806. X    if (!wl.wl_nwords)
  2807. X        fatal("no users named");
  2808. X
  2809. X    /*
  2810. X     * locate project data
  2811. X     */
  2812. X    if (!project_name)
  2813. X        project_name = user_default_project();
  2814. X    pp = project_alloc(project_name);
  2815. X    str_free(project_name);
  2816. X    project_bind_existing(pp);
  2817. X
  2818. X    /*
  2819. X     * locate user data
  2820. X     */
  2821. X    up = user_executing(pp);
  2822. X
  2823. X    /*
  2824. X     * lock the project for change
  2825. X     */
  2826. X    project_pstate_lock_prepare(pp);
  2827. X    lock_take();
  2828. X    pstate_data = project_pstate_get(pp);
  2829. X
  2830. X    /*
  2831. X     * check they are allowed to do this
  2832. X     */
  2833. X    if (!project_administrator_query(pp, user_name(up)))
  2834. X    {
  2835. X        project_fatal
  2836. X        (
  2837. X            pp,
  2838. X            "user \"%S\" is not an administrator",
  2839. X            user_name(up)
  2840. X        );
  2841. X    }
  2842. X
  2843. X    /*
  2844. X     * check they they are OK users
  2845. X     */
  2846. X    for (j = 0; j < wl.wl_nwords; ++j)
  2847. X    {
  2848. X        user_ty    *candidate;
  2849. X
  2850. X        candidate = user_symbolic(pp, wl.wl_word[j]);
  2851. X        if (!project_reviewer_query(pp, user_name(candidate)))
  2852. X        {
  2853. X            project_fatal
  2854. X            (
  2855. X                pp,
  2856. X                "user \"%S\" is not a reviewer",
  2857. X                user_name(candidate)
  2858. X            );
  2859. X        }
  2860. X        project_reviewer_delete(pp, user_name(candidate));
  2861. X        user_free(candidate);
  2862. X    }
  2863. X
  2864. X    /*
  2865. X     * write out and release lock
  2866. X     */
  2867. X    project_pstate_write(pp);
  2868. X    commit();
  2869. X    lock_release();
  2870. X
  2871. X    /*
  2872. X     * verbose success message
  2873. X     */
  2874. X    for (j = 0; j < wl.wl_nwords; ++j)
  2875. X    {
  2876. X        project_verbose
  2877. X        (
  2878. X            pp,
  2879. X            "user \"%S\" is no longer a reviewer",
  2880. X            wl.wl_word[j]
  2881. X        );
  2882. X    }
  2883. X    project_free(pp);
  2884. X    user_free(up);
  2885. X    trace((/*{*/"}\n"));
  2886. X}
  2887. X
  2888. X
  2889. Xvoid
  2890. Xremove_reviewer()
  2891. X{
  2892. X    trace(("remove_reviewer()\n{\n"/*}*/));
  2893. X    switch (arglex())
  2894. X    {
  2895. X    default:
  2896. X        remove_reviewer_main();
  2897. X        break;
  2898. X
  2899. X    case arglex_token_help:
  2900. X        remove_reviewer_help();
  2901. X        break;
  2902. X
  2903. X    case arglex_token_list:
  2904. X        remove_reviewer_list(remove_reviewer_usage);
  2905. X        break;
  2906. X    }
  2907. X    trace((/*{*/"}\n"));
  2908. X}
  2909. END_OF_FILE
  2910. if test 7843 -ne `wc -c <'aegis/aerrv.c'`; then
  2911.     echo shar: \"'aegis/aerrv.c'\" unpacked with wrong size!
  2912. fi
  2913. # end of 'aegis/aerrv.c'
  2914. fi
  2915. if test -f 'aegis/lex.c' -a "${1}" != "-c" ; then 
  2916.   echo shar: Will not clobber existing file \"'aegis/lex.c'\"
  2917. else
  2918. echo shar: Extracting \"'aegis/lex.c'\" \(7951 characters\)
  2919. sed "s/^X//" >'aegis/lex.c' <<'END_OF_FILE'
  2920. X/*
  2921. X *    aegis - project change supervisor
  2922. X *    Copyright (C) 1991, 1992, 1993 Peter Miller.
  2923. X *    All rights reserved.
  2924. X *
  2925. X *    This program is free software; you can redistribute it and/or modify
  2926. X *    it under the terms of the GNU General Public License as published by
  2927. X *    the Free Software Foundation; either version 2 of the License, or
  2928. X *    (at your option) any later version.
  2929. X *
  2930. X *    This program is distributed in the hope that it will be useful,
  2931. X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  2932. X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2933. X *    GNU General Public License for more details.
  2934. X *
  2935. X *    You should have received a copy of the GNU General Public License
  2936. X *    along with this program; if not, write to the Free Software
  2937. X *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2938. X *
  2939. X * MANIFEST: functions to perform lexical analysis on aegis' data files
  2940. X */
  2941. X
  2942. X#include <stdio.h>
  2943. X#include <stdlib.h>
  2944. X#include <errno.h>
  2945. X
  2946. X#include <error.h>
  2947. X#include <glue.h>
  2948. X#include <lex.h>
  2949. X#include <s-v-arg.h>
  2950. X#include <str.h>
  2951. X#include <gram.gen.h>    /* must be after <str.h> */
  2952. X
  2953. X
  2954. Xstatic    FILE        *fp;
  2955. Xstatic    int        line_number;
  2956. Xstatic    int        line_number_start;
  2957. Xstatic    char        *file_name;
  2958. Xstatic    int        error_count;
  2959. Xextern    gram_STYPE    gram_lval;
  2960. Xstatic    char        buffer[1 << 14];
  2961. X
  2962. X
  2963. Xvoid
  2964. Xlex_open(s)
  2965. X    char        *s;
  2966. X{
  2967. X    fp = glue_fopen(s, "r");
  2968. X    if (!fp)
  2969. X        nfatal("open \"%s\"", s);
  2970. X    file_name = s;
  2971. X    line_number = 1;
  2972. X    error_count = 0;
  2973. X}
  2974. X
  2975. X
  2976. Xvoid
  2977. Xlex_close()
  2978. X{
  2979. X    glue_fclose(fp);
  2980. X    fp = 0;
  2981. X    if (error_count)
  2982. X        fatal("%s: incorrect format", file_name);
  2983. X    file_name = 0;
  2984. X}
  2985. X
  2986. X
  2987. Xstatic int lex_getc _((void));
  2988. X
  2989. Xstatic int
  2990. Xlex_getc()
  2991. X{
  2992. X    int        c;
  2993. X
  2994. X    c = glue_fgetc(fp);
  2995. X    switch (c)
  2996. X    {
  2997. X    case EOF:
  2998. X        if (glue_ferror(fp))
  2999. X        {
  3000. X            nerror("%s", file_name);
  3001. X            ++error_count;
  3002. X        }
  3003. X        break;
  3004. X
  3005. X    case '\n':
  3006. X        ++line_number;
  3007. X        break;
  3008. X
  3009. X    default:
  3010. X        if (c < ' ' || c > '~')
  3011. X            gram_error("illegal '\\%o' character", c);
  3012. X        break;
  3013. X
  3014. X    case '\t':
  3015. X    case '\f':
  3016. X        break;
  3017. X    }
  3018. X    return c;
  3019. X}
  3020. X
  3021. X
  3022. Xstatic void lex_getc_undo _((int));
  3023. X
  3024. Xstatic void
  3025. Xlex_getc_undo(c)
  3026. X    int        c;
  3027. X{
  3028. X    switch (c)
  3029. X    {
  3030. X    case EOF:
  3031. X        break;
  3032. X
  3033. X    case '\n':
  3034. X        --line_number;
  3035. X        /* fall through... */
  3036. X
  3037. X    default:
  3038. X        glue_ungetc(c, fp);
  3039. X        break;
  3040. X    }
  3041. X}
  3042. X
  3043. X
  3044. Xint
  3045. Xgram_lex()
  3046. X{
  3047. X    int        c;
  3048. X    char        *cp;
  3049. X
  3050. X    for (;;)
  3051. X    {
  3052. X        c = lex_getc();
  3053. X        switch (c)
  3054. X        {
  3055. X        case ' ':
  3056. X        case '\t':
  3057. X        case '\f':
  3058. X        case '\n':
  3059. X            break;
  3060. X
  3061. X        case '0':
  3062. X            gram_lval.lv_integer = 0;
  3063. X            c = lex_getc();
  3064. X            if (c == 'x' || c == 'X')
  3065. X            {
  3066. X                int    ndigits;
  3067. X                int    n;
  3068. X
  3069. X                ndigits = 0;
  3070. X                n = 0;
  3071. X                for (;;)
  3072. X                {
  3073. X                    ++ndigits;
  3074. X                    c = lex_getc();
  3075. X                    switch (c)
  3076. X                    {
  3077. X                    case '0': case '1': case '2': case '3':
  3078. X                    case '4': case '5': case '6': case '7':
  3079. X                    case '8': case '9':
  3080. X                        n = 16 * n + c - '0';
  3081. X                        continue;
  3082. X    
  3083. X                    case 'A': case 'B': case 'C': case 'D':
  3084. X                    case 'E': case 'F': 
  3085. X                        n = 16 * n + c - 'A' + 10;
  3086. X                        continue;
  3087. X    
  3088. X                    case 'a': case 'b': case 'c': case 'd':
  3089. X                    case 'e': case 'f': 
  3090. X                        n = 16 * n + c - 'a' + 10;
  3091. X                        continue;
  3092. X    
  3093. X                    default:
  3094. X                        --ndigits;
  3095. X                        lex_getc_undo(c);
  3096. X                        break;
  3097. X                    }
  3098. X                    break;
  3099. X                }
  3100. X                if (!ndigits)
  3101. X                {
  3102. X                    gram_error("malformed hex constant");
  3103. X                    gram_lval.lv_integer = 0;
  3104. X                    return INTEGER;
  3105. X                }
  3106. X                gram_lval.lv_integer = n;
  3107. X                return INTEGER;
  3108. X            }
  3109. X            for (;;)
  3110. X            {
  3111. X                gram_lval.lv_integer =
  3112. X                    8 * gram_lval.lv_integer + c - '0';
  3113. X                c = lex_getc();
  3114. X                switch (c)
  3115. X                {
  3116. X                case '0': case '1': case '2': case '3':
  3117. X                case '4': case '5': case '6': case '7':
  3118. X                    continue;
  3119. X
  3120. X                default:
  3121. X                    lex_getc_undo(c);
  3122. X                    break;
  3123. X                }
  3124. X                break;
  3125. X            }
  3126. X            return INTEGER;
  3127. X
  3128. X        case '1': case '2': case '3': case '4':
  3129. X        case '5': case '6': case '7': case '8': case '9': 
  3130. X            gram_lval.lv_integer = 0;
  3131. X            for (;;)
  3132. X            {
  3133. X                gram_lval.lv_integer =
  3134. X                    10 * gram_lval.lv_integer + c - '0';
  3135. X                c = lex_getc();
  3136. X                switch (c)
  3137. X                {
  3138. X                case '0': case '1': case '2': case '3':
  3139. X                case '4': case '5': case '6': case '7':
  3140. X                case '8': case '9': 
  3141. X                    continue;
  3142. X
  3143. X                default:
  3144. X                    lex_getc_undo(c);
  3145. X                    break;
  3146. X                }
  3147. X                break;
  3148. X            }
  3149. X            return INTEGER;
  3150. X
  3151. X        case '"':
  3152. X            line_number_start = line_number;
  3153. X            cp = buffer;
  3154. X            for (;;)
  3155. X            {
  3156. X                c = lex_getc();
  3157. X                if (c == EOF)
  3158. X                {
  3159. X                    str_eof:
  3160. X                    line_number = line_number_start;
  3161. X                    gram_error("end-of-file within string");
  3162. X                    break;
  3163. X                }
  3164. X                if (c == '\n')
  3165. X                {
  3166. X                    line_number = line_number_start;
  3167. X                    gram_error("end-of-line within string");
  3168. X                    break;
  3169. X                }
  3170. X                if (c == '"')
  3171. X                    break;
  3172. X                if (c == '\\')
  3173. X                {
  3174. X                    c = lex_getc();
  3175. X                    switch (c)
  3176. X                    {
  3177. X                    default:
  3178. X                        gram_error("unknown '\\%c' escape", c);
  3179. X                        break;
  3180. X
  3181. X                    case '\n':
  3182. X                        break;
  3183. X
  3184. X                    case EOF:
  3185. X                        goto str_eof;
  3186. X
  3187. X                    case 'b':
  3188. X                        *cp++ = '\b';
  3189. X                        break;
  3190. X
  3191. X                    case 'n':
  3192. X                        *cp++ = '\n';
  3193. X                        break;
  3194. X
  3195. X                    case 'r':
  3196. X                        *cp++ = '\r';
  3197. X                        break;
  3198. X
  3199. X                    case 't':
  3200. X                        *cp++ = '\t';
  3201. X                        break;
  3202. X
  3203. X                    case 'f':
  3204. X                        *cp++ = '\f';
  3205. X                        break;
  3206. X
  3207. X                    case '"':
  3208. X                    case '\\':
  3209. X                        *cp++ = c;
  3210. X                        break;
  3211. X
  3212. X                    case '0': case '1': case '2': case '3':
  3213. X                    case '4': case '5': case '6': case '7':
  3214. X                        {
  3215. X                            int             n;
  3216. X                            int             v;
  3217. X
  3218. X                            v = 0;
  3219. X                            for (n = 0; n < 3; ++n)
  3220. X                            {
  3221. X                                v = v * 8 + c - '0';
  3222. X                                c = lex_getc();
  3223. X                                switch (c)
  3224. X                                {
  3225. X                                case '0':
  3226. X                                case '1':
  3227. X                                case '2':
  3228. X                                case '3':
  3229. X                                case '4':
  3230. X                                case '5':
  3231. X                                case '6':
  3232. X                                case '7':
  3233. X                                    continue;
  3234. X
  3235. X                                default:
  3236. X                                    lex_getc_undo(c);
  3237. X                                    break;
  3238. X                                }
  3239. X                                break;
  3240. X                            }
  3241. X                            *cp++ = v;
  3242. X                        }
  3243. X                        break;
  3244. X                    }
  3245. X                }
  3246. X                else
  3247. X                    *cp++ = c;
  3248. X            }
  3249. X            *cp = 0;
  3250. X            gram_lval.lv_string = str_from_c(buffer);
  3251. X            return STRING;
  3252. X
  3253. X        case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
  3254. X        case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
  3255. X        case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
  3256. X        case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
  3257. X        case 'Y': case 'Z': case '_':
  3258. X        case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
  3259. X        case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
  3260. X        case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
  3261. X        case 's': case 't': case 'u': case 'v': case 'w': case 'x':
  3262. X        case 'y': case 'z': 
  3263. X            cp = buffer;
  3264. X            for (;;)
  3265. X            {
  3266. X                *cp++ = c;
  3267. X                c = lex_getc();
  3268. X                switch (c)
  3269. X                {
  3270. X                case '0': case '1': case '2': case '3':
  3271. X                case '4': case '5': case '6': case '7':
  3272. X                case '8': case '9': 
  3273. X                case 'A': case 'B': case 'C': case 'D':
  3274. X                case 'E': case 'F': case 'G': case 'H':
  3275. X                case 'I': case 'J': case 'K': case 'L':
  3276. X                case 'M': case 'N': case 'O': case 'P':
  3277. X                case 'Q': case 'R': case 'S': case 'T':
  3278. X                case 'U': case 'V': case 'W': case 'X':
  3279. X                case 'Y': case 'Z': case '_':
  3280. X                case 'a': case 'b': case 'c': case 'd':
  3281. X                case 'e': case 'f': case 'g': case 'h':
  3282. X                case 'i': case 'j': case 'k': case 'l':
  3283. X                case 'm': case 'n': case 'o': case 'p':
  3284. X                case 'q': case 'r': case 's': case 't':
  3285. X                case 'u': case 'v': case 'w': case 'x':
  3286. X                case 'y': case 'z': 
  3287. X                    continue;
  3288. X
  3289. X                default:
  3290. X                    lex_getc_undo(c);
  3291. X                    break;
  3292. X                }
  3293. X                *cp = 0;
  3294. X                break;
  3295. X            }
  3296. X            gram_lval.lv_string = str_from_c(buffer);
  3297. X            return NAME;
  3298. X
  3299. X        case '/':
  3300. X            line_number_start = line_number;
  3301. X            c = lex_getc();
  3302. X            if (c != '*')
  3303. X            {
  3304. X                lex_getc_undo(c);
  3305. X                return '/';
  3306. X            }
  3307. X            for (;;)
  3308. X            {
  3309. X                for (;;)
  3310. X                {
  3311. X                    c = lex_getc();
  3312. X                    if (c == EOF)
  3313. X                    {
  3314. X                        bad_comment:
  3315. X                        line_number = line_number_start;
  3316. X                        gram_error("end-of-file within comment");
  3317. X                        quit(1);
  3318. X                    }
  3319. X                    if (c == '*')
  3320. X                        break;
  3321. X                }
  3322. X                for (;;)
  3323. X                {
  3324. X                    c = lex_getc();
  3325. X                    if (c == EOF)
  3326. X                        goto bad_comment;
  3327. X                    if (c != '*')
  3328. X                        break;
  3329. X                }
  3330. X                if (c == '/')
  3331. X                    break;
  3332. X            }
  3333. X            break;
  3334. X
  3335. X        default:
  3336. X            return c;
  3337. X        }
  3338. X    }
  3339. X}
  3340. X
  3341. X
  3342. Xvoid
  3343. Xgram_error(s sva_last)
  3344. X    char        *s;
  3345. X    sva_last_decl
  3346. X{
  3347. X    va_list         ap;
  3348. X
  3349. X    sva_init(ap, s);
  3350. X    vsprintf(buffer, s, ap);
  3351. X    va_end(ap);
  3352. X    error("%s: %d: %s", file_name, line_number, buffer);
  3353. X    if (++error_count >= 20)
  3354. X        fatal("%s: too many errors, bye!", file_name);
  3355. X}
  3356. END_OF_FILE
  3357. if test 7951 -ne `wc -c <'aegis/lex.c'`; then
  3358.     echo shar: \"'aegis/lex.c'\" unpacked with wrong size!
  3359. fi
  3360. # end of 'aegis/lex.c'
  3361. fi
  3362. if test -f 'common/trace.c' -a "${1}" != "-c" ; then 
  3363.   echo shar: Will not clobber existing file \"'common/trace.c'\"
  3364. else
  3365. echo shar: Extracting \"'common/trace.c'\" \(7721 characters\)
  3366. sed "s/^X//" >'common/trace.c' <<'END_OF_FILE'
  3367. X/*
  3368. X *    aegis - project change supervisor
  3369. X *    Copyright (C) 1991, 1992, 1993 Peter Miller.
  3370. X *    All rights reserved.
  3371. X *
  3372. X *    This program is free software; you can redistribute it and/or modify
  3373. X *    it under the terms of the GNU General Public License as published by
  3374. X *    the Free Software Foundation; either version 2 of the License, or
  3375. X *    (at your option) any later version.
  3376. X *
  3377. X *    This program is distributed in the hope that it will be useful,
  3378. X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  3379. X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  3380. X *    GNU General Public License for more details.
  3381. X *
  3382. X *    You should have received a copy of the GNU General Public License
  3383. X *    along with this program; if not, write to the Free Software
  3384. X *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  3385. X *
  3386. X * MANIFEST: functions for execution trace
  3387. X */
  3388. X
  3389. X#include <stdio.h>
  3390. X#include <string.h>
  3391. X#include <stddef.h>
  3392. X
  3393. X#include <error.h>
  3394. X#include <mem.h>
  3395. X#include <option.h>
  3396. X#include <s-v-arg.h>
  3397. X#include <str.h>
  3398. X#include <trace.h>
  3399. X
  3400. X
  3401. X#define INDENT 2
  3402. X
  3403. Xtypedef struct known_ty known_ty;
  3404. Xstruct known_ty
  3405. X{
  3406. X    string_ty    *filename;
  3407. X    int        flag;
  3408. X    int        *flag_p;
  3409. X    known_ty    *next;
  3410. X};
  3411. X
  3412. Xstatic    string_ty    *file_name;
  3413. Xstatic    int        line_number;
  3414. Xstatic    int        page_width;
  3415. Xstatic    known_ty    *known;
  3416. Xstatic    int        depth;
  3417. X
  3418. X
  3419. Xstatic string_ty *basename _((char *));
  3420. X
  3421. Xstatic string_ty *
  3422. Xbasename(file)
  3423. X    char        *file;
  3424. X{
  3425. X    char        *cp1;
  3426. X    char        *cp2;
  3427. X
  3428. X    cp1 = strrchr(file, '/');
  3429. X    if (cp1)
  3430. X        ++cp1;
  3431. X    else
  3432. X        cp1 = file;
  3433. X    cp2 = strrchr(cp1, '.');
  3434. X    if (!cp2)
  3435. X        cp2 = cp1 + strlen(cp1);
  3436. X    if (cp2 > cp1 + 6)
  3437. X        return str_n_from_c(cp1, 6);
  3438. X    return str_n_from_c(cp1, cp2 - cp1);
  3439. X}
  3440. X
  3441. X
  3442. Xint
  3443. Xtrace_pretest(file, result)
  3444. X    char        *file;
  3445. X    int        *result;
  3446. X{
  3447. X    string_ty    *s;
  3448. X    known_ty    *kp;
  3449. X
  3450. X    s = basename(file);
  3451. X    for (kp = known; kp; kp = kp->next)
  3452. X    {
  3453. X        if (str_equal(s, kp->filename))
  3454. X        {
  3455. X            str_free(s);
  3456. X            break;
  3457. X        }
  3458. X    }
  3459. X    if (!kp)
  3460. X    {
  3461. X        kp = (known_ty *)mem_alloc(sizeof(known_ty));
  3462. X        kp->filename = s;
  3463. X        kp->next = known;
  3464. X        kp->flag = 2; /* disabled */
  3465. X        known = kp;
  3466. X    }
  3467. X    kp->flag_p = result;
  3468. X    *result = kp->flag;
  3469. X    return *result;
  3470. X}
  3471. X
  3472. X
  3473. Xvoid
  3474. Xtrace_where(file, line)
  3475. X    char        *file;
  3476. X    int        line;
  3477. X{
  3478. X    string_ty    *s;
  3479. X
  3480. X    /*
  3481. X     * take new name fist, because will probably be same as last
  3482. X     * thus saving a free and a malloc (which are slow)
  3483. X     */
  3484. X    s = basename(file);
  3485. X    if (file_name)
  3486. X        str_free(file_name);
  3487. X    file_name = s;
  3488. X    line_number = line;
  3489. X}
  3490. X
  3491. X
  3492. Xstatic void trace_putchar _((int));
  3493. X
  3494. Xstatic void
  3495. Xtrace_putchar(c)
  3496. X    int        c;
  3497. X{
  3498. X    static char    buffer[MAX_PAGE_WIDTH + 2];
  3499. X    static char    *cp;
  3500. X    static int    in_col;
  3501. X    static int    out_col;
  3502. X
  3503. X    if (!page_width)
  3504. X    {
  3505. X        /* don't use last column, many terminals are dumb */
  3506. X        page_width = option_page_width_get() - 1;
  3507. X        /* allow for progname, filename and line number (8 each) */
  3508. X        page_width -= 24;
  3509. X        if (page_width < 16)
  3510. X            page_width = 16;
  3511. X    }
  3512. X    if (!cp)
  3513. X    {
  3514. X        strcpy(buffer, option_progname_get());
  3515. X        cp = buffer + strlen(buffer);
  3516. X        if (cp > buffer + 6)
  3517. X            cp = buffer + 6;
  3518. X        *cp++ = ':';
  3519. X        *cp++ = '\t';
  3520. X        strcpy(cp, file_name->str_text);
  3521. X        cp += file_name->str_length;
  3522. X        *cp++ = ':';
  3523. X        *cp++ = '\t';
  3524. X        sprintf(cp, "%d:\t", line_number);
  3525. X        cp += strlen(cp);
  3526. X        in_col = 0;
  3527. X        out_col = 0;
  3528. X    }
  3529. X    switch (c)
  3530. X    {
  3531. X    case '\n':
  3532. X        *cp++ = '\n';
  3533. X        *cp = 0;
  3534. X        fflush(stdout);
  3535. X        fputs(buffer, stderr);
  3536. X        fflush(stderr);
  3537. X        if (ferror(stderr))
  3538. X            nfatal("(stderr)");
  3539. X        cp = 0;
  3540. X        break;
  3541. X
  3542. X    case ' ':
  3543. X        if (out_col)
  3544. X            ++in_col;
  3545. X        break;
  3546. X
  3547. X    case '\t':
  3548. X        if (out_col)
  3549. X            in_col = (in_col/INDENT + 1) * INDENT;
  3550. X        break;
  3551. X
  3552. X    case /*{*/'}':
  3553. X    case /*(*/')':
  3554. X    case /*[*/']':
  3555. X        if (depth > 0)
  3556. X            --depth;
  3557. X        /* fall through */
  3558. X
  3559. X    default:
  3560. X        if (!out_col)
  3561. X        {
  3562. X            if (c != '#')
  3563. X                /* modulo so never too long */
  3564. X                in_col = (INDENT * depth) % page_width;
  3565. X            else
  3566. X                in_col = 0;
  3567. X        }
  3568. X        if (in_col >= page_width)
  3569. X        {
  3570. X            trace_putchar('\n');
  3571. X            trace_putchar(c);
  3572. X            return;
  3573. X        }
  3574. X        while (((out_col + 8) & -8) <= in_col && out_col + 1 < in_col)
  3575. X        {
  3576. X            *cp++ = '\t';
  3577. X            out_col = (out_col + 8) & -8;
  3578. X        }
  3579. X        while (out_col < in_col)
  3580. X        {
  3581. X            *cp++ = ' ';
  3582. X            ++out_col;
  3583. X        }
  3584. X        if (c == '{'/*}*/ || c == '('/*)*/ || c == '['/*]*/)
  3585. X            ++depth;
  3586. X        *cp++ = c;
  3587. X        in_col++;
  3588. X        out_col++;
  3589. X        break;
  3590. X    }
  3591. X}
  3592. X
  3593. X
  3594. Xvoid
  3595. Xtrace_printf(s sva_last)
  3596. X    char        *s;
  3597. X    sva_last_decl
  3598. X{
  3599. X    char        buffer[MAX_PAGE_WIDTH];
  3600. X    va_list        ap;
  3601. X
  3602. X    sva_init(ap, s);
  3603. X    vsprintf(buffer, s, ap);
  3604. X    va_end(ap);
  3605. X    for (s = buffer; *s; ++s)
  3606. X        trace_putchar(*s);
  3607. X}
  3608. X
  3609. X
  3610. Xvoid
  3611. Xtrace_enable(file)
  3612. X    char        *file;
  3613. X{
  3614. X    string_ty    *s;
  3615. X    known_ty    *kp;
  3616. X
  3617. X    s = basename(file);
  3618. X    for (kp = known; kp; kp = kp->next)
  3619. X    {
  3620. X        if (str_equal(s, kp->filename))
  3621. X        {
  3622. X            str_free(s);
  3623. X            break;
  3624. X        }
  3625. X    }
  3626. X    if (!kp)
  3627. X    {
  3628. X        kp = (known_ty *)mem_alloc(sizeof(known_ty));
  3629. X        kp->filename = s;
  3630. X        kp->flag_p = 0;
  3631. X        kp->next = known;
  3632. X        known = kp;
  3633. X    }
  3634. X    kp->flag = 3; /* enabled */
  3635. X    if (kp->flag_p)
  3636. X        *kp->flag_p = kp->flag;
  3637. X}
  3638. X
  3639. X
  3640. Xvoid
  3641. Xtrace_char_real(name, vp)
  3642. X    char        *name;
  3643. X    char        *vp;
  3644. X{
  3645. X    trace_printf("%s = '", name);
  3646. X    if (*vp < ' ' || *vp > '~' || strchr("(){}[]", *vp))
  3647. X    {
  3648. X        char    *s;
  3649. X
  3650. X        s = strchr("\bb\nn\tt\rr\ff", *vp);
  3651. X        if (s)
  3652. X        {
  3653. X            trace_putchar('\\');
  3654. X            trace_putchar(s[1]);
  3655. X        }
  3656. X        else
  3657. X            trace_printf("\\%03o", (unsigned char)*vp);
  3658. X    }
  3659. X    else
  3660. X    {
  3661. X        if (strchr("'\\", *vp))
  3662. X            trace_putchar('\\');
  3663. X        trace_putchar(*vp);
  3664. X    }
  3665. X    trace_printf("'; /* 0x%02X, %d */\n", (unsigned char)*vp, *vp);
  3666. X}
  3667. X
  3668. X
  3669. Xvoid
  3670. Xtrace_char_unsigned_real(name, vp)
  3671. X    char        *name;
  3672. X    unsigned char    *vp;
  3673. X{
  3674. X    trace_printf("%s = '", name);
  3675. X    if (*vp < ' ' || *vp > '~' || strchr("(){}[]", *vp))
  3676. X    {
  3677. X        char    *s;
  3678. X
  3679. X        s = strchr("\bb\nn\tt\rr\ff", *vp);
  3680. X        if (s)
  3681. X        {
  3682. X            trace_putchar('\\');
  3683. X            trace_putchar(s[1]);
  3684. X        }
  3685. X        else
  3686. X            trace_printf("\\%03o", *vp);
  3687. X    }
  3688. X    else
  3689. X    {
  3690. X        if (strchr("'\\", *vp))
  3691. X            trace_putchar('\\');
  3692. X        trace_putchar(*vp);
  3693. X    }
  3694. X    trace_printf("'; /* 0x%02X, %d */\n", *vp, *vp);
  3695. X}
  3696. X
  3697. X
  3698. Xvoid
  3699. Xtrace_int_real(name, vp)
  3700. X    char        *name;
  3701. X    int        *vp;
  3702. X{
  3703. X    trace_printf("%s = %d;\n", name, *vp);
  3704. X}
  3705. X
  3706. X
  3707. Xvoid
  3708. Xtrace_int_unsigned_real(name, vp)
  3709. X    char        *name;
  3710. X    unsigned int    *vp;
  3711. X{
  3712. X    trace_printf("%s = %u;\n", name, *vp);
  3713. X}
  3714. X
  3715. X
  3716. Xvoid
  3717. Xtrace_long_real(name, vp)
  3718. X    char        *name;
  3719. X    long        *vp;
  3720. X{
  3721. X    trace_printf("%s = %ld;\n", name, *vp);
  3722. X}
  3723. X
  3724. X
  3725. Xvoid
  3726. Xtrace_long_unsigned_real(name, vp)
  3727. X    char        *name;
  3728. X    unsigned long    *vp;
  3729. X{
  3730. X    trace_printf("%s = %lu;\n", name, *vp);
  3731. X}
  3732. X
  3733. X
  3734. Xvoid
  3735. Xtrace_pointer_real(name, vptrptr)
  3736. X    char        *name;
  3737. X    void        *vptrptr;
  3738. X{
  3739. X    void        **ptr_ptr = vptrptr;
  3740. X    void        *ptr;
  3741. X
  3742. X    ptr = *ptr_ptr;
  3743. X    if (!ptr)
  3744. X        trace_printf("%s = NULL;\n", name);
  3745. X    else
  3746. X        trace_printf("%s = 0x%08lX;\n", name, ptr);
  3747. X}
  3748. X
  3749. X
  3750. Xvoid
  3751. Xtrace_short_real(name, vp)
  3752. X    char        *name;
  3753. X    short        *vp;
  3754. X{
  3755. X    trace_printf("%s = %hd;\n", name, *vp);
  3756. X}
  3757. X
  3758. X
  3759. Xvoid
  3760. Xtrace_short_unsigned_real(name, vp)
  3761. X    char        *name;
  3762. X    unsigned short    *vp;
  3763. X{
  3764. X    trace_printf("%s = %hu;\n", name, *vp);
  3765. X}
  3766. X
  3767. X
  3768. Xvoid
  3769. Xtrace_string_real(name, vp)
  3770. X    char        *name;
  3771. X    char        *vp;
  3772. X{
  3773. X    char        *s;
  3774. X    long        count;
  3775. X
  3776. X    trace_printf("%s = ", name);
  3777. X    if (!vp)
  3778. X    {
  3779. X        trace_printf("NULL;\n");
  3780. X        return;
  3781. X    }
  3782. X    trace_printf("\"");
  3783. X    count = 0;
  3784. X    for (s = vp; *s; ++s)
  3785. X    {
  3786. X        switch (*s)
  3787. X        {
  3788. X        case '('/*)*/:
  3789. X        case '['/*]*/:
  3790. X        case '{'/*}*/:
  3791. X            ++count;
  3792. X            break;
  3793. X
  3794. X        case /*(*/')':
  3795. X        case /*[*/']':
  3796. X        case /*{*/'}':
  3797. X            --count;
  3798. X            break;
  3799. X        }
  3800. X    }
  3801. X    if (count > 0)
  3802. X        count = -count;
  3803. X    else
  3804. X        count = 0;
  3805. X    for (s = vp; *s; ++s)
  3806. X    {
  3807. X        int    c;
  3808. X
  3809. X        c = *s;
  3810. X        if (c < ' ' || c > '~')
  3811. X        {
  3812. X            char    *cp;
  3813. X
  3814. X            cp = strchr("\bb\ff\nn\rr\tt", c);
  3815. X            if (cp)
  3816. X                trace_printf("\\%c", cp[1]);
  3817. X            else
  3818. X            {
  3819. X                escape:
  3820. X                trace_printf("\\%03o", (unsigned char)c);
  3821. X            }
  3822. X        }
  3823. X        else
  3824. X        {
  3825. X            switch (c)
  3826. X            {
  3827. X            case '('/*)*/:
  3828. X            case '['/*]*/:
  3829. X            case '{'/*}*/:
  3830. X                ++count;
  3831. X                if (count <= 0)
  3832. X                    goto escape;
  3833. X                break;
  3834. X    
  3835. X            case /*(*/')':
  3836. X            case /*[*/']':
  3837. X            case /*{*/'}':
  3838. X                --count;
  3839. X                if (count < 0)
  3840. X                    goto escape;
  3841. X                break;
  3842. X
  3843. X            case '\\':
  3844. X            case '"':
  3845. X                trace_printf("\\");
  3846. X                break;
  3847. X            }
  3848. X            trace_printf("%c", c);
  3849. X        }
  3850. X    }
  3851. X    trace_printf("\";\n");
  3852. X}
  3853. X
  3854. X
  3855. Xvoid
  3856. Xtrace_indent_reset()
  3857. X{
  3858. X    depth = 0;
  3859. X}
  3860. END_OF_FILE
  3861. if test 7721 -ne `wc -c <'common/trace.c'`; then
  3862.     echo shar: \"'common/trace.c'\" unpacked with wrong size!
  3863. fi
  3864. # end of 'common/trace.c'
  3865. fi
  3866. if test -f 'doc/c1.3.so' -a "${1}" != "-c" ; then 
  3867.   echo shar: Will not clobber existing file \"'doc/c1.3.so'\"
  3868. else
  3869. echo shar: Extracting \"'doc/c1.3.so'\" \(7810 characters\)
  3870. sed "s/^X//" >'doc/c1.3.so' <<'END_OF_FILE'
  3871. X.\"
  3872. X.\"    aegis - project change supervisor
  3873. X.\"    Copyright (C) 1991, 1992, 1993 Peter Miller.
  3874. X.\"    All rights reserved.
  3875. X.\"
  3876. X.\"    This program is free software; you can redistribute it and/or modify
  3877. X.\"    it under the terms of the GNU General Public License as published by
  3878. X.\"    the Free Software Foundation; either version 2 of the License, or
  3879. X.\"    (at your option) any later version.
  3880. X.\"
  3881. X.\"    This program is distributed in the hope that it will be useful,
  3882. X.\"    but WITHOUT ANY WARRANTY; without even the implied warranty of
  3883. X.\"    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  3884. X.\"    GNU General Public License for more details.
  3885. X.\"
  3886. X.\"    You should have received a copy of the GNU General Public License
  3887. X.\"    along with this program; if not, write to the Free Software
  3888. X.\"    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  3889. X.\"
  3890. X.\" MANIFEST: User Guide, How Aegis Works, When (not) to use Aegis
  3891. X.\"
  3892. X.bp
  3893. X.nh 2 "When (not) to use Aegis"
  3894. X.LP
  3895. XThe aegis program is not a silver bullet;
  3896. Xit will not solve all of your problems.
  3897. XAegis is suitable for some kinds of projects,
  3898. Xuseful for others,
  3899. Xand useless for a few.
  3900. X.LP
  3901. XThe most difficult thing about the aegis program is that it takes
  3902. Xmanagement buy-in.
  3903. XIt takes effort to convince many people that the model
  3904. Xused by aegis has benefits,
  3905. Xand you need management backing you up when some person
  3906. Xcomes along with a way of developing software "without the extra work" imposed
  3907. Xby the model used by aegis program.
  3908. X.LP
  3909. XThere is extra up-front work: writing tests.
  3910. XThe win is that the tests hang around forever,
  3911. Xcatching minor and major slips before they become
  3912. Xembarrassing "features" in a released product.
  3913. XPrevention is cheaper than cure in this case,
  3914. Xthe tests save work down the track.
  3915. X.LP
  3916. XAll of the "extra work" of writing tests is a long-term win,
  3917. Xwhere old problems never again reappear.
  3918. XAll of the "extra work" of reviewing changes means that another pair of eyes
  3919. Xsights the code and finds potential problems before they manifest
  3920. Xthemselves in shipped product.
  3921. XAll of the "extra work" of integration ensures that the baseline always works,
  3922. Xand is always self-consistent.
  3923. XAll of the "extra work" of having a baseline and separate
  3924. Xdevelopment directories allows multiple parallel development,
  3925. Xwith no inter-developer interference;
  3926. Xand the baseline always works, it is never in an "in-between" state.
  3927. XIn each case,
  3928. Xnot doing this "extra work" is a false economy.
  3929. X.LP
  3930. XThe existence of these tests, though,
  3931. Xis what determines which projects are most suited to aegis and which are not.
  3932. XIt should be noted that suitability is a continuous scale,
  3933. Xnot black-and-white.
  3934. XWith effort and resources,
  3935. Xalmost anything fits.
  3936. X.nh 3 "Projects for which Aegis is Most Suitable"
  3937. X.LP
  3938. XProjects most suited to supervision by aegis are straight programs.
  3939. XWhat the non-systems-programmers out there call "tools" and
  3940. Xsometimes "applications".
  3941. XThese are programs which take a pile of input,
  3942. Xchew on it,
  3943. Xand emit a pile of output.
  3944. XThe tests can then compare actual outputs with expected outputs.
  3945. X.LP
  3946. XAs an example,
  3947. Xyou could be writing a
  3948. X.I sed (1)
  3949. Xlook-alike.
  3950. XIt is a public domain clone of the 
  3951. X.UX
  3952. Xsed utility.
  3953. XYou could write tests which exercise every feature (insertion, deletion, etc.)
  3954. Xand generate the expected output with the real
  3955. X.UX
  3956. Xsed.
  3957. XYou write the code,
  3958. Xand run the tests;
  3959. Xyou can immediately see if the output matches expectations.
  3960. X.LP
  3961. XThis is a simple example.
  3962. XMore complex examples exist,
  3963. Xsuch as aegis itself.
  3964. XThe aegis program is used to supervise its own development.
  3965. XTests consist of sequences of commands and expected results
  3966. Xare tested for.
  3967. X.LP
  3968. XOther types of software have been developed using aegis:
  3969. Xcompilers and interpreters,
  3970. Xclient-server model software,
  3971. Xmagnetic tape utilities,
  3972. Xgraphics software such as a ray-tracer.
  3973. XThe range is vast, but it is not all types of software.
  3974. X.nh 3 "Projects for which Aegis is Useful"
  3975. X.LP
  3976. XFor many years there have been full-screen applications on
  3977. Xtext terminals.
  3978. XIn more recent times there is increasing use of graphical interfaces.
  3979. X.LP
  3980. XIn developing these types of programs it is still possible to use aegis,
  3981. Xbut several options need to be explored.
  3982. X.nh 4 "Limited Testing"
  3983. X.LP
  3984. XYou may choose to use aegis simply for its ability to provide
  3985. Xcontrolled access to a large source.
  3986. XYou still get the history and change mechanisms,
  3987. Xthe baseline model,
  3988. Xthe enforced review.
  3989. XYou simply don't test all changes,
  3990. Xbecause figuring out what is on the screen,
  3991. Xand testing it against expectations, is too hard.
  3992. X.LP
  3993. XIf the program has a command line interface,
  3994. Xin addition to the full-screen or GUI interface,
  3995. Xthe functionality accessible from the command line may be tested using aegis.
  3996. X.LP
  3997. XIt is possible that "limited testing" actually means "no testing",
  3998. Xif you have no functionality accessible from the command line.
  3999. X.nh 4 "Testing Mode"
  4000. X.LP
  4001. XAnother alternative is to provide hooks into your program
  4002. Xallowing you to substitute a file for user input,
  4003. Xand to be able to trigger the dump of a "screen image".
  4004. XThe simulated user input can then be fed to the program,
  4005. Xand the screen dump (in some terminal-independent form)
  4006. Xcan be compared against expectations.
  4007. X.LP
  4008. XThis is easier for full-screen applications,
  4009. Xthan for X11 applications.
  4010. XYou need to judge the cost-benefit trade-off.
  4011. XCost of development,
  4012. Xcost of storage space for X11 images,
  4013. Xcost of
  4014. X.I not
  4015. Xtesting.
  4016. X.nh 4 "Manual Tests"
  4017. X.LP
  4018. XThe aegis program provides a manual test facility.
  4019. XIt was originally intended for programs which required
  4020. Xsome physical action from a user,
  4021. Xsuch as "unplug ethernet cable now" or "mount tape XG356B now".
  4022. XIt can also be used to have a user confirm that some
  4023. Xon-screen activity has happened.
  4024. X.LP
  4025. XThe problem with manual tests is that they simply don't happen.
  4026. XIt is far more pleasant to say "run the automatic tests" and go for
  4027. Xa cup of coffee,
  4028. Xthan to wait while the computer thinks of mindless things to ask you to do.
  4029. XThis is human nature:
  4030. Xif it can be automated, it is more likely to happen.
  4031. X.nh 3 "Projects for which Aegis is Least Suitable"
  4032. X.LP
  4033. XAnother class of software is things like operating system kernels
  4034. Xand firmware;
  4035. Xthings which are "stand alone".
  4036. XThis isolated nature makes it the most difficult to test:
  4037. Xto test it you want to provide physical input and watch the physical output.
  4038. XBy its very nature,
  4039. Xit is hard to put into a shell script,
  4040. Xand thus hard to write an aegis test for.
  4041. X.nh 4 "Operating Systems"
  4042. X.LP
  4043. XIt is not impossible,
  4044. Xjust that few of us have the resources to do it.
  4045. XYou need to have a test system and a testing system:
  4046. Xthe test system has all of its input and outputs connected
  4047. Xto the outputs and inputs of the testing system.
  4048. XThat is,
  4049. Xthe testing system controls and drives the test system,
  4050. Xand watches what happens.
  4051. X.LP
  4052. XFor example,
  4053. Xmany operating system vendors test their products by
  4054. Xusing computers connected to each serial line to simulate "user input".
  4055. XThe system can be rebooted this way,
  4056. Xand using dual-ported disks
  4057. Xallows different versions of a kernel to be tried,
  4058. Xor other test conditions created.
  4059. X.LP
  4060. XFor software houses which write kernels,
  4061. Xor device drivers for kernels,
  4062. Xor some other kernel work,
  4063. Xthis is bad news:
  4064. Xthe aegis program is probably not for you.
  4065. XIt is possible,
  4066. Xbut there may be more cost-effective development strategies.
  4067. XOf course, you could always use the rest of aegis,
  4068. Xand ignore the testing part.
  4069. X.nh 4 "Firmware"
  4070. X.LP
  4071. XFirmware is a similar deal:
  4072. Xyou need some way to download the code to be tested into the test system,
  4073. Xand write-protect it to simulate ROM,
  4074. Xand have the necessary hardware to drive the inputs and watch the outputs.
  4075. X.LP
  4076. XAs you can see,
  4077. Xthis is generally not available to run-of-the-mill software houses,
  4078. Xbut then they rarely write firmware, either.
  4079. XThose that do write firmware usually have the download capabilities,
  4080. Xand some kind of remote operation facility.
  4081. END_OF_FILE
  4082. if test 7810 -ne `wc -c <'doc/c1.3.so'`; then
  4083.     echo shar: \"'doc/c1.3.so'\" unpacked with wrong size!
  4084. fi
  4085. # end of 'doc/c1.3.so'
  4086. fi
  4087. if test -f 'doc/c2.4.so' -a "${1}" != "-c" ; then 
  4088.   echo shar: Will not clobber existing file \"'doc/c2.4.so'\"
  4089. else
  4090. echo shar: Extracting \"'doc/c2.4.so'\" \(7508 characters\)
  4091. sed "s/^X//" >'doc/c2.4.so' <<'END_OF_FILE'
  4092. X.\"
  4093. X.\"    aegis - project change supervisor
  4094. X.\"    Copyright (C) 1991, 1992, 1993 Peter Miller.
  4095. X.\"    All rights reserved.
  4096. X.\"
  4097. X.\"    This program is free software; you can redistribute it and/or modify
  4098. X.\"    it under the terms of the GNU General Public License as published by
  4099. X.\"    the Free Software Foundation; either version 2 of the License, or
  4100. X.\"    (at your option) any later version.
  4101. X.\"
  4102. X.\"    This program is distributed in the hope that it will be useful,
  4103. X.\"    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4104. X.\"    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  4105. X.\"    GNU General Public License for more details.
  4106. X.\"
  4107. X.\"    You should have received a copy of the GNU General Public License
  4108. X.\"    along with this program; if not, write to the Free Software
  4109. X.\"    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  4110. X.\"
  4111. X.\" MANIFEST: User Guide, The Change Development Cycle, The Administrator
  4112. X.\"
  4113. X.bp
  4114. X.nh 2 "The Administrator"
  4115. X.LP
  4116. XThe previous discussion of developers, reviewers and integrators
  4117. Xhas covered many aspects of the production of software using the aegis program.
  4118. XThe administrator has responsibility for everything they don't,
  4119. Xbut there is very little left.
  4120. X.LP
  4121. XThese responsibilities include:
  4122. X.LP
  4123. X\(bu access control:
  4124. XThe administrator adds and removes all categories of user,
  4125. Xincluding administrators.
  4126. XThis is on a per-project basis,
  4127. Xand has nothing to do with 
  4128. X.UX
  4129. Xuser administration.
  4130. XThis simply nominates which users may do what.
  4131. X.LP
  4132. X\(bu change creation:
  4133. XThe administrator adds (and sometimes removes) changes to the system.
  4134. XAt later stages,
  4135. Xdevelopers may alter some attributes of the change,
  4136. Xsuch as the description,
  4137. Xto say what they fixed.
  4138. X.LP
  4139. X\(bu project creation:
  4140. XThe aegis program does not limit who may create projects,
  4141. Xbut when a project is created the user who created the project
  4142. Xis set to be the administrator of that project.
  4143. X.LP
  4144. XAll of these things will be examined 
  4145. X.nh 3 "The First Change"
  4146. X.LP
  4147. XMany things need to happen before
  4148. Xdevelopment can begin on
  4149. Xthe first change;
  4150. Xthe project must be created,
  4151. Xthe staff but be given access permissions,
  4152. Xthe change must be created.
  4153. X.E(
  4154. Xalex% \f(CBaenpr example -dir /projects/example\fP
  4155. Xaegis: project "example": project directory "/projects/example"
  4156. Xaegis: project "example": created
  4157. Xalex%
  4158. X.E)
  4159. XOnce the project has been created,
  4160. Xthe project attributes are set.
  4161. XAlex will set the desired project attributes using the
  4162. X.B -Edit
  4163. Xoption of the
  4164. X.B aepa
  4165. Xcommand.
  4166. XThis will invoke an editor (\fIvi\fP(1) by default)
  4167. Xit edit the project attributes.
  4168. XAlex edits them to look like this:
  4169. X.E(
  4170. Xdescription = "Aegis Documentation Example Project";
  4171. Xdeveloper_may_review = false;
  4172. Xdeveloper_may_integrate = false;
  4173. Xreviewer_may_integrate = false;
  4174. X.E)
  4175. XThe project attributes are set as follows:
  4176. X.E(
  4177. Xalex% \f(CBaepa -edit -p example\fP
  4178. X\fI\&...edit as above...\fP
  4179. Xaegis: project "example": attributes changed
  4180. Xalex% \f(CBael p\fP
  4181. XList of Projects
  4182. X
  4183. XProject Directory               Description
  4184. X------- -----------             -------------
  4185. Xexample /projects/example       Aegis Documentation Example
  4186. X                                Project
  4187. Xalex%
  4188. X.E)
  4189. XThe various staff must be added to the project.
  4190. XDevelopers are the only staff who may actually edit files.
  4191. X.E(
  4192. Xalex% \f(CBaend pat jan sam -p example\fP
  4193. Xaegis: project "example": user "pat" is now a developer
  4194. Xaegis: project "example": user "jan" is now a developer
  4195. Xaegis: project "example": user "sam" is now a developer
  4196. Xalex%
  4197. X.E)
  4198. XReviewers may veto a change.
  4199. XThere may be overlap between the various categories,
  4200. Xas show here for Jan:
  4201. X.E(
  4202. Xalex% \f(CBaenr robyn jan -p example\fP
  4203. Xaegis: project "example": user "robyn" is now a reviewer
  4204. Xaegis: project "example": user "jan" is now a reviewer
  4205. Xalex%
  4206. X.E)
  4207. XThe next role we need to fill is an integrator.
  4208. X.E(
  4209. Xalex% \f(CBaeni isa -p example\fP
  4210. Xaegis: project "example": user "isa" is now an integrator
  4211. Xalex%
  4212. X.E)
  4213. XOnce the staff have been given access,
  4214. XAlex creates the first change.
  4215. XThe
  4216. X.B -Edit
  4217. Xoption of the
  4218. X.B annc
  4219. Xcommand is used,
  4220. Xto create the attributes of the change.
  4221. XThey are edited to look like this:
  4222. X.E(
  4223. Xbrief_description = "Create initial skeleton.";
  4224. Xdescription = "A simple calculator using native \e
  4225. Xfloating point precision.  \e
  4226. XThe four basic arithmetic operators to be provided, \e
  4227. Xusing conventional infix notation.  \e
  4228. XParentheses and negation also required.";
  4229. Xcause = internal_enhancement;
  4230. X.E)
  4231. XThe change is created as follows:
  4232. X.E(
  4233. Xalex% \f(CBaenc -edit -p example\fP
  4234. X\fI\&...edit as above...\fP
  4235. Xaegis: project "example": change 1: created
  4236. Xalex%
  4237. X.E)
  4238. XAt this point,
  4239. XAlex walks down the hall to Jan's office,
  4240. Xto ask Jan to develop the first change.
  4241. XJan has had some practice using aegis,
  4242. Xand can be relied on to do the rest of the project configuration speedily.
  4243. X.nh 3 "The Second Change"
  4244. X.LP
  4245. XSome time later,
  4246. XAlex patiently sits through the whining and grumbling of an
  4247. Xespecially pedantic user.
  4248. XThe following change description is duly entered:
  4249. X.E(
  4250. Xbrief_description = "file names on command line";
  4251. Xdescription = "Optional input and output files may be \e
  4252. Xspecified on the command line.";
  4253. Xcause = internal_bug;
  4254. X.E)
  4255. X.LP
  4256. XThe pedantic user wanted to be able to name
  4257. Xfiles on the command line,
  4258. Xrather than use I/O redirection.
  4259. XAlso,
  4260. Xhaving a bug in this example is useful.
  4261. XThe change is created as follows:
  4262. X.E(
  4263. Xalex% \f(CBaenc -edit -p example\fP
  4264. X\fI\&...edit as above...\fP
  4265. Xaegis: project "example": change 2: created
  4266. Xalex%
  4267. X.E)
  4268. XAt some point a developer will notice this change
  4269. Xand start work on it.
  4270. X.nh 3 "The Third Change"
  4271. X.LP
  4272. XOther features are required for the calculator,
  4273. Xand also for this example.
  4274. XThe second change adds exponentiation to the calculator,
  4275. Xand is described as follows:
  4276. X.E(
  4277. Xbrief_description = "add powers";
  4278. Xdescription = "Enhance the grammar to allow exponentiation.  \e
  4279. XNo error checking required.";
  4280. Xcause = internal_enhancement;
  4281. X.E)
  4282. X.LP
  4283. XThe change is created as follows:
  4284. X.E(
  4285. Xalex% \f(CBaenc -edit -p example\fP
  4286. X\fI\&...edit as above...\fP
  4287. Xaegis: project "example": change 3: created
  4288. Xalex%
  4289. X.E)
  4290. XAt some point a developer will notice,
  4291. Xand this change will be worked on.
  4292. X.nh 3 "The Fourth Change"
  4293. X.LP
  4294. XA fourth change,
  4295. Xthis time adding variables to the calculator
  4296. Xis added.
  4297. X.E(
  4298. Xbrief_description = "add variables";
  4299. Xdescription = "Enhance the grammar to allow variables.  \e
  4300. XOnly single letter variable names are required.";
  4301. Xcause = internal_enhancement;
  4302. X.E)
  4303. X.LP
  4304. XThe change is created as follows:
  4305. X.E(
  4306. Xalex% \f(CBaenc -edit -p example\fP
  4307. X\fI\&...edit as above...\fP
  4308. Xaegis: project "example": change 4: created
  4309. Xalex%
  4310. X.E)
  4311. XAt some point a developer will notice,
  4312. Xand this change will be worked on.
  4313. X.nh 3 "Administrator Command Summary"
  4314. X.LP
  4315. XOnly a few of the aegis commands available to administrators have
  4316. Xbeen used in this example.
  4317. XThe following table (very tersely) describes the aegis commands most useful to administrators.
  4318. X.sp
  4319. X.TS
  4320. Xcenter,tab(;);
  4321. Xl l.
  4322. XCommand;Description
  4323. X_
  4324. Xaeca;edit Change Attributes
  4325. Xael;List Stuff
  4326. Xaena;New Administrator
  4327. Xaenc;New Change
  4328. Xaencu;New Change Undo
  4329. Xaend;New Developer
  4330. Xaeni;New Integrator
  4331. Xaenpr;New Project
  4332. Xaenrv;New Reviewer
  4333. Xaepa;edit Project Attributes
  4334. Xaera;Remove Administrator
  4335. Xaerd;Remove Developer
  4336. Xaeri;Remove Integrator
  4337. Xaermpr;Remove Project
  4338. Xaerrv;Remove Reviewer
  4339. X.TE
  4340. X.LP
  4341. XYou will want to read the manual entries for all of these commands.
  4342. XNote that all aegis commands have a
  4343. X.I \-Help
  4344. Xoption,
  4345. Xwhich will give a result very similar to the
  4346. Xcorresponding
  4347. X.I man (1)
  4348. Xoutput.
  4349. XMost aegis commands also have a
  4350. X.I \-List
  4351. Xoption,
  4352. Xwhich usually lists interesting context sensitive information.
  4353. END_OF_FILE
  4354. if test 7508 -ne `wc -c <'doc/c2.4.so'`; then
  4355.     echo shar: \"'doc/c2.4.so'\" unpacked with wrong size!
  4356. fi
  4357. # end of 'doc/c2.4.so'
  4358. fi
  4359. if test -f 'doc/c4.2.so' -a "${1}" != "-c" ; then 
  4360.   echo shar: Will not clobber existing file \"'doc/c4.2.so'\"
  4361. else
  4362. echo shar: Extracting \"'doc/c4.2.so'\" \(8145 characters\)
  4363. sed "s/^X//" >'doc/c4.2.so' <<'END_OF_FILE'
  4364. X.\"
  4365. X.\"    aegis - project change supervisor
  4366. X.\"    Copyright (C) 1993 Peter Miller.
  4367. X.\"    All rights reserved.
  4368. X.\"
  4369. X.\"    This program is free software; you can redistribute it and/or modify
  4370. X.\"    it under the terms of the GNU General Public License as published by
  4371. X.\"    the Free Software Foundation; either version 2 of the License, or
  4372. X.\"    (at your option) any later version.
  4373. X.\"
  4374. X.\"    This program is distributed in the hope that it will be useful,
  4375. X.\"    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4376. X.\"    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  4377. X.\"    GNU General Public License for more details.
  4378. X.\"
  4379. X.\"    You should have received a copy of the GNU General Public License
  4380. X.\"    along with this program; if not, write to the Free Software
  4381. X.\"    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  4382. X.\"
  4383. X.\" MANIFEST: User Guide, The Dependency Maintenance Tool, Cook
  4384. X.\"
  4385. X.bp
  4386. X.nh 2 "Cook"
  4387. X.LP
  4388. XThe
  4389. X.I cook
  4390. Xprogram is the only dependency maintenance tool,
  4391. Xknown to the author,
  4392. Xwhich is sufficiently capable to supply aegis' needs.\**
  4393. X.FS
  4394. XThe version in use when writing this section was 1.3.
  4395. XEarlier versions are known to work with aegis,
  4396. Xbut the recipes are horribly cumbersome.
  4397. X.FE
  4398. X.LP
  4399. XEventually this section will provide templates for constructing
  4400. X.I Howto.cook
  4401. Xfile (Howto.cook is to cook what Makefile is to make).
  4402. X.LP
  4403. XThis section will discuss the
  4404. X.I build_command
  4405. Xand
  4406. X.I integrate_build_command
  4407. Xand
  4408. X.I link_baseline
  4409. Xand
  4410. X.I change_file_command
  4411. Xand
  4412. X.I project_file_command
  4413. Xfields of the
  4414. X.I config
  4415. Xfile.
  4416. X.LP
  4417. XIn the mean time,
  4418. Xsee
  4419. X.I aepconf 5
  4420. Xfor more information.
  4421. X.nh 3 "Invoking Cook"
  4422. X.LP
  4423. XThe
  4424. X.I build_command
  4425. Xfield of the
  4426. X.I config
  4427. Xfile is used to invoke the relevant build command.
  4428. XIn this case, it is set as follows
  4429. X.E(
  4430. Xbuild_command =
  4431. X    "cook -b ${s Howto.cook} project=$p change=$c version=$v -nl";
  4432. X.E)
  4433. X.LP
  4434. XThis command tells cook
  4435. Xwhere to find the recipes.
  4436. XThe \f(CW${s Howto.cook}\fR expands to a path into the baseline
  4437. Xduring development
  4438. Xif the file is not in the change.
  4439. XLook in
  4440. X.I aesub (5)
  4441. Xfor more information about command substitutions.
  4442. X.LP
  4443. XThe recipes which follow will all remove their targets before constructing
  4444. Xthem, which qualifies them for the next entry in the
  4445. X.I config
  4446. Xfile:
  4447. X.E(
  4448. Xlink_integration_directory = true;
  4449. X.E)
  4450. X.LP
  4451. XThe files must be removed first, otherwise the baseline would
  4452. Xcease to be self-consistent.
  4453. X.nh 3 "The Recipe File"
  4454. X.LP
  4455. XThe file containing the recipes is called
  4456. X.I Howto.cook
  4457. Xand is given to cook on the command line.
  4458. X.LP
  4459. XThe following items are preamble to the rest of the file;
  4460. Xthey ask aegis for the source files of the project and change
  4461. Xso that cook can determine what needs to be compiled and linked.
  4462. X.E(
  4463. Xproject_files =
  4464. X    [collect aegis -l pf -terse -p [project] -c [change]];
  4465. Xchange_files =
  4466. X    [collect aegis -l cf -terse -p [project] -c [change]];
  4467. Xsource_files =
  4468. X    [sort [project_files] [change_files]];
  4469. X.E)
  4470. X.LP
  4471. XThis example continues the one from chapter 3,
  4472. Xand thus has a single executable
  4473. Xto be linked from all the object files
  4474. X.E(
  4475. Xobject_files =
  4476. X    [fromto %.y %.o [match_mask %.y [source_files]
  4477. X    [fromto %.l %.o [match_mask %.l [source_files]
  4478. X    [fromto %.c %.o [match_mask %.c [source_files]
  4479. X    ;
  4480. X.E)
  4481. X.LP
  4482. XIt is necessary to determine if this is a development build,
  4483. Xand thus has the baseline for additional ingredients searches,
  4484. Xor an integration build, which does not.
  4485. XThe version supplied by aegis will tell us this information,
  4486. Xbecause it will be \fImajor.minor.\fRC\fIchange\fR for development builds and
  4487. X\fImajor.minor.\fRD\fIdelta\fR for integration builds.
  4488. X.E(
  4489. Xif [match_mask %1C%2 [version]] then
  4490. X{
  4491. X    baseline = [collect aegis -cd -bl -p [project]];
  4492. X    search_list = . [baseline];
  4493. X}
  4494. X.E)
  4495. X.LP
  4496. XThe
  4497. X.I search_list
  4498. Xvariable in cook is the list of directories to search for dependencies;
  4499. Xit defaults to only the current directory.
  4500. XThe
  4501. X.I resolve
  4502. Xbuiltin function of cook
  4503. Xmay be used to ask cook for the name of the file actually used to resolve dependencies,
  4504. Xso that recipe bodies may reference the appropriate file:
  4505. X.E(
  4506. Xexample: [object_files]
  4507. X{
  4508. X    [cc] -o example [resolve [object_files]] -ly -ll;
  4509. X}
  4510. X.E)
  4511. X.LP
  4512. XThis recipe says that to cook the example program,
  4513. Xyou need the object files determined earlier,
  4514. Xand them link them together.
  4515. XObject files which were up to date in the baseline are used wherever possible,
  4516. Xbut files which were out of date are constructed in the current directory
  4517. Xand those will be linked.
  4518. X.nh 3 "The Recipe for C"
  4519. X.LP
  4520. XNext we need to tell cook how to manage C sources.
  4521. XOn the surface, this is a simple recipe:
  4522. X.E(
  4523. X%.o: %.c
  4524. X{
  4525. X    rm %.o;
  4526. X    [cc] [cc_flags] -c %.c;
  4527. X}
  4528. X.E)
  4529. X.LP
  4530. XUnfortunately it has forgotten about finding the include file dependencies.
  4531. XThe cook package includes a program called
  4532. X.I c_incl
  4533. Xwhich is used to find them.
  4534. XThe recipe now becomes
  4535. X.E(
  4536. X%.o: %.c: [collect c_incl -eia %.c]
  4537. X{
  4538. X    rm %.o;
  4539. X    [cc] [cc_flags] -c %.c;
  4540. X}
  4541. X.E)
  4542. X.LP
  4543. XThe file may not always be present to be removed (causing a fatal error),
  4544. Xand it is irritation to execute a redundant command,
  4545. Xso the remove is mangled to look like this:
  4546. X.E(
  4547. X%.o: %.c: [collect c_incl -eia %.c]
  4548. X{
  4549. X    if [exists %.o] then
  4550. X        rm %.o
  4551. X            set clearstat;
  4552. X    [cc] [cc_flags] -c %.c;
  4553. X}
  4554. X.E)
  4555. X.LP
  4556. XThe "set clearstat" clause tells cook that the command will
  4557. Xinvalidate parts of its
  4558. X.I stat
  4559. Xcache,
  4560. Xand to look at the command for what to invalidate.
  4561. X.LP
  4562. XAnother thing this recipe needs is to use the baseline
  4563. Xfor include files not in a change,
  4564. Xand so the recipe is altered again:
  4565. X.E(
  4566. X%.o: %.c: [collect c_incl -eia [prepost "-I" "" [search_list]] %.c]
  4567. X{
  4568. X    if [exists %.o] then
  4569. X        rm %.o
  4570. X            set clearstat;
  4571. X    [cc] [cc_flags] [prepost "-I" "" [search_list]] -c %.c;
  4572. X}
  4573. X.E)
  4574. X.LP
  4575. XSee the
  4576. X.I "Cook Reference Manual"
  4577. Xfor a description of the
  4578. X.I prepost
  4579. Xbuiltin function,
  4580. Xand other cook details.
  4581. X.LP
  4582. XUnfortunately,
  4583. Xthere is one last change that must be made to this recipe,
  4584. Xit must use the resolve function to reference the appropriate file
  4585. Xonce cook has found it on the search list:
  4586. X.E(
  4587. X%.o: %.c: [collect c_incl -eia [prepost "-I" "" [search_list]]
  4588. X    [resolve %.c]]
  4589. X{
  4590. X    if [exists %.o] then
  4591. X        rm %.o
  4592. X            set clearstat;
  4593. X    [cc] [cc_flags] [prepost "-I" "" [search_list]]
  4594. X        -c [resolve %.c];
  4595. X}
  4596. X.E)
  4597. X.LP
  4598. XOnly use this last recipe for C sources,
  4599. Xthe others are only shown so that the derivation of the recipe is clear;
  4600. Xwhile it is very similar to the original,
  4601. Xit looks daunting at first.
  4602. X.nh 3 "The Recipe for Yacc"
  4603. X.LP
  4604. XHaving explained the complexities of the recipes in the above section about C,
  4605. Xthe recipe for yacc will be given without delay:
  4606. X.E(
  4607. X%.c %.h: %.y
  4608. X{
  4609. X    if [exists %.c] then
  4610. X        rm %.c
  4611. X            set clearstat;
  4612. X    if [exists %.h] then
  4613. X        rm %.h
  4614. X            set clearstat;
  4615. X    [yacc] [yacc_flags] -d [resolve %.y];
  4616. X    mv y.tab.c %.c;
  4617. X    mv y.tab.h %.h;
  4618. X}
  4619. X.E)
  4620. X.LP
  4621. XThis  recipe could be jazzed up to cope with the listing file,
  4622. Xtoo,
  4623. Xif that was desired,
  4624. Xbut this is sufficient to work with the example.
  4625. X.LP
  4626. XCook's ability to cope with transitive dependencies will
  4627. Xpick up the generated .c file and construct the necessary .o file.
  4628. X.nh 3 "The Recipe for Lex"
  4629. X.LP
  4630. XThe recipe for lex is vary similar to the recipe for yacc.
  4631. X.E(
  4632. X%.c: %.l
  4633. X{
  4634. X    if [exists %.c] then
  4635. X        rm %.c
  4636. X            set clearstat;
  4637. X    [lex] [lex_flags] -d [resolve %.l];
  4638. X    mv lex.yy.c %.c;
  4639. X}
  4640. X.E)
  4641. X.LP
  4642. XCook's ability to cope with transitive dependencies will
  4643. Xpick up the generated .c file and construct the necessary .o file.
  4644. X.nh 3 "Recipes for Documents"
  4645. X.LP
  4646. XYou can format documents,
  4647. Xsuch as user guides and manual entries with aegis and cook,
  4648. Xand the recipes are similar
  4649. Xto the ones above.
  4650. X.E(
  4651. X%.ps: %.ms: [collect c_incl -r -eia [prepost "-I" "" [search_list]]
  4652. X    [resolve %.ms]]
  4653. X{
  4654. X    roffpp [prepost "-I" "" [search_list]] [resolve %.ms]
  4655. X        | groff -p -t -ms > [target];
  4656. X}
  4657. X.E)
  4658. X.LP
  4659. XThis recipe says to run the document through groff,
  4660. Xwith the
  4661. X.I pic (1)
  4662. Xand
  4663. X.I tbl (1)
  4664. Xfilters,
  4665. Xuse the
  4666. X.I ms (7)
  4667. Xmacro package,
  4668. Xto produce PostScript output.
  4669. XThe
  4670. X.I roffpp
  4671. Xprogram comes with cook,
  4672. Xand is like
  4673. X.I soelim (1)
  4674. Xbut it takes include search path options on the command line.
  4675. X.LP
  4676. XManual entries may be handled in a similar way
  4677. X.E(
  4678. X%.cat: %.man: [collect c_incl -r -eia [prepost "-I" ""
  4679. X    [search_list]] [resolve %.man]]
  4680. X{
  4681. X    roffpp [prepost "-I" "" [search_list]] [resolve %.man]
  4682. X        | tbl | nroff -man > [target];
  4683. X}
  4684. X.E)
  4685. END_OF_FILE
  4686. if test 8145 -ne `wc -c <'doc/c4.2.so'`; then
  4687.     echo shar: \"'doc/c4.2.so'\" unpacked with wrong size!
  4688. fi
  4689. # end of 'doc/c4.2.so'
  4690. fi
  4691. if test -f 'fmtgen/type_list.c' -a "${1}" != "-c" ; then 
  4692.   echo shar: Will not clobber existing file \"'fmtgen/type_list.c'\"
  4693. else
  4694. echo shar: Extracting \"'fmtgen/type_list.c'\" \(7919 characters\)
  4695. sed "s/^X//" >'fmtgen/type_list.c' <<'END_OF_FILE'
  4696. X/*
  4697. X *    aegis - project change supervisor
  4698. X *    Copyright (C) 1991, 1992, 1993 Peter Miller.
  4699. X *    All rights reserved.
  4700. X *
  4701. X *    This program is free software; you can redistribute it and/or modify
  4702. X *    it under the terms of the GNU General Public License as published by
  4703. X *    the Free Software Foundation; either version 2 of the License, or
  4704. X *    (at your option) any later version.
  4705. X *
  4706. X *    This program is distributed in the hope that it will be useful,
  4707. X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4708. X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  4709. X *    GNU General Public License for more details.
  4710. X *
  4711. X *    You should have received a copy of the GNU General Public License
  4712. X *    along with this program; if not, write to the Free Software
  4713. X *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  4714. X *
  4715. X * MANIFEST: list types function generation
  4716. X */
  4717. X
  4718. X#include <type.h>
  4719. X#include <indent.h>
  4720. X#include <mem.h>
  4721. X#include <id.h>
  4722. X
  4723. X
  4724. Xtypedef struct type_list_ty type_list_ty;
  4725. Xstruct type_list_ty
  4726. X{
  4727. X    /* inherited */
  4728. X    TYPE_T
  4729. X
  4730. X    /* instance variables */
  4731. X    type_ty        *subtype;
  4732. X};
  4733. X
  4734. X
  4735. Xstatic void gen_include _((type_ty *, string_ty *));
  4736. X
  4737. Xstatic void
  4738. Xgen_include(type, name)
  4739. X    type_ty        *type;
  4740. X    string_ty    *name;
  4741. X{
  4742. X    string_ty    *s;
  4743. X    type_list_ty    *type2;
  4744. X
  4745. X    type2 = (type_list_ty *)type;
  4746. X    indent_putchar('\n');
  4747. X    indent_printf("#ifndef %s_DEF\n", name->str_text);
  4748. X    indent_printf("#define %s_DEF\n", name->str_text);
  4749. X    indent_printf("typedef struct %s *%s;\n", name->str_text, name->str_text);
  4750. X    indent_printf("struct %s\n", name->str_text);
  4751. X    indent_printf("{\n"/*}*/);
  4752. X    indent_printf("%s\1length;\n", "size_t", name->str_text);
  4753. X    s = str_from_c("list");
  4754. X    type_gen_include_declarator(type2->subtype, s, 1);
  4755. X    str_free(s);
  4756. X    indent_printf(/*{*/"};\n");
  4757. X    indent_printf("#endif /* %s_DEF */\n", name->str_text);
  4758. X
  4759. X    indent_putchar('\n');
  4760. X    indent_printf("extern type_ty %s_type;\n", name->str_text);
  4761. X
  4762. X    indent_putchar('\n');
  4763. X    indent_printf("void %s_write _((char *, %s));\n", name->str_text, name->str_text);
  4764. X}
  4765. X
  4766. X
  4767. Xstatic void gen_include_declarator _((type_ty *, string_ty *, int));
  4768. X
  4769. Xstatic void
  4770. Xgen_include_declarator(type, name, is_a_list)
  4771. X    type_ty        *type;
  4772. X    string_ty    *name;
  4773. X    int        is_a_list;
  4774. X{
  4775. X    char        *deref;
  4776. X
  4777. X    deref = (is_a_list ? "*" : "");
  4778. X    indent_printf("%s\1%s%s;\n", type->name->str_text, deref, name->str_text);
  4779. X}
  4780. X
  4781. X
  4782. Xstatic void gen_code _((type_ty *, string_ty *));
  4783. X
  4784. Xstatic void
  4785. Xgen_code(type, name)
  4786. X    type_ty        *type;
  4787. X    string_ty    *name;
  4788. X{
  4789. X    string_ty    *s;
  4790. X    type_list_ty    *type2;
  4791. X
  4792. X    type2 = (type_list_ty *)type;
  4793. X    indent_putchar('\n');
  4794. X    indent_printf("void\n");
  4795. X    indent_printf("%s_write(name, this)\n", name->str_text);
  4796. X    indent_more();
  4797. X    indent_printf("%s\1*name;\n", "char");
  4798. X    indent_printf("%s\1this;\n", name->str_text);
  4799. X    indent_less();
  4800. X    indent_printf("{\n"/*}*/);
  4801. X    indent_printf("%s\1j;\n", "size_t");
  4802. X    indent_putchar('\n');
  4803. X    indent_printf("if (!this)\n");
  4804. X    indent_more();
  4805. X    indent_printf("return;\n");
  4806. X    indent_less();
  4807. X    indent_printf("trace((\"%s_write(name = \\\"%%s\\\", this = %%08lX)\\n{\\n\"/*}*/, name, this));\n", name->str_text);
  4808. X    indent_printf("if (name)\n");
  4809. X    indent_more();
  4810. X    indent_printf("indent_printf(\"%%s =\\n\", name);\n");
  4811. X    indent_less();
  4812. X    indent_printf("indent_printf(\"[\\n\"/*]*/);\n");
  4813. X    indent_printf("for (j = 0; j < this->length; ++j)\n");
  4814. X    indent_printf("{\n"/*}*/);
  4815. X    s = str_from_c("list[j]");
  4816. X    type_gen_code_declarator(type2->subtype, s, 1);
  4817. X    str_free(s);
  4818. X    indent_printf("indent_printf(\",\\n\");\n");
  4819. X    indent_printf(/*{*/"}\n");
  4820. X    indent_printf("indent_printf(/*[*/\"]\");\n");
  4821. X    indent_printf("if (name)\n");
  4822. X    indent_more();
  4823. X    indent_printf("indent_printf(\";\\n\");\n");
  4824. X    indent_less();
  4825. X    indent_printf("trace((/*{*/\"}\\n\"));\n");
  4826. X    indent_printf(/*{*/"}\n");
  4827. X
  4828. X    indent_putchar('\n');
  4829. X    indent_printf("static void *%s_alloc _((void));\n", name->str_text);
  4830. X
  4831. X    indent_putchar('\n');
  4832. X    indent_printf("static void *\n");
  4833. X    indent_printf("%s_alloc()\n", name->str_text);
  4834. X    indent_printf("{\n"/*}*/);
  4835. X    indent_printf("%s\1*result;\n\n", "void");
  4836. X    indent_printf("trace((\"%s_alloc()\\n{\\n\"/*}*/));\n", name->str_text);
  4837. X    indent_printf
  4838. X    (
  4839. X        "result = (void *)mem_alloc_clear(sizeof(struct %s));\n",
  4840. X        name->str_text
  4841. X    );
  4842. X    indent_printf("trace((\"return %%08lX;\\n\", (long)result));\n");
  4843. X    indent_printf("trace((/*{*/\"}\\n\"));\n");
  4844. X    indent_printf("return result;\n");
  4845. X    indent_printf(/*{*/"}\n");
  4846. X
  4847. X    indent_putchar('\n');
  4848. X    indent_printf("static void %s_free _((void *));\n", name->str_text);
  4849. X
  4850. X    indent_putchar('\n');
  4851. X    indent_printf("static void\n");
  4852. X    indent_printf("%s_free(that)\n", name->str_text);
  4853. X    indent_more();
  4854. X    indent_printf("%s\1*that;\n", "void");
  4855. X    indent_less();
  4856. X    indent_printf("{\n"/*}*/);
  4857. X    indent_printf("%s\1this = (%s)that;\n", name->str_text, name->str_text);
  4858. X    indent_printf("%s\1j;\n", "size_t");
  4859. X    indent_putchar('\n');
  4860. X    indent_printf("if (!this)\n");
  4861. X    indent_more();
  4862. X    indent_printf("return;\n");
  4863. X    indent_less();
  4864. X    indent_printf("trace((\"%s_free(this = %%08lX)\\n{\\n\"/*}*/, this));\n", name->str_text);
  4865. X    indent_printf("for (j = 0; j < this->length; ++j)\n");
  4866. X    indent_more();
  4867. X    s = str_from_c("list[j]");
  4868. X    type_gen_free_declarator(type2->subtype, s, 1);
  4869. X    str_free(s);
  4870. X    indent_less();
  4871. X    indent_printf("if (this->list)\n");
  4872. X    indent_more();
  4873. X    indent_printf("mem_free((char *)this->list);\n");
  4874. X    indent_less();
  4875. X    indent_printf("mem_free((char *)this);\n");
  4876. X    indent_printf("trace((/*{*/\"}\\n\"));\n");
  4877. X    indent_printf(/*{*/"}\n");
  4878. X
  4879. X    indent_putchar('\n');
  4880. X    indent_printf
  4881. X    (
  4882. X        "static void %s_parse _((void *, type_ty **, void **));\n",
  4883. X        name->str_text
  4884. X    );
  4885. X
  4886. X    indent_putchar('\n');
  4887. X    indent_printf("static void\n");
  4888. X    indent_printf("%s_parse(that, type_pp, addr_p)\n", name->str_text);
  4889. X    indent_more();
  4890. X    indent_printf("%s\1*that;\n", "void");
  4891. X    indent_printf("%s\1**type_pp;\n", "type_ty");
  4892. X    indent_printf("%s\1**addr_p;\n", "void");
  4893. X    indent_less();
  4894. X    indent_printf("{\n"/*}*/);
  4895. X    indent_printf("%s\1this = (%s)that;\n", name->str_text, name->str_text);
  4896. X    indent_putchar('\n');
  4897. X    indent_printf("trace((\"%s_parse(this = %%08lX, type_pp = %%08lX, addr_p = %%08lX)\\n{\\n\"/*}*/, this, type_pp, addr_p));\n", name->str_text);
  4898. X    indent_printf("*type_pp = &%s_type;\n", type2->subtype->name->str_text);
  4899. X    indent_printf("trace_pointer(*type_pp);\n");
  4900. X    indent_printf("*addr_p = enlarge(&this->length, (char **)&this->list, sizeof(%s));\n", type->name->str_text);
  4901. X    indent_printf("trace_pointer(*addr_p);\n");
  4902. X    indent_printf("trace((/*{*/\"}\\n\"));\n");
  4903. X    indent_printf(/*{*/"}\n");
  4904. X
  4905. X    indent_putchar('\n');
  4906. X    indent_printf("type_ty %s_type =\n", name->str_text);
  4907. X    indent_printf("{\n"/*}*/);
  4908. X    indent_printf("type_class_list,\n");
  4909. X    indent_printf("\"%s\",\n", name->str_text);
  4910. X    indent_printf("%s_alloc,\n", name->str_text);
  4911. X    indent_printf("%s_free,\n", name->str_text);
  4912. X    indent_printf("0, /* enum_parse */\n");
  4913. X    indent_printf("%s_parse,\n", name->str_text);
  4914. X    indent_printf("0, /* struct_parse */\n");
  4915. X    indent_printf(/*{*/"};\n");
  4916. X}
  4917. X
  4918. X
  4919. Xstatic void gen_code_declarator _((type_ty *, string_ty *, int));
  4920. X
  4921. Xstatic void
  4922. Xgen_code_declarator(type, name, is_a_list)
  4923. X    type_ty        *type;
  4924. X    string_ty    *name;
  4925. X    int        is_a_list;
  4926. X{
  4927. X    indent_printf("%s_write("/*)*/, type->name->str_text);
  4928. X    if (is_a_list)
  4929. X        indent_printf("\"\"");
  4930. X    else
  4931. X        indent_printf("\"%s\"", name->str_text);
  4932. X    indent_printf(/*(*/", this->%s);\n", name->str_text);
  4933. X}
  4934. X
  4935. X
  4936. Xstatic void gen_free_declarator _((type_ty *, string_ty *, int));
  4937. X
  4938. Xstatic void
  4939. Xgen_free_declarator(type, name, is_a_list)
  4940. X    type_ty        *type;
  4941. X    string_ty    *name;
  4942. X    int        is_a_list;
  4943. X{
  4944. X    indent_printf("%s_free(this->%s);\n", type->name->str_text, name->str_text);
  4945. X}
  4946. X
  4947. X
  4948. Xstatic type_method_ty method =
  4949. X{
  4950. X    gen_include,
  4951. X    gen_include_declarator,
  4952. X    gen_code,
  4953. X    gen_code_declarator,
  4954. X    gen_free_declarator,
  4955. X};
  4956. X
  4957. X
  4958. Xtype_ty *
  4959. Xtype_create_list(name, subtype)
  4960. X    string_ty    *name;
  4961. X    type_ty        *subtype;
  4962. X{
  4963. X    type_list_ty    *type;
  4964. X
  4965. X    type = (type_list_ty *)mem_alloc(sizeof(type_list_ty));
  4966. X    type->class = type_class_list;
  4967. X    type->method = &method;
  4968. X    type->name = str_copy(name);
  4969. X    type->subtype = subtype;
  4970. X    id_assign(name, ID_CLASS_TYPE, (long)type);
  4971. X    return (type_ty *)type;
  4972. X}
  4973. END_OF_FILE
  4974. if test 7919 -ne `wc -c <'fmtgen/type_list.c'`; then
  4975.     echo shar: \"'fmtgen/type_list.c'\" unpacked with wrong size!
  4976. fi
  4977. # end of 'fmtgen/type_list.c'
  4978. fi
  4979. if test -f 'man1/aegis.1' -a "${1}" != "-c" ; then 
  4980.   echo shar: Will not clobber existing file \"'man1/aegis.1'\"
  4981. else
  4982. echo shar: Extracting \"'man1/aegis.1'\" \(7774 characters\)
  4983. sed "s/^X//" >'man1/aegis.1' <<'END_OF_FILE'
  4984. X.\"
  4985. X.\"    aegis - project change supervisor
  4986. X.\"    Copyright (C) 1991, 1992, 1993 Peter Miller.
  4987. X.\"    All rights reserved.
  4988. X.\"
  4989. X.\"    This program is free software; you can redistribute it and/or modify
  4990. X.\"    it under the terms of the GNU General Public License as published by
  4991. X.\"    the Free Software Foundation; either version 2 of the License, or
  4992. X.\"    (at your option) any later version.
  4993. X.\"
  4994. X.\"    This program is distributed in the hope that it will be useful,
  4995. X.\"    but WITHOUT ANY WARRANTY; without even the implied warranty of
  4996. X.\"    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  4997. X.\"    GNU General Public License for more details.
  4998. X.\"
  4999. X.\"    You should have received a copy of the GNU General Public License
  5000. X.\"    along with this program; if not, write to the Free Software
  5001. X.\"    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  5002. X.\"
  5003. X.\" MANIFEST: manual entry for aegis
  5004. X.\"
  5005. X.so z_name.so
  5006. X.TH \*(n) 1 \*(N)
  5007. X.SH NAME
  5008. X\*(n) \- project change supervisor
  5009. X.SH SYNOPSIS
  5010. X.B \*(n)
  5011. X.I function
  5012. X[
  5013. X.IR option ...
  5014. X]
  5015. X.br
  5016. X.B \*(n)
  5017. X.B -Help
  5018. X.SH DESCRIPTION
  5019. XThe
  5020. X.I \*(n)
  5021. Xprogram is used to
  5022. Xsupervise the development and integration of changes into projects.
  5023. X.SH FUNCTIONS
  5024. XThe following functions are available:
  5025. X.TP 8n
  5026. X.B -Build
  5027. X.br
  5028. XThe 
  5029. X.I "\*(n) -Build"
  5030. Xcommand is used to
  5031. Xbuild a project.
  5032. XSee
  5033. X.IR aeb (1)
  5034. Xfor more information.
  5035. X.TP 8n
  5036. X.B -Change_Attributes
  5037. X.br
  5038. XThe 
  5039. X.I "\*(n) -Change_Attributes"
  5040. Xcommand is used to
  5041. Xmodify the attributes of a change.
  5042. XSee
  5043. X.IR aeca (1)
  5044. Xfor more information.
  5045. X.TP 8n
  5046. X.B -Change_Directory
  5047. X.br
  5048. XThe 
  5049. X.I "\*(n) -Change_Directory"
  5050. Xcommand is used to
  5051. Xchange directory.
  5052. XSee
  5053. X.IR aecd (1)
  5054. Xfor more information.
  5055. X.TP 8n
  5056. X.B -CoPy_file
  5057. X.br
  5058. XThe 
  5059. X.I "\*(n) -CoPy_file"
  5060. Xcommand is used to
  5061. Xcopy a file into a change.
  5062. XSee
  5063. X.IR aecp (1)
  5064. Xfor more information.
  5065. X.TP 8n
  5066. X.B -CoPy_file_Undo
  5067. X.br
  5068. XThe 
  5069. X.I "\*(n) -Copy_File_Undo"
  5070. Xcommand is used to
  5071. Xremove a copy of a file from a change.
  5072. XSee
  5073. X.IR aecpu (1)
  5074. Xfor more information.
  5075. X.TP 8n
  5076. X.B -Develop_Begin
  5077. X.br
  5078. XThe 
  5079. X.I "\*(n) -Develop_Begin"
  5080. Xcommand is used to
  5081. Xbegin development of a change.
  5082. XSee
  5083. X.IR aedb (1)
  5084. Xfor more information.
  5085. X.TP 8n
  5086. X.B -Develop_Begin_Undo
  5087. X.br
  5088. XThe 
  5089. X.I "\*(n) -Develop_Begin_Undo"
  5090. Xcommand is used to
  5091. Xcease development of a change.
  5092. X.See
  5093. X.IR aedbu (1)
  5094. Xfor more information.
  5095. X.TP 8n
  5096. X.B -Develop_End
  5097. X.br
  5098. XThe 
  5099. X.I "\*(n) -Develop_End"
  5100. Xcommand is used to
  5101. Xcomplete development of a change.
  5102. XSee
  5103. X.IR aede (1)
  5104. Xfor more information.
  5105. X.TP 8n
  5106. X.B -Develop_End_Undo
  5107. X.br
  5108. XThe 
  5109. X.I "\*(n) -Develop_End_Undo"
  5110. Xcommand is used to
  5111. Xrecall a change for further development.
  5112. XSee
  5113. X.IR aedeu (1)
  5114. Xfor more information.
  5115. X.TP 8n
  5116. X.B -DIFFerence
  5117. X.br
  5118. XThe 
  5119. X.I "\*(n) -DIFFerence"
  5120. Xcommand is used to
  5121. Xfind differences between development directory and baseline.
  5122. XSee
  5123. X.IR aed (1)
  5124. Xfor more information.
  5125. X.so o_help.so
  5126. X.TP 8n
  5127. X.B -Integrate_Begin
  5128. X.br
  5129. XThe 
  5130. X.I "\*(n) -Integrate_Begin"
  5131. Xcommand is used to
  5132. Xbeing integrating a change.
  5133. XSee
  5134. X.IR aeib (1)
  5135. Xfor more information.
  5136. X.TP 8n
  5137. X.B -Integrate_Begin_Undo
  5138. X.br
  5139. XThe 
  5140. X.I "\*(n) -Integrate_Begin_Undo"
  5141. Xcommand is used to
  5142. Xcease integrating a change.
  5143. XSee
  5144. X.IR aeibu (1)
  5145. Xfor more information.
  5146. X.TP 8n
  5147. X.B -Integrate_Fail
  5148. X.br
  5149. XThe 
  5150. X.I "\*(n) -Integrate_Fail"
  5151. Xcommand is used to
  5152. Xfail a change integration.
  5153. XSee
  5154. X.IR aeif (1)
  5155. Xfor more information.
  5156. X.TP 8n
  5157. X.B -Integrate_Pass
  5158. X.br
  5159. XThe 
  5160. X.I "\*(n) -Integrate_Pass"
  5161. Xcommand is used to
  5162. Xpass a change integration.
  5163. XSee
  5164. X.IR aeip (1)
  5165. Xfor more information.
  5166. X.TP 8n
  5167. X.B -List
  5168. X.br
  5169. XThe 
  5170. X.I "\*(n) -List"
  5171. Xcommand is used to
  5172. Xlist interesting things.
  5173. XSee
  5174. X.IR ael (1)
  5175. Xfor more information.
  5176. X.TP 8n
  5177. X.B -MoVe_file
  5178. X.br
  5179. XThe 
  5180. X.I "\*(n) -MoVe_file"
  5181. Xcommand is used to
  5182. Xchange the name of a file
  5183. Xas part of a change.
  5184. XSee
  5185. X.IR aemv (1)
  5186. Xfor more information.
  5187. X.TP 8n
  5188. X.B -New_Administrator
  5189. X.br
  5190. XThe 
  5191. X.I "\*(n) -New_Administrator"
  5192. Xcommand is used to
  5193. Xadd new administrators to a project.
  5194. XSee
  5195. X.IR aena (1)
  5196. Xfor more information.
  5197. X.TP 8n
  5198. X.B -New_Change
  5199. X.br
  5200. XThe 
  5201. X.I "\*(n) -New_Change"
  5202. Xcommand is used to
  5203. Xadd a new change to a project.
  5204. XSee
  5205. X.IR aenc (1)
  5206. Xfor more information.
  5207. X.TP 8n
  5208. X.B -New_Change_Undo
  5209. X.br
  5210. XThe 
  5211. X.I "\*(n) -New_Change_Undo"
  5212. Xcommand is used to
  5213. Xremove a new change from a project.
  5214. XSee
  5215. X.IR aencu (1)
  5216. Xfor more information.
  5217. X.TP 8n
  5218. X.B -New_Developer
  5219. X.br
  5220. XThe 
  5221. X.I "\*(n) -New_Developer"
  5222. Xcommand is used to add
  5223. Xnew developers to a project.
  5224. XSee
  5225. X.IR aend (1)
  5226. Xfor more information.
  5227. X.TP 8n
  5228. X.B -New_File
  5229. X.br
  5230. XThe 
  5231. X.I "\*(n) -New_File"
  5232. Xcommand is used to
  5233. Xadd new files to a change.
  5234. XSee
  5235. X.IR aenf (1)
  5236. Xfor more information.
  5237. X.TP 8n
  5238. X.B -New_File_Undo
  5239. X.br
  5240. XThe 
  5241. X.I "\*(n) -New_File_Undo"
  5242. Xcommand is used to
  5243. Xremove new files from a change.
  5244. XSee
  5245. X.IR aenfu (1)
  5246. Xfor more information.
  5247. X.TP 8n
  5248. X.B -New_Integrator
  5249. X.br
  5250. XThe 
  5251. X.I "\*(n) -New_Integrator"
  5252. Xcommand is used to
  5253. Xadd new integrators to a project.
  5254. XSee
  5255. X.IR aeni (1)
  5256. Xfor more information.
  5257. X.TP 8n
  5258. X.B -New_Project
  5259. X.br
  5260. XThe 
  5261. X.I "\*(n) -New_Project"
  5262. Xcommand is used to
  5263. Xcreate a new project to be watched over by \*(n).
  5264. XSee
  5265. X.IR aenpr (1)
  5266. Xfor more information.
  5267. X.TP 8n
  5268. X.B -New_ReLeaSe
  5269. X.br
  5270. XThe 
  5271. X.I "\*(n) -New_ReLeaSe"
  5272. Xcommand is used to
  5273. Xcreate a new project from an existing project.
  5274. XSee
  5275. X.IR aenrls (1)
  5276. Xfor more information.
  5277. X.TP 8n
  5278. X.B -New_ReViewer
  5279. X.br
  5280. XThe 
  5281. X.I "\*(n) -New_ReViewer"
  5282. Xcommand is used to
  5283. Xadd new reviewers to a project.
  5284. XSee
  5285. X.IR aenrv (1)
  5286. Xfor more information.
  5287. X.TP 8n
  5288. X.B -New_Test
  5289. X.br
  5290. XThe 
  5291. X.I "\*(n) -New_Test"
  5292. Xcommand is used to
  5293. Xadd a new test to a change
  5294. XSee
  5295. X.IR aent (1)
  5296. Xfor more information.
  5297. X.TP 8n
  5298. X.B -New_Test_Undo
  5299. X.br
  5300. XThe
  5301. X.I "\*(n) -New_Test_Undo"
  5302. Xcommand is used to
  5303. Xremove new tests from a change.
  5304. XSee
  5305. X.IR aentu (1)
  5306. Xfor more information.
  5307. X.TP 8n
  5308. X.B -Project_Attributes
  5309. X.br
  5310. XThe 
  5311. X.I "\*(n) -Project_Attributes"
  5312. Xcommand is used to
  5313. Xmodify the attributes of a project.
  5314. X.TP 8n
  5315. X.B -Remove_Administrator
  5316. X.br
  5317. XThe 
  5318. X.I "\*(n) -Remove_Administrator"
  5319. Xcommand is used to
  5320. Xremove administrators from a project.
  5321. XSee
  5322. X.IR aera (1)
  5323. Xfor more information.
  5324. X.TP 8n
  5325. X.B -Remove_Developer
  5326. X.br
  5327. XThe 
  5328. X.I "\*(n) -Remove_Developer"
  5329. Xcommand is used to
  5330. Xremove developers from a project.
  5331. XSee
  5332. X.IR aerd (1)
  5333. Xfor more information.
  5334. X.TP 8n
  5335. X.B -ReMove_file
  5336. X.br
  5337. XThe 
  5338. X.I "\*(n) -ReMove_file"
  5339. Xcommand is used to
  5340. Xadd files to be deleted to a change.
  5341. XSee
  5342. X.IR aerm (1)
  5343. Xfor more information.
  5344. X.TP 8n
  5345. X.B -ReMove_file_Undo
  5346. X.br
  5347. XThe 
  5348. X.I "\*(n) -Remove_File_Undo"
  5349. Xcommand is used to
  5350. Xremove files to be deleted from a change.
  5351. XSee
  5352. X.IR aermu (1)
  5353. Xfor more information.
  5354. X.TP 8n
  5355. X.B -Remove_Integrator
  5356. X.br
  5357. XThe 
  5358. X.I "\*(n) -Remove_Integrator"
  5359. Xcommand is used to
  5360. Xremove integrators from a project.
  5361. XSee
  5362. X.IR aeri (1)
  5363. Xfor more information.
  5364. X.TP 8n
  5365. X.B -ReMove_PRoject
  5366. X.br
  5367. XThe 
  5368. X.I "\*(n) -ReMove_PRoject"
  5369. Xcommand is used to
  5370. Xremove a project.
  5371. XSee
  5372. X.IR aermpr (1)
  5373. Xfor more information.
  5374. X.TP 8n
  5375. X.B -Remove_ReViewer
  5376. X.br
  5377. XThe 
  5378. X.I "\*(n) -Remove_ReViewer"
  5379. Xcommand is used to
  5380. Xremove reviewers from a project.
  5381. XSee
  5382. X.IR aerrv (1)
  5383. Xfor more information.
  5384. X.TP 8n
  5385. X.B -Review_Fail
  5386. X.br
  5387. XThe 
  5388. X.I "\*(n) -Review_Fail"
  5389. Xcommand is used to
  5390. Xfail a change review.
  5391. XSee
  5392. X.IR aerf (1)
  5393. Xfor more information.
  5394. X.TP 8n
  5395. X.B -Review_Pass
  5396. X.br
  5397. XThe 
  5398. X.I "\*(n) -Review_Pass"
  5399. Xcommand is used to
  5400. Xpass a change review.
  5401. XSee
  5402. X.IR aerp (1)
  5403. Xfor more information.
  5404. X.TP 8n
  5405. X.B -Review_Pass_Undo
  5406. X.br
  5407. XThe 
  5408. X.I "\*(n) -Review_Pass_Undo"
  5409. Xcommand is used to
  5410. Xrescind a change review pass.
  5411. XSee
  5412. X.IR aerpu (1)
  5413. Xfor more information.
  5414. X.TP 8n
  5415. X.B -Test
  5416. X.br
  5417. XThe 
  5418. X.I "\*(n) -Test"
  5419. Xcommand is used to
  5420. Xrun tests.
  5421. XSee
  5422. X.IR aet (1)
  5423. Xfor more information.
  5424. X.TP 8n
  5425. X.B -VERSion
  5426. X.br
  5427. XThe
  5428. X.I "\*(n) -VERSion"
  5429. Xcommand is used to
  5430. Xget copyright and version details.
  5431. XSee
  5432. X.IR aev (1)
  5433. Xfor more information.
  5434. X.PP
  5435. XAll function are case insensitive.
  5436. XFunctions may be abbreviated;
  5437. Xthe abbreviation is the upper case letters.
  5438. XFunctions must appear as the first command line argument.
  5439. X.SH OPTIONS
  5440. XThe following options are available to all functions.
  5441. XThese options may appear anywhere on the command line following
  5442. Xthe function selectors.
  5443. X.so o_lib.so
  5444. X.so o_page.so
  5445. X.so o_terse.so
  5446. X.so o_unforma.so
  5447. X.so o_verbose.so
  5448. X.so o__rules.so
  5449. X.so z_exit.so
  5450. X.so z_cr.so
  5451. END_OF_FILE
  5452. if test 7774 -ne `wc -c <'man1/aegis.1'`; then
  5453.     echo shar: \"'man1/aegis.1'\" unpacked with wrong size!
  5454. fi
  5455. # end of 'man1/aegis.1'
  5456. fi
  5457. if test -f 'test/00/t0005a.sh' -a "${1}" != "-c" ; then 
  5458.   echo shar: Will not clobber existing file \"'test/00/t0005a.sh'\"
  5459. else
  5460. echo shar: Extracting \"'test/00/t0005a.sh'\" \(7509 characters\)
  5461. sed "s/^X//" >'test/00/t0005a.sh' <<'END_OF_FILE'
  5462. X#! /bin/sh
  5463. X#
  5464. X#    aegis - project change supervisor
  5465. X#    Copyright (C) 1991, 1992, 1993 Peter Miller.
  5466. X#    All rights reserved.
  5467. X#
  5468. X#    This program is free software; you can redistribute it and/or modify
  5469. X#    it under the terms of the GNU General Public License as published by
  5470. X#    the Free Software Foundation; either version 2 of the License, or
  5471. X#    (at your option) any later version.
  5472. X#
  5473. X#    This program is distributed in the hope that it will be useful,
  5474. X#    but WITHOUT ANY WARRANTY; without even the implied warranty of
  5475. X#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  5476. X#    GNU General Public License for more details.
  5477. X#
  5478. X#    You should have received a copy of the GNU General Public License
  5479. X#    along with this program; if not, write to the Free Software
  5480. X#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  5481. X#
  5482. X# MANIFEST: Test the 'aegis -DevEnd' command.
  5483. X#
  5484. X# File which are removed should not be
  5485. X# check to see if their last-modified-time is kosher.
  5486. X#
  5487. X
  5488. Xunset AEGIS_PROJECT
  5489. Xunset AEGIS_CHANGE
  5490. Xumask 022
  5491. X
  5492. XUSER=${USER:-${LOGNAME:-`whoami`}}
  5493. X
  5494. XPAGER=cat
  5495. Xexport PAGER
  5496. Xwork=${AEGIS_TMP:-/tmp}/$$
  5497. X
  5498. Xfail()
  5499. X{
  5500. X    set +x
  5501. X    echo "FAILED test of 'aegis -DevEnd' command" 1>&2
  5502. X    find $work -type d -user $USER -exec chmod u+w {} \;
  5503. X    rm -rf $work
  5504. X    exit 1
  5505. X}
  5506. Xpass()
  5507. X{
  5508. X    set +x
  5509. X    echo PASSED 1>&2
  5510. X    find $work -type d -user $USER -exec chmod u+w {} \;
  5511. X    rm -rf $work
  5512. X    exit 0
  5513. X}
  5514. Xtrap "fail" 1 2 3 15
  5515. X
  5516. X#
  5517. X# some variable to make things earier to read
  5518. X#
  5519. Xworklib=$work/lib
  5520. Xworkproj=$work/foo.proj
  5521. Xworkchan=$work/foo.chan
  5522. Xtmp=$work/tmp
  5523. X
  5524. X#
  5525. X# echo commands so we can tell what failed
  5526. X#
  5527. Xset -x
  5528. X
  5529. X#
  5530. X# make the directories
  5531. X#
  5532. Xmkdir $work
  5533. X
  5534. X#
  5535. X# make a new project
  5536. X#
  5537. X./bin/aegis -newpro foo -dir $workproj -v -lib $worklib
  5538. Xif test $? -ne 0 ; then fail; fi
  5539. X
  5540. X#
  5541. X# change project attributes
  5542. X#
  5543. Xcat > $tmp << 'end'
  5544. Xdescription = "A bogus project created to test things.";
  5545. Xdeveloper_may_review = true;
  5546. Xdeveloper_may_integrate = true;
  5547. Xreviewer_may_integrate = true;
  5548. Xend
  5549. X./bin/aegis -proatt $tmp -proj foo -v -lib $worklib
  5550. Xif test $? -ne 0 ; then fail; fi
  5551. X
  5552. X#
  5553. X# create a new change
  5554. X#    make sure it creates the files it should
  5555. X#
  5556. Xcat > $tmp << 'end'
  5557. Xbrief_description = "This change is used to test the aegis functionality \
  5558. Xwith respect to change descriptions.";
  5559. Xcause = internal_bug;
  5560. Xend
  5561. X./bin/aegis -new_change $tmp -project foo -v -lib $worklib
  5562. Xif test $? -ne 0 ; then fail; fi
  5563. X
  5564. X#
  5565. X# create a second change
  5566. X#    make sure it creates the files it should
  5567. X#
  5568. Xcat > $tmp << 'end'
  5569. Xbrief_description = "This change was added to make the various listings \
  5570. Xmuch more interesting.";
  5571. Xcause = internal_bug;
  5572. Xend
  5573. X./bin/aegis -new_change $tmp -project foo -v -lib $worklib
  5574. Xif test $? -ne 0 ; then fail; fi
  5575. X
  5576. X#
  5577. X# add a new developer
  5578. X#
  5579. X./bin/aegis -newdev $USER -p foo -v -lib $worklib
  5580. Xif test $? -ne 0 ; then fail; fi
  5581. X
  5582. X#
  5583. X# begin development of a change
  5584. X#
  5585. X./bin/aegis -devbeg 1 -p foo -dir $workchan -v -lib $worklib
  5586. Xif test $? -ne 0 ; then fail; fi
  5587. X
  5588. X#
  5589. X# add a new files to the change
  5590. X#
  5591. X./bin/aegis -new_file $workchan/main.c -nl -v -lib $worklib -p foo
  5592. Xif test $? -ne 0 ; then fail; fi
  5593. X./bin/aegis -new_file $workchan/fubar -nl -v -lib $worklib -p foo
  5594. Xif test $? -ne 0 ; then fail; fi
  5595. X./bin/aegis -new_file $workchan/config -nl -v -lib $worklib -p foo
  5596. Xif test $? -ne 0 ; then fail; fi
  5597. X
  5598. X#
  5599. X# put something in 'main.c'
  5600. X#
  5601. Xcat > $workchan/main.c << 'end'
  5602. Xvoid
  5603. Xmain()
  5604. X{
  5605. X    exit(0);
  5606. X}
  5607. Xend
  5608. X
  5609. X#
  5610. X# put something in 'config'
  5611. X#
  5612. Xcat > $workchan/config << 'end'
  5613. Xbuild_command = "rm -f foo; cc -o foo -D'VERSION=\"$vers\"' main.c";
  5614. Xlink_integration_directory = true;
  5615. X
  5616. Xhistory_get_command =
  5617. X    "co -u'$e' -p $h,v > $o";
  5618. Xhistory_create_command =
  5619. X    "ci -u -m/dev/null -t/dev/null $i $h,v; rcs -U $h,v";
  5620. Xhistory_put_command =
  5621. X    "ci -u -m/dev/null -t/dev/null $i $h,v; rcs -U $h,v";
  5622. Xhistory_query_command =
  5623. X    "rlog -r $h,v | awk '/^head:/ {print $$2}'";
  5624. X
  5625. Xdiff_command = "set +e; diff $orig $i > $out; test $$? -le 1";
  5626. X
  5627. Xdiff3_command = "(diff3 -e $mr $orig $i | sed -e '/^w$$/d' -e '/^q$$/d'; \
  5628. X    echo '1,$$p' ) | ed - $mr > $out";
  5629. Xend
  5630. X
  5631. X#
  5632. X# create a new test
  5633. X#
  5634. X./bin/aegis -nt -v -lib $worklib -p foo
  5635. Xif test $? -ne 0 ; then fail; fi
  5636. X
  5637. X#
  5638. X# put something in 'test/00/t0001a.sh'
  5639. X#
  5640. Xcat > $workchan/test/00/t0001a.sh << 'end'
  5641. X#!/bin/sh
  5642. X#
  5643. X# Project: "foo"
  5644. X# Change: 1
  5645. X#
  5646. X
  5647. Xfail()
  5648. X{
  5649. X    echo SHUZBUTT 1>&2
  5650. X    exit 1
  5651. X}
  5652. Xpass()
  5653. X{
  5654. X    exit 0
  5655. X}
  5656. Xtrap "fail" 1 2 3 15
  5657. X
  5658. X./foo
  5659. Xq=$?
  5660. X
  5661. X# check for signals
  5662. Xif test $q -ge 128 
  5663. Xthen
  5664. X    fail
  5665. Xfi
  5666. X
  5667. X# should not complain
  5668. Xif test $q -ne 0 
  5669. Xthen
  5670. X    fail
  5671. Xfi
  5672. X
  5673. X# it probably worked
  5674. Xpass
  5675. Xend
  5676. X
  5677. X#
  5678. X# let the clock tick over, so the build will be happy
  5679. X#
  5680. Xsleep 1
  5681. X
  5682. X#
  5683. X# build the change
  5684. X#
  5685. X./bin/aegis -build -nl -v -lib $worklib -p foo
  5686. Xif test $? -ne 0 ; then fail; fi
  5687. X
  5688. X#
  5689. X# difference the change
  5690. X#
  5691. X./bin/aegis -diff -nl -v -lib $worklib -p foo
  5692. Xif test $? -ne 0 ; then fail; fi
  5693. X
  5694. X#
  5695. X# test the change
  5696. X#
  5697. X./bin/aegis -test -nl -v -lib $worklib -p foo
  5698. Xif test $? -ne 0 ; then fail; fi
  5699. X
  5700. X#
  5701. X# finish development of the change
  5702. X#
  5703. X./bin/aegis -dev_end -v -lib $worklib -p foo
  5704. Xif test $? -ne 0 ; then fail; fi
  5705. X
  5706. X#
  5707. X# add a new reviewer
  5708. X#
  5709. X./bin/aegis -newrev $USER -p foo -v -lib $worklib
  5710. Xif test $? -ne 0 ; then fail; fi
  5711. X
  5712. X#
  5713. X# pass the review
  5714. X#
  5715. X./bin/aegis -review_pass -chan 1 -proj foo -v -lib $worklib
  5716. Xif test $? -ne 0 ; then fail; fi
  5717. X
  5718. X#
  5719. X# add an integrator
  5720. X#
  5721. X./bin/aegis -newint $USER -p foo -v -lib $worklib
  5722. Xif test $? -ne 0 ; then fail; fi
  5723. X
  5724. X#
  5725. X# start integrating
  5726. X#
  5727. X./bin/aegis -intbeg 1 -p foo -v -lib $worklib
  5728. Xif test $? -ne 0 ; then fail; fi
  5729. X
  5730. X#
  5731. X# integrate build
  5732. X#
  5733. Xsleep 1
  5734. X./bin/aegis -build -nl -v -lib $worklib -p foo
  5735. Xif test $? -ne 0 ; then fail; fi
  5736. X
  5737. X#
  5738. X# integrate test
  5739. X#
  5740. X./bin/aegis -test -nl -v -lib $worklib -p foo
  5741. Xif test $? -ne 0 ; then fail; fi
  5742. X
  5743. X#
  5744. X# integration pass
  5745. X#
  5746. X./bin/aegis -intpass -nl -v -lib $worklib -p foo
  5747. Xif test $? -ne 0 ; then fail; fi
  5748. X
  5749. X#
  5750. X# start work on change 2
  5751. X#
  5752. X./bin/aegis -devbeg 2 -p foo -v -dir $workchan -lib $worklib
  5753. Xif test $? -ne 0 ; then fail; fi
  5754. X
  5755. X#
  5756. X# copy a file into the change
  5757. X#
  5758. X./bin/aegis -cp $workchan/main.c -nl -v -lib $worklib -p foo
  5759. Xif test $? -ne 0 ; then fail; fi
  5760. X
  5761. X#
  5762. X# remove a file with the change
  5763. X#
  5764. X./bin/aegis -rm $workchan/fubar -nl -p foo -v -lib $worklib
  5765. Xif test $? -ne 0 ; then fail; fi
  5766. X
  5767. X#
  5768. X# change the file
  5769. X#
  5770. Xcat > $workchan/main.c << 'end'
  5771. X
  5772. X#include <stdio.h>
  5773. X
  5774. Xvoid
  5775. Xmain(argc, argv)
  5776. X    int    argc;
  5777. X    char    **argv;
  5778. X{
  5779. X    if (argc != 1)
  5780. X    {
  5781. X        fprintf(stderr, "usage: %s\n", argv[0]);
  5782. X        exit(1);
  5783. X    }
  5784. X    printf("hello, world\n");
  5785. X    exit(0);
  5786. X}
  5787. Xend
  5788. X
  5789. X#
  5790. X# need another test
  5791. X#
  5792. X./bin/aegis -nt -v -lib $worklib -p foo
  5793. Xif test $? -ne 0 ; then fail; fi
  5794. Xcat > $workchan/test/00/t0002a.sh << 'end'
  5795. X#!/bin/sh
  5796. X#
  5797. X# Project: "foo"
  5798. X# Change: 2
  5799. X#
  5800. X
  5801. Xfail()
  5802. X{
  5803. X    echo SHUZBUTT 1>&2
  5804. X    exit 1
  5805. X}
  5806. Xpass()
  5807. X{
  5808. X    exit 0
  5809. X}
  5810. Xtrap "fail" 1 2 3 15
  5811. X
  5812. X./foo ickky
  5813. Xq=$?
  5814. X
  5815. X# check for signals
  5816. Xif test $q -ge 128 
  5817. Xthen
  5818. X    fail
  5819. Xfi
  5820. X
  5821. X# should have complained
  5822. Xif test $q -eq 0 
  5823. Xthen
  5824. X    fail
  5825. Xfi
  5826. X
  5827. X# it probably worked
  5828. Xpass
  5829. Xend
  5830. X
  5831. X#
  5832. X# tick over clock to keep build happy
  5833. X#
  5834. Xsleep 1
  5835. X
  5836. X#
  5837. X# diff the change
  5838. X#    copy an empty file into local area
  5839. X#    to dodge  diff bug.
  5840. X#
  5841. Xcp /dev/null ./fubar
  5842. X./bin/aegis -diff -nl -v -lib $worklib -p foo
  5843. Xif test $? -ne 0 ; then fail; fi
  5844. Xrm ./fubar
  5845. X
  5846. X#
  5847. X# build the change
  5848. X#
  5849. Xsleep 1
  5850. X./bin/aegis -build -nl -v -lib $worklib -p foo
  5851. Xif test $? -ne 0 ; then fail; fi
  5852. X
  5853. X#
  5854. X# test the change
  5855. X#
  5856. X./bin/aegis -test -nl -v -lib $worklib -p foo
  5857. Xif test $? -ne 0 ; then fail; fi
  5858. X./bin/aegis -test -bl -nl -v -lib $worklib -p foo
  5859. Xif test $? -ne 0 ; then fail; fi
  5860. X
  5861. X#
  5862. X# end development of the change
  5863. X#
  5864. X./bin/aegis -devend -v -lib $worklib -p foo
  5865. Xif test $? -ne 0 ; then fail; fi
  5866. X
  5867. X# should be no automatic logging
  5868. Xif test "`find $work -name 'aegis.log' -print`" != "" ; then fail; fi
  5869. X
  5870. X#
  5871. X# the things tested in this test, worked
  5872. X#
  5873. Xpass
  5874. END_OF_FILE
  5875. if test 7509 -ne `wc -c <'test/00/t0005a.sh'`; then
  5876.     echo shar: \"'test/00/t0005a.sh'\" unpacked with wrong size!
  5877. fi
  5878. # end of 'test/00/t0005a.sh'
  5879. fi
  5880. if test -f 'test/00/t0008a.sh' -a "${1}" != "-c" ; then 
  5881.   echo shar: Will not clobber existing file \"'test/00/t0008a.sh'\"
  5882. else
  5883. echo shar: Extracting \"'test/00/t0008a.sh'\" \(7628 characters\)
  5884. sed "s/^X//" >'test/00/t0008a.sh' <<'END_OF_FILE'
  5885. X#! /bin/sh
  5886. X#
  5887. X#    aegis - project change supervisor
  5888. X#    Copyright (C) 1991, 1992, 1993 Peter Miller.
  5889. X#    All rights reserved.
  5890. X#
  5891. X#    This program is free software; you can redistribute it and/or modify
  5892. X#    it under the terms of the GNU General Public License as published by
  5893. X#    the Free Software Foundation; either version 2 of the License, or
  5894. X#    (at your option) any later version.
  5895. X#
  5896. X#    This program is distributed in the hope that it will be useful,
  5897. X#    but WITHOUT ANY WARRANTY; without even the implied warranty of
  5898. X#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  5899. X#    GNU General Public License for more details.
  5900. X#
  5901. X#    You should have received a copy of the GNU General Public License
  5902. X#    along with this program; if not, write to the Free Software
  5903. X#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  5904. X#
  5905. X# MANIFEST: Test command substitutions
  5906. X#
  5907. X
  5908. Xunset AEGIS_PROJECT
  5909. Xunset AEGIS_CHANGE
  5910. Xumask 022
  5911. X
  5912. XUSER=${USER:-${LOGNAME:-`whoami`}}
  5913. X
  5914. XPAGER=cat
  5915. Xexport PAGER
  5916. Xwork=${AEGIS_TMP:-/tmp}/$$
  5917. X
  5918. Xfail()
  5919. X{
  5920. X    set +x
  5921. X    echo FAILED test of command substitutions 1>&2
  5922. X    find $work -type d -user $USER -exec chmod u+w {} \;
  5923. X    rm -rf $work
  5924. X    exit 1
  5925. X}
  5926. Xpass()
  5927. X{
  5928. X    set +x
  5929. X    echo PASSED 1>&2
  5930. X    find $work -type d -user $USER -exec chmod u+w {} \;
  5931. X    rm -rf $work
  5932. X    exit 0
  5933. X}
  5934. Xtrap "fail" 1 2 3 15
  5935. X
  5936. X#
  5937. X# some variable to make things earier to read
  5938. X#
  5939. Xworklib=$work/lib
  5940. Xworkproj=$work/foo.proj
  5941. Xworkchan=$work/foo.chan
  5942. Xtmp=$work/tmp
  5943. X
  5944. X#
  5945. X# echo commands so we can tell what failed
  5946. X#
  5947. Xset -x
  5948. X
  5949. X#
  5950. X# make the directories
  5951. X#
  5952. Xmkdir $work
  5953. X
  5954. X#
  5955. X# make a new project
  5956. X#
  5957. X./bin/aegis -newpro foo -dir $workproj -v -lib $worklib
  5958. Xif test $? -ne 0 ; then fail; fi
  5959. X
  5960. X#
  5961. X# change project attributes
  5962. X#
  5963. Xcat > $tmp << 'end'
  5964. Xdescription = "A bogus project created to test things.";
  5965. Xdeveloper_may_review = true;
  5966. Xdeveloper_may_integrate = true;
  5967. Xreviewer_may_integrate = true;
  5968. Xend
  5969. Xif test $? -ne 0 ; then fail; fi
  5970. X./bin/aegis -proatt $tmp -proj foo -v -lib $worklib
  5971. Xif test $? -ne 0 ; then fail; fi
  5972. X
  5973. X#
  5974. X# create a new change
  5975. X#
  5976. Xcat > $tmp << 'end'
  5977. Xbrief_description = "This change is used to test the aegis functionality \
  5978. Xwith respect to change descriptions.";
  5979. Xcause = internal_bug;
  5980. Xend
  5981. Xif test $? -ne 0 ; then fail; fi
  5982. X./bin/aegis -new_change $tmp -project foo -v -lib $worklib
  5983. Xif test $? -ne 0 ; then fail; fi
  5984. X
  5985. X#
  5986. X# create a second change
  5987. X#
  5988. Xcat > $tmp << 'end'
  5989. Xbrief_description = "This change was added to make the various listings \
  5990. Xmuch more interesting.";
  5991. Xcause = internal_bug;
  5992. Xend
  5993. Xif test $? -ne 0 ; then fail; fi
  5994. X./bin/aegis -new_change $tmp -project foo -v -lib $worklib
  5995. Xif test $? -ne 0 ; then fail; fi
  5996. X
  5997. X#
  5998. X# add a new developer
  5999. X#
  6000. X./bin/aegis -newdev $USER -p foo -v -lib $worklib
  6001. Xif test $? -ne 0 ; then fail; fi
  6002. X
  6003. X#
  6004. X# begin development of a change
  6005. X#
  6006. X./bin/aegis -devbeg 1 -p foo -dir $workchan -v -lib $worklib
  6007. Xif test $? -ne 0 ; then fail; fi
  6008. X
  6009. X#
  6010. X# add a new files to the change
  6011. X#
  6012. X./bin/aegis -new_file $workchan/main.c -nl -v -lib $worklib -p foo
  6013. Xif test $? -ne 0 ; then fail; fi
  6014. Xcat > $workchan/main.c << 'end'
  6015. Xvoid
  6016. Xmain()
  6017. X{
  6018. X    exit(0);
  6019. X}
  6020. Xend
  6021. X
  6022. X./bin/aegis -new_file $workchan/config -nl -v -lib $worklib -p foo
  6023. Xif test $? -ne 0 ; then fail; fi
  6024. Xcat > $workchan/config << 'end'
  6025. Xbuild_command = "make -f ${s Makefile} PROJECT=$p CHANGE=$c VERSION=$v";
  6026. Xlink_integration_directory = true;
  6027. X
  6028. Xhistory_get_command =
  6029. X    "co -u'$e' -p $h,v > $o";
  6030. Xhistory_create_command =
  6031. X    "ci -u -m/dev/null -t/dev/null $i $h,v; rcs -U $h,v";
  6032. Xhistory_put_command =
  6033. X    "ci -u -m/dev/null -t/dev/null $i $h,v; rcs -U $h,v";
  6034. Xhistory_query_command =
  6035. X    "rlog -r $h,v | awk '/^head:/ {print $$2}'";
  6036. X
  6037. Xdiff_command = "set +e; diff $orig $i > $out; test $$? -le 1";
  6038. X
  6039. Xdiff3_command = "(diff3 -e $mr $orig $i | sed -e '/^w$$/d' -e '/^q$$/d'; \
  6040. X    echo '1,$$p' ) | ed - $mr > $out";
  6041. Xend
  6042. Xif test $? -ne 0 ; then fail; fi
  6043. X
  6044. X./bin/aegis -new_file $workchan/Makefile -nl -v -lib $worklib -p foo
  6045. Xif test $? -ne 0 ; then fail; fi
  6046. Xcat > $workchan/Makefile << 'end'
  6047. Xfoo: main.c
  6048. X    rm -f foo
  6049. X    cc -o foo main.c
  6050. Xend
  6051. Xif test $? -ne 0 ; then fail; fi
  6052. X
  6053. X#
  6054. X# create a new test
  6055. X#
  6056. X./bin/aegis -nt -v -lib $worklib -p foo
  6057. Xif test $? -ne 0 ; then fail; fi
  6058. Xcat > $workchan/test/00/t0001a.sh << 'end'
  6059. X#!/bin/sh
  6060. X#
  6061. Xfail()
  6062. X{
  6063. X    echo SHUZBUTT 1>&2
  6064. X    exit 1
  6065. X}
  6066. Xpass()
  6067. X{
  6068. X    exit 0
  6069. X}
  6070. Xtrap "fail" 1 2 3 15
  6071. X
  6072. X./foo
  6073. Xif test $? -ne 0 
  6074. Xthen
  6075. X    fail
  6076. Xfi
  6077. X
  6078. X# it probably worked
  6079. Xpass
  6080. Xend
  6081. X
  6082. X#
  6083. X# let the clock tick over, so the build will be happy
  6084. X#
  6085. Xsleep 1
  6086. X
  6087. X#
  6088. X# build the change
  6089. X#
  6090. X./bin/aegis -build -nl -v -lib $worklib -p foo
  6091. Xif test $? -ne 0 ; then fail; fi
  6092. X
  6093. X#
  6094. X# difference the change
  6095. X#
  6096. X./bin/aegis -diff -nl -v -lib $worklib -p foo
  6097. Xif test $? -ne 0 ; then fail; fi
  6098. X
  6099. X#
  6100. X# test the change
  6101. X#
  6102. X./bin/aegis -test -nl -v -lib $worklib -p foo
  6103. Xif test $? -ne 0 ; then fail; fi
  6104. X
  6105. X#
  6106. X# finish development of the change
  6107. X#
  6108. X./bin/aegis -dev_end -v -lib $worklib -p foo
  6109. Xif test $? -ne 0 ; then fail; fi
  6110. X
  6111. X#
  6112. X# add a new reviewer
  6113. X#
  6114. X./bin/aegis -newrev $USER -p foo -v -lib $worklib
  6115. Xif test $? -ne 0 ; then fail; fi
  6116. X
  6117. X#
  6118. X# pass the review
  6119. X#
  6120. X./bin/aegis -review_pass -chan 1 -proj foo -v -lib $worklib
  6121. Xif test $? -ne 0 ; then fail; fi
  6122. X
  6123. X#
  6124. X# add an integrator
  6125. X#
  6126. X./bin/aegis -newint $USER -p foo -v -lib $worklib
  6127. Xif test $? -ne 0 ; then fail; fi
  6128. X
  6129. X#
  6130. X# start integrating
  6131. X#
  6132. X./bin/aegis -intbeg 1 -p foo -v -lib $worklib
  6133. Xif test $? -ne 0 ; then fail; fi
  6134. X
  6135. X#
  6136. X# integrate build
  6137. X#
  6138. Xsleep 1
  6139. X./bin/aegis -build -nl -v -lib $worklib -p foo
  6140. Xif test $? -ne 0 ; then fail; fi
  6141. X./bin/aegis -test -nl -v -lib $worklib -p foo
  6142. Xif test $? -ne 0 ; then fail; fi
  6143. X
  6144. X#
  6145. X# pass the integration
  6146. X#
  6147. X./bin/aegis -intpass -nl -v -lib $worklib -p foo
  6148. Xif test $? -ne 0 ; then fail; fi
  6149. X
  6150. X#
  6151. X# start work on change 2
  6152. X#
  6153. X./bin/aegis -devbeg 2 -p foo -v -dir $workchan -lib $worklib
  6154. Xif test $? -ne 0 ; then fail; fi
  6155. X
  6156. X#
  6157. X# copy a file into the change
  6158. X#
  6159. X./bin/aegis -cp $workchan/main.c -nl -v -lib $worklib -p foo
  6160. Xif test $? -ne 0 ; then fail; fi
  6161. X
  6162. X#
  6163. X# change the file
  6164. X#
  6165. Xcat > $workchan/main.c << 'end'
  6166. X
  6167. X#include <stdio.h>
  6168. X
  6169. Xvoid
  6170. Xmain(argc, argv)
  6171. X    int    argc;
  6172. X    char    **argv;
  6173. X{
  6174. X    if (argc != 1)
  6175. X    {
  6176. X        fprintf(stderr, "usage: %s\n", argv[0]);
  6177. X        exit(1);
  6178. X    }
  6179. X    printf("hello, world\n");
  6180. X    exit(0);
  6181. X}
  6182. Xend
  6183. X
  6184. X#
  6185. X# need another test
  6186. X#
  6187. X./bin/aegis -nt -v -lib $worklib -p foo
  6188. Xif test $? -ne 0 ; then fail; fi
  6189. Xcat > $workchan/test/00/t0002a.sh << 'end'
  6190. X#!/bin/sh
  6191. X#
  6192. Xfail()
  6193. X{
  6194. X    echo SHUZBUTT 1>&2
  6195. X    exit 1
  6196. X}
  6197. Xpass()
  6198. X{
  6199. X    exit 0
  6200. X}
  6201. Xtrap "fail" 1 2 3 15
  6202. X
  6203. X./foo ickky
  6204. Xif test $? -ne 1 
  6205. Xthen
  6206. X    fail
  6207. Xfi
  6208. X
  6209. X# it probably worked
  6210. Xpass
  6211. Xend
  6212. Xif test $? -ne 0 ; then fail; fi
  6213. X
  6214. X#
  6215. X# tick over clock to keep build happy
  6216. X#
  6217. Xsleep 1
  6218. X
  6219. X#
  6220. X# build the change
  6221. X# diff the change
  6222. X# test the change
  6223. X#
  6224. X./bin/aegis -b -nl -v -lib $worklib -p foo
  6225. Xif test $? -ne 0 ; then fail; fi
  6226. X./bin/aegis -diff -nl -v -lib $worklib -p foo
  6227. Xif test $? -ne 0 ; then fail; fi
  6228. X./bin/aegis -test -nl -v -lib $worklib -p foo
  6229. Xif test $? -ne 0 ; then fail; fi
  6230. X./bin/aegis -test -bl -nl -v -lib $worklib -p foo
  6231. Xif test $? -ne 0 ; then fail; fi
  6232. X
  6233. X
  6234. X#
  6235. X# end development
  6236. X# review pass
  6237. X# start integrating
  6238. X#
  6239. X./bin/aegis -devend -v -lib $worklib -p foo
  6240. Xif test $? -ne 0 ; then fail; fi
  6241. X./bin/aegis -revpass -v -c 2 -p foo -lib $worklib
  6242. Xif test $? -ne 0 ; then fail; fi
  6243. X./bin/aegis -intbeg -v -c 2 -p foo -lib $worklib
  6244. Xif test $? -ne 0 ; then fail; fi
  6245. X
  6246. X#
  6247. X# build the integration
  6248. X# test the integration
  6249. X# test the integration against the baseline
  6250. X#
  6251. Xsleep 1
  6252. X./bin/aegis -b -nl -v -lib $worklib -p foo
  6253. Xif test $? -ne 0 ; then fail; fi
  6254. X./bin/aegis -t -nl -v -lib $worklib -p foo
  6255. Xif test $? -ne 0 ; then fail; fi
  6256. X./bin/aegis -t -bl -nl -v -lib $worklib -p foo
  6257. Xif test $? -ne 0 ; then fail; fi
  6258. X
  6259. X#
  6260. X# pass the integration
  6261. X#
  6262. X./bin/aegis -intpass -nl -lib $worklib -p foo
  6263. Xif test $? -ne 0 ; then fail; fi
  6264. X
  6265. X# should be no automatic logging
  6266. Xif test "`find $work -name 'aegis.log' -print`" != "" ; then fail; fi
  6267. X
  6268. X#
  6269. X# the things tested in this test, worked
  6270. X#
  6271. Xpass
  6272. END_OF_FILE
  6273. if test 7628 -ne `wc -c <'test/00/t0008a.sh'`; then
  6274.     echo shar: \"'test/00/t0008a.sh'\" unpacked with wrong size!
  6275. fi
  6276. # end of 'test/00/t0008a.sh'
  6277. fi
  6278. if test -f 'test/00/t0017a.sh' -a "${1}" != "-c" ; then 
  6279.   echo shar: Will not clobber existing file \"'test/00/t0017a.sh'\"
  6280. else
  6281. echo shar: Extracting \"'test/00/t0017a.sh'\" \(7847 characters\)
  6282. sed "s/^X//" >'test/00/t0017a.sh' <<'END_OF_FILE'
  6283. X#! /bin/sh
  6284. X#
  6285. X#    aegis - project change supervisor
  6286. X#    Copyright (C) 1993 Peter Miller.
  6287. X#    All rights reserved.
  6288. X#
  6289. X#    This program is free software; you can redistribute it and/or modify
  6290. X#    it under the terms of the GNU General Public License as published by
  6291. X#    the Free Software Foundation; either version 2 of the License, or
  6292. X#    (at your option) any later version.
  6293. X#
  6294. X#    This program is distributed in the hope that it will be useful,
  6295. X#    but WITHOUT ANY WARRANTY; without even the implied warranty of
  6296. X#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  6297. X#    GNU General Public License for more details.
  6298. X#
  6299. X#    You should have received a copy of the GNU General Public License
  6300. X#    along with this program; if not, write to the Free Software
  6301. X#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  6302. X#
  6303. X# MANIFEST: Test 'aegis -DIFFerence -ANticipate' variant
  6304. X#
  6305. X# The bug results in a string of length 0 being passed.
  6306. X#
  6307. X
  6308. Xunset AEGIS_PROJECT
  6309. Xunset AEGIS_CHANGE
  6310. Xumask 022
  6311. X
  6312. XUSER=${USER:-${LOGNAME:-`whoami`}}
  6313. X
  6314. XPAGER=cat
  6315. Xexport PAGER
  6316. Xwork=${AEGIS_TMP:-/tmp}/$$
  6317. X
  6318. Xfail()
  6319. X{
  6320. X    set +x
  6321. X    echo "FAILED test of 'aegis -DIFFerence -ANticipate' variant" 1>&2
  6322. X    cd $here
  6323. X    find $work -type d -user $USER -exec chmod u+w {} \;
  6324. X    rm -rf $work
  6325. X    exit 1
  6326. X}
  6327. Xpass()
  6328. X{
  6329. X    set +x
  6330. X    echo PASSED 1>&2
  6331. X    cd $here
  6332. X    find $work -type d -user $USER -exec chmod u+w {} \;
  6333. X    rm -rf $work
  6334. X    exit 0
  6335. X}
  6336. Xtrap "fail" 1 2 3 15
  6337. X
  6338. X#
  6339. X# some variable to make things earier to read
  6340. X#
  6341. Xworklib=$work/lib
  6342. Xworkproj=$work/foo.proj
  6343. Xworkchan=$work/foo.chan
  6344. Xworkchan3=$work/foo.chan3
  6345. Xtmp=$work/tmp
  6346. X
  6347. X#
  6348. X# echo commands so we can tell what failed
  6349. X#
  6350. Xset -x
  6351. X
  6352. X#
  6353. X# make the directories
  6354. X#
  6355. Xmkdir $work
  6356. X
  6357. X#
  6358. X# make a new project
  6359. X#    and check files it should have made
  6360. X#
  6361. X./bin/aegis -newpro foo -dir $workproj -v -lib $worklib
  6362. Xif test $? -ne 0 ; then fail; fi
  6363. X
  6364. X#
  6365. X# change project attributes
  6366. X#
  6367. Xcat > $tmp << 'end'
  6368. Xdescription = "A bogus project created to test things.";
  6369. Xdeveloper_may_review = true;
  6370. Xdeveloper_may_integrate = true;
  6371. Xreviewer_may_integrate = true;
  6372. Xend
  6373. X./bin/aegis -proatt $tmp -proj foo -v -lib $worklib
  6374. Xif test $? -ne 0 ; then fail; fi
  6375. X
  6376. X#
  6377. X# create a new change
  6378. X#    make sure it creates the files it should
  6379. X#
  6380. Xcat > $tmp << 'end'
  6381. Xbrief_description = "This change is used to test the aegis functionality \
  6382. Xwith respect to change descriptions.";
  6383. Xcause = internal_bug;
  6384. Xend
  6385. X./bin/aegis -new_change $tmp -project foo -v -lib $worklib
  6386. Xif test $? -ne 0 ; then fail; fi
  6387. X
  6388. X#
  6389. X# create a second change
  6390. X#    make sure it creates the files it should
  6391. X#
  6392. Xcat > $tmp << 'end'
  6393. Xbrief_description = "This change was added to make the various listings \
  6394. Xmuch more interesting.";
  6395. Xcause = internal_bug;
  6396. Xend
  6397. X./bin/aegis -new_change $tmp -project foo -v -lib $worklib
  6398. Xif test $? -ne 0 ; then fail; fi
  6399. X
  6400. X#
  6401. X# create a third change
  6402. X#
  6403. Xcat > $tmp << 'end'
  6404. Xbrief_description = "change three";
  6405. Xcause = internal_bug;
  6406. Xend
  6407. X./bin/aegis -new_change $tmp -project foo -v -lib $worklib
  6408. Xif test $? -ne 0 ; then fail; fi
  6409. X
  6410. X#
  6411. X# add a new developer
  6412. X#
  6413. X./bin/aegis -newdev $USER -p foo -v -lib $worklib
  6414. Xif test $? -ne 0 ; then fail; fi
  6415. X
  6416. X#
  6417. X# begin development of a change
  6418. X#    check it made the files it should
  6419. X#
  6420. X./bin/aegis -devbeg 1 -p foo -dir $workchan -v -lib $worklib
  6421. Xif test $? -ne 0 ; then fail; fi
  6422. X
  6423. X#
  6424. X# add a new files to the change
  6425. X#
  6426. X./bin/aegis -new_file $workchan/main.c -nl -v -lib $worklib -p foo
  6427. Xif test $? -ne 0 ; then fail; fi
  6428. X./bin/aegis -new_file $workchan/config -nl -v -lib $worklib -p foo
  6429. Xif test $? -ne 0 ; then fail; fi
  6430. Xcat > $workchan/main.c << 'end'
  6431. Xvoid
  6432. Xmain()
  6433. X{
  6434. X    exit(0);
  6435. X}
  6436. Xend
  6437. Xcat > $workchan/config << 'end'
  6438. Xbuild_command = "rm -f foo; cc -o foo -D'VERSION=\"$version\"' main.c";
  6439. Xlink_integration_directory = true;
  6440. X
  6441. Xhistory_get_command =
  6442. X    "co -u'$e' -p $h,v > $o";
  6443. Xhistory_create_command =
  6444. X    "ci -u -m/dev/null -t/dev/null $i $h,v; rcs -U $h,v";
  6445. Xhistory_put_command =
  6446. X    "ci -u -m/dev/null -t/dev/null $i $h,v; rcs -U $h,v";
  6447. Xhistory_query_command =
  6448. X    "rlog -r $h,v | awk '/^head:/ {print $$2}'";
  6449. X
  6450. Xdiff_command = "set +e; diff $orig $i > $out; test $$? -le 1";
  6451. X
  6452. Xdiff3_command = "(diff3 -e $mr $orig $i | sed -e '/^w$$/d' -e '/^q$$/d'; \
  6453. X    echo '1,$$p' ) | ed - $mr > $out";
  6454. Xend
  6455. X
  6456. X#
  6457. X# create a new test
  6458. X#
  6459. X./bin/aegis -nt -l -v -lib $worklib -p foo
  6460. Xif test $? -ne 0 ; then fail; fi
  6461. X./bin/aegis -nt -v -lib $worklib -p foo
  6462. Xif test $? -ne 0 ; then fail; fi
  6463. Xcat > $workchan/test/00/t0001a.sh << 'end'
  6464. X#!/bin/sh
  6465. X
  6466. Xfail()
  6467. X{
  6468. X    echo SHUZBUTT 1>&2
  6469. X    exit 1
  6470. X}
  6471. Xpass()
  6472. X{
  6473. X    exit 0
  6474. X}
  6475. Xtrap "fail" 1 2 3 15
  6476. X
  6477. X./foo
  6478. Xif test $? -ne 0; then fail; fi
  6479. X
  6480. X# it probably worked
  6481. Xpass
  6482. Xend
  6483. X
  6484. X#
  6485. X# let the clock tick over, so the build will be happy
  6486. X#
  6487. Xsleep 1
  6488. X
  6489. X#
  6490. X# build the change
  6491. X#
  6492. X./bin/aegis -build -nl -v -lib $worklib -p foo
  6493. Xif test $? -ne 0 ; then fail; fi
  6494. X
  6495. X#
  6496. X# difference the change
  6497. X#
  6498. X./bin/aegis -diff -nl -v -lib $worklib -p foo
  6499. Xif test $? -ne 0 ; then fail; fi
  6500. X
  6501. X#
  6502. X# test the change
  6503. X#
  6504. X./bin/aegis -test -nl -v -lib $worklib -p foo
  6505. Xif test $? -ne 0 ; then fail; fi
  6506. X
  6507. X#
  6508. X# finish development of the change
  6509. X#
  6510. X./bin/aegis -dev_end -v -lib $worklib -p foo
  6511. Xif test $? -ne 0 ; then fail; fi
  6512. X
  6513. X#
  6514. X# add a new reviewer
  6515. X#
  6516. X./bin/aegis -newrev $USER -p foo -v -lib $worklib
  6517. Xif test $? -ne 0 ; then fail; fi
  6518. X
  6519. X#
  6520. X# pass the review
  6521. X#
  6522. X./bin/aegis -review_pass -chan 1 -proj foo -v -lib $worklib
  6523. Xif test $? -ne 0 ; then fail; fi
  6524. X
  6525. X#
  6526. X# add an integrator
  6527. X#
  6528. X./bin/aegis -newint $USER -p foo -v -lib $worklib
  6529. Xif test $? -ne 0 ; then fail; fi
  6530. X
  6531. X#
  6532. X# start integrating
  6533. X#
  6534. X./bin/aegis -intbeg 1 -p foo -v -lib $worklib
  6535. Xif test $? -ne 0 ; then fail; fi
  6536. X
  6537. X#
  6538. X# integrate build
  6539. X#
  6540. Xsleep 1
  6541. X./bin/aegis -build -nl -v -lib $worklib -p foo
  6542. Xif test $? -ne 0 ; then fail; fi
  6543. X./bin/aegis -test -nl -v -lib $worklib -p foo
  6544. Xif test $? -ne 0 ; then fail; fi
  6545. X
  6546. X#
  6547. X# pass the integration
  6548. X#
  6549. X./bin/aegis -intpass -nl -v -lib $worklib -p foo
  6550. Xif test $? -ne 0 ; then fail; fi
  6551. X
  6552. X#
  6553. X# start work on change 2
  6554. X#
  6555. X./bin/aegis -devbeg 2 -p foo -v -dir $workchan -lib $worklib
  6556. Xif test $? -ne 0 ; then fail; fi
  6557. X
  6558. X#
  6559. X# start work on change 3
  6560. X#
  6561. X./bin/aegis -devbeg 3 -p foo -v -dir $workchan3 -lib $worklib
  6562. Xif test $? -ne 0 ; then fail; fi
  6563. X
  6564. X#
  6565. X# copy a file into change 2
  6566. X#
  6567. X./bin/aegis -cp $workchan/main.c -nl -v -lib $worklib -c 2 -p foo
  6568. Xif test $? -ne 0 ; then fail; fi
  6569. X
  6570. X#
  6571. X# copy a file into change 3
  6572. X#
  6573. X./bin/aegis -cp $workchan3/main.c -nl -v -lib $worklib -c 3 -p foo
  6574. Xif test $? -ne 0 ; then fail; fi
  6575. X
  6576. X#
  6577. X# change the file
  6578. X#
  6579. Xcat > $workchan/main.c << 'end'
  6580. X
  6581. X#include <stdio.h>
  6582. X
  6583. Xvoid
  6584. Xmain(argc, argv)
  6585. X    int    argc;
  6586. X    char    **argv;
  6587. X{
  6588. X    if (argc != 1)
  6589. X    {
  6590. X        fprintf(stderr, "usage: %s\n", argv[0]);
  6591. X        exit(1);
  6592. X    }
  6593. X    printf("hello, world\n");
  6594. X    exit(0);
  6595. X}
  6596. Xend
  6597. X
  6598. X#
  6599. X# need another test
  6600. X#
  6601. X./bin/aegis -nt -v -lib $worklib -c 2 -p foo
  6602. Xif test $? -ne 0 ; then fail; fi
  6603. Xcat > $workchan/test/00/t0002a.sh << 'end'
  6604. X#!/bin/sh
  6605. X
  6606. Xfail()
  6607. X{
  6608. X    echo SHUZBUTT 1>&2
  6609. X    exit 1
  6610. X}
  6611. Xpass()
  6612. X{
  6613. X    exit 0
  6614. X}
  6615. Xtrap "fail" 1 2 3 15
  6616. X
  6617. X./foo ickky
  6618. Xif test $? -ne 1; then fail; fi
  6619. X
  6620. X# it probably worked
  6621. Xpass
  6622. Xend
  6623. X
  6624. X#
  6625. X# tick over clock to keep build happy
  6626. X#
  6627. Xsleep 1
  6628. X
  6629. X#
  6630. X# build the change
  6631. X# diff the change
  6632. X# test the change
  6633. X#
  6634. X./bin/aegis -b -nl -v -lib $worklib -c 2 -p foo
  6635. Xif test $? -ne 0 ; then fail; fi
  6636. X./bin/aegis -diff -nl -v -lib $worklib -c 2 -p foo
  6637. Xif test $? -ne 0 ; then fail; fi
  6638. X./bin/aegis -test -nl -v -lib $worklib -c 2 -p foo
  6639. Xif test $? -ne 0 ; then fail; fi
  6640. X./bin/aegis -test -bl -nl -v -lib $worklib -c 2 -p foo
  6641. Xif test $? -ne 0 ; then fail; fi
  6642. X
  6643. X#
  6644. X# end development
  6645. X# review pass
  6646. X# start integrating
  6647. X#
  6648. X./bin/aegis -devend -v -lib $worklib -c 2 -p foo
  6649. Xif test $? -ne 0 ; then fail; fi
  6650. X./bin/aegis -revpass -v -c 2 -p foo -lib $worklib
  6651. Xif test $? -ne 0 ; then fail; fi
  6652. X./bin/aegis -intbeg -v -c 2 -p foo -lib $worklib
  6653. Xif test $? -ne 0 ; then fail; fi
  6654. X
  6655. X#
  6656. X# difference change 3 anticipating 2
  6657. X#
  6658. X./bin/aegis -diff -nl -c 3 -lib $worklib -p foo -an 2
  6659. Xif test $? -ne 0 ; then fail; fi
  6660. X
  6661. X#
  6662. X# the merged result (in change 3) should look like
  6663. X# the edited one from change 2
  6664. X#
  6665. Xdiff $workchan3/main.c,D $workchan/main.c
  6666. Xif test $? -ne 0 ; then fail; fi
  6667. X
  6668. X#
  6669. X# the things tested in this test, worked
  6670. X#
  6671. Xpass
  6672. END_OF_FILE
  6673. if test 7847 -ne `wc -c <'test/00/t0017a.sh'`; then
  6674.     echo shar: \"'test/00/t0017a.sh'\" unpacked with wrong size!
  6675. fi
  6676. # end of 'test/00/t0017a.sh'
  6677. fi
  6678. echo shar: End of archive 6 \(of 19\).
  6679. cp /dev/null ark6isdone
  6680. MISSING=""
  6681. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; do
  6682.     if test ! -f ark${I}isdone ; then
  6683.     MISSING="${MISSING} ${I}"
  6684.     fi
  6685. done
  6686. if test "${MISSING}" = "" ; then
  6687.     echo You have unpacked all 19 archives.
  6688.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  6689. else
  6690.     echo You still need to unpack the following archives:
  6691.     echo "        " ${MISSING}
  6692. fi
  6693. ##  End of shell archive.
  6694. exit 0
  6695.