]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7988 add info in the buffer with comments to exclude lines
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 21 Aug 2015 00:14:24 +0000 (19:14 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 21 Aug 2015 00:14:35 +0000 (19:14 -0500)
support-d/utils/filebug.pl

index 5e9d569a808d2f06affccdc6ae19f08ba57e4d7d..d3a40b7ae54e281858c8a5d8818b23e612bff380 100755 (executable)
@@ -8,7 +8,7 @@ use Data::Dumper;
 my $editor = $ENV{"EDITOR"} || $ENV{"VISUAL"} || `which emacs` || `which vi`;
 my $default_versions = "1.7 1.6";
 my $default_components = "freeswitch-core";
-
+my $desc_head = "; Enter the description lines beginning with a ; will be ignored.\n";
 
 
 sub getpass {
@@ -35,19 +35,25 @@ sub getfield {
 
 sub get_text {
     my $text = shift;
+    my $notes = shift;
 
     my @chars = ("A".."Z", "a".."z");
     my $string;
     $string .= $chars[rand @chars] for 1..8;
     
-    if ($text) {
+    if ($text || $notes) {
        open O, ">/tmp/TEXT.$string";
-       print O $text;
+       if ($notes) {
+           print O $notes;
+       }
+       if ($text) {
+           print O $text;
+       }
        close O;
     }
 
     system("$editor /tmp/TEXT.$string");
-    my $newtext = `cat /tmp/TEXT.$string`;
+    my $newtext = `cat /tmp/TEXT.$string | grep -v "^\\;"`;
     unlink("/tmp/TEXT.$string");
     return $newtext;
 }
@@ -167,9 +173,9 @@ if ($opts{askall}) {
     $opts{hash} = getfield("GIT Hash: ", $opts{hash});
 
     if ($opts{noedit}) {
-       $opts{desc} = getfield("Description: ", $opts{desc});
+       $opts{desc} = getfield("Description: ", $opts{desc}, $desc_head);
     } else {
-       $opts{desc} = get_text($opts{desc});
+       $opts{desc} = get_text($opts{desc}, $desc_head);
     }
 }
 
@@ -177,7 +183,7 @@ if (!$opts{desc}) {
     if ($opts{noedit}) {
        $opts{desc} = getfield("Description: ", $opts{desc});
     } else {
-       $opts{desc} = get_text($opts{desc});
+       $opts{desc} = get_text($opts{desc}, $desc_head);
     }
 
     if (!$opts{desc}) {