Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • dailybuild_linux-x64
  • dailybuild_win32
  • sqlite
  • rip_abstraction
  • dailybuild_macos-armv8
  • dd_file_lister_filanem_in_desc_color
  • mode7
  • dd_msg_reader_are_you_there_warning_improvement
  • c23-playing
  • syncterm-1.3
  • syncterm-1.2
  • test-build
  • hide_remote_connection_with_telgate
  • 638-can-t-control-c-during-a-file-search
  • add_body_to_pager_email
  • mingw32-build
  • cryptlib-3.4.7
  • ree/mastermind
  • new_user_dat
  • sbbs320d
  • syncterm-1.6
  • syncterm-1.5
  • syncterm-1.4
  • sbbs320b
  • syncterm-1.3
  • syncterm-1.2
  • syncterm-1.2rc6
  • syncterm-1.2rc5
  • push
  • syncterm-1.2rc4
  • syncterm-1.2rc2
  • syncterm-1.2rc1
  • sbbs319b
  • sbbs318b
  • goodbuild_linux-x64_Sep-01-2020
  • goodbuild_win32_Sep-01-2020
  • goodbuild_linux-x64_Aug-31-2020
  • goodbuild_win32_Aug-31-2020
  • goodbuild_win32_Aug-30-2020
40 results

send_pr.js

Blame
  • send_pr.js 3.66 KiB
    // $Id$
    
    load("sbbsdefs.js");
    load("gnatslib.js");
    
    const REVISION = "$Revision$".split(' ')[1];
    
    const MAX_LINE_LEN = 78
    
    console.clear();
    console.center(format("Synchronet Bug Submission Module %s\r\n", REVISION));
    console.crlf();
    
    gnats=new GNATS("bugs.synchro.net","guest");
    if(!gnats.connect()) {
    	writeln(gnats.error);
    	exit();
    }
    
    pr = new Object;
    var tmp;
    
    pr.Originator = user.name;
    pr.Confidential = console.noyes("Confidential")?'no':'yes';
    if(console.aborted)
    	exit();
    console.print("\r\n\1y\1hOne-line synopsis of the problem:\r\n");
    pr.Synopsis = truncsp(console.getstr(MAX_LINE_LEN, K_LINE));
    if(console.aborted || !pr.Synopsis.length)
    	exit();
    severity = gnats.get_valid("Severity");
    for(i=0; i<severity.length; i++) {
    	console.uselect(i,"Severity",severity[i]);
    }
    tmp=console.uselect();
    if(tmp == -1)
    	exit();
    pr.Severity=severity[tmp];
    priority = gnats.get_valid("Priority");
    for(i=0; i<priority.length; i++) {
    	console.uselect(i,"Priority",priority[i]);
    }
    tmp=console.uselect();
    if(tmp == -1)
    	exit();
    pr.Priority=priority[tmp];
    allcats=gnats.get_list("Categories");
    cats=new Array();
    for(i=0; i<allcats.length; i++) {
    	var flds=allcats[i].split(/:/);
    	cats.push(flds[0]);
    	console.uselect(i, "Category", flds[1], "");
    }
    tmp=console.uselect();
    if(tmp == -1)
    	exit();
    pr.Category=cats[tmp];
    cls = gnats.get_valid("Class");
    for(i=0; i<cls.length; i++) {
    	if(!gnats.cmd("ADMV","class",cls[i]))
    		continue;
    	if(!gnats.expect("ADMV",350))
    		continue;
    	var flds=gnats.response.message.split(/:/);
    	console.uselect(i, "Class", flds[2], "");
    }
    tmp=console.uselect();
    if(tmp == -1)
    	exit();
    pr.Class=cls[tmp];
    pr.Version=system.version_notice+system.revision+" Compiled: "+system.compiled_when+" with "+system.compiled_with;
    pr.Environment=system.os_version+"\r\n"+system.js_version+"\r\n"+system.socket_lib+"\r\n"+system.msgbase_lib;
    console.print("\r\n\1y\1hPrecise description of the problem (Blank line ends):\r\n");
    pr.Description = '';
    do {
    	var line=truncsp(console.getstr(MAX_LINE_LEN, K_WRAP | K_LINE));
    	if(console.aborted)
    		exit();
    	pr.Description += line + "\r\n";
    } while (line != '' && bbs.online);
    console.print("\1y\1hSteps to reproduce the problem (Blank line ends):\r\n");
    pr.HowToRepeat = '';
    do {
    	var line=truncsp(console.getstr(MAX_LINE_LEN, K_WRAP | K_LINE));
    	if(console.aborted)
    		exit();
    	pr.HowToRepeat += line + "\r\n";
    } while (line != '' && bbs.online);
    console.print("\1y\1hFix/Workaround if known (Blank line ends):\r\n");
    pr.Fix = '';
    do {
    	var line=truncsp(console.getstr(MAX_LINE_LEN, K_WRAP | K_LINE));
    	if(console.aborted)
    		exit();
    	pr.Fix += line + "\r\n";
    } while (line != '' && bbs.online);
    
    var body='';
    body += "To: bugs\r\n";
    body += "CC:\r\n";
    body += "Subject: "+pr.Synopsis+"\r\n";
    body += "From: "+user.name+" <"+user.email+">\r\n";
    body += "Reply-To: "+user.name+" <"+user.email+">\r\n";
    body += "X-Send-Pr-Version: Synchronet send_pr.js\r\n";
    body += "\r\n";
    body += ">Originator:\t" + pr.Originator + "\r\n";
    body += ">Confidential:\t" + pr.Confidential + "\r\n";
    body += ">Synopsis:\t" + pr.Synopsis + "\r\n";
    body += ">Severity:\t" + pr.Severity + "\r\n";
    body += ">Priority:\t" + pr.Priority + "\r\n";
    body += ">Category:\t" + pr.Category + "\r\n";
    body += ">Class:\t" + pr.Class + "\r\n";
    body += ">Version:\t" + pr.Version + "\r\n";
    body += ">Environment:\r\n" + pr.Environment + "\r\n";
    body += ">Description:\r\n" + pr.Description;
    body += ">How-To-Repeat:\r\n" + pr.HowToRepeat;
    body += ">Fix:\r\n" + pr.Fix;
    
    // Only submit if the user is still online...
    if(bbs.online) {
    	if(!gnats.submit(body)) {
    		alert(gnats.error);
    		console.pause();
    	} else {
    		console.print("\1y\1hProblem Report (PR) submitted successfully.\r\n");
    		console.print(gnats.message);
    	}
    }
    gnats.close();