1 &version 2
  2 &- **************************************************************
  3 &- *                                                            *
  4 &- * Copyright, (C) Massachusetts Institute of Technology, 1985 *
  5 &- *                                                            *
  6 &- **************************************************************
  7 &-
  8 &trace &command off
  9 &goto &ec_name
 10 &label ffv1
 11 &label forum_find_v1
 12 &default &undefined &[working_dir]
 13 &if &[not [exists argument &1]] &then &do
 14   &print Usage:  ec ffv1 SUBTREE_ROOT {RESULT_DIR}
 15   &quit
 16 &end
 17 cwd &2
 18 do "if [exists segment &&1] -then ""delete &&1"" " (LINKS MEETINGS LINK_ERRORS MEETING_ERRORS)
 19 &-
 20 io attach (forum_links_ forum_meetings_ forum_meeting_errors_ forum_link_errors_) vfile_ (LINKS MEETINGS MEETING_ERRORS LINK_ERRORS)
 21 io open (forum_links_ forum_meetings_ forum_meeting_errors_ forum_link_errors_) stream_output
 22 forum_find_v1$init_search
 23 &-
 24 file_output ERRORS -ssw error_output -truncate
 25 walk_subtree &1 "forum_find_v1" -brief
 26 revert_output -ssw error_output
 27 io close (forum_links_ forum_meetings_ forum_meeting_errors_ forum_link_errors_)
 28 io detach (forum_links_ forum_meetings_ forum_meeting_errors_ forum_link_errors_)
 29 &quit
 30 &-
 31 &-
 32 &-
 33 &label convert_meetings
 34 &default &undefined &[working_dir]
 35 &if &[not [exists argument &1]] &then &do
 36   &print Usage:  ec convert_meetings MEETING_LIST {RESULT_DIR}
 37   &quit
 38 &end
 39 &-
 40 io attach meeting_list vfile_ &(1)
 41 io open meeting_list stream_input
 42 &-
 43 &set init_failed false
 44 &on command_error &begin
 45      &set init_failed true
 46      &exit &continue
 47 &end
 48 &-
 49 convert_meetings$init_convert
 50 &-
 51 &revert command_error
 52 &if &(init_failed) &then &quit
 53 &-
 54 &on active_function_error &begin
 55   &goto no_more_meetings
 56 &end
 57 &-
 58 file_output CONVERT_ERRORS -ssw error_output -truncate
 59 &label next_meeting_
 60 convert_meetings$convert_one_meeting [io get_line meeting_list]
 61 &goto next_meeting_
 62 &-
 63 &label no_more_meetings
 64 &revert active_function_error
 65 revert_output -ssw error_output
 66 io (close detach destroy) meeting_list
 67 convert_meetings$cleanup_convert
 68 &quit
 69 &-
 70 &-
 71 &-
 72 &-
 73 &-
 74 &label update_links
 75 &default &undefined &[working_dir]
 76 &if &[not [exists argument &1]] &then &do
 77   &print Usage:  ec update_links DIR_LIST {RESULT_DIR}
 78   &quit
 79 &end
 80 &-
 81 io attach dir_list vfile_ &(1)
 82 io open dir_list stream_input
 83 &-
 84 &on active_function_error &begin
 85   &goto no_more_dirs
 86 &end
 87 &-
 88 file_output UPDATE_ERRORS -ssw error_output -truncate
 89 &-
 90 &on command_error &begin
 91      &if &(first_error_this_dir) &then &do
 92           io put_chars error_output ""
 93           io put_chars error_output "Errors for &(DIR):"
 94           io put_chars error_output ""
 95           &set first_error_this_dir false
 96      &end
 97      &exit &continue
 98 &end
 99 &-
100 &label next_dir_
101 &set first_error_this_dir true
102 &set DIR &[io get_line dir_list]
103 discard_output forum_add_meeting -dr &(DIR) -update
104 &goto next_dir_
105 &-
106 &label no_more_dirs
107 &revert active_function_error
108 revert_output -ssw error_output
109 io (close detach destroy) dir_list
110 &quit