pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkgsrc-todo pkgsrc-todo: fix old bug that bro...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/16007d139783
branches:  trunk
changeset: 452930:16007d139783
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Thu May 20 10:51:41 2021 +0000

description:
pkgsrc-todo: fix old bug that broke adding entries at the end of the list

Bump version.

diffstat:

 pkgtools/pkgsrc-todo/Makefile          |   5 ++---
 pkgtools/pkgsrc-todo/files/add_todo.pl |  15 +++++++++++----
 2 files changed, 13 insertions(+), 7 deletions(-)

diffs (64 lines):

diff -r 72a71bb4e906 -r 16007d139783 pkgtools/pkgsrc-todo/Makefile
--- a/pkgtools/pkgsrc-todo/Makefile     Thu May 20 10:12:17 2021 +0000
+++ b/pkgtools/pkgsrc-todo/Makefile     Thu May 20 10:51:41 2021 +0000
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.17 2020/08/31 18:10:59 wiz Exp $
+# $NetBSD: Makefile,v 1.18 2021/05/20 10:51:41 wiz Exp $
 
-PKGNAME=       pkgsrc-todo-1.3
-PKGREVISION=   5
+PKGNAME=       pkgsrc-todo-1.4
 CATEGORIES=    pkgtools
 
 MAINTAINER=    wiz%NetBSD.org@localhost
diff -r 72a71bb4e906 -r 16007d139783 pkgtools/pkgsrc-todo/files/add_todo.pl
--- a/pkgtools/pkgsrc-todo/files/add_todo.pl    Thu May 20 10:12:17 2021 +0000
+++ b/pkgtools/pkgsrc-todo/files/add_todo.pl    Thu May 20 10:51:41 2021 +0000
@@ -1,9 +1,8 @@
 #!@PERL@
 
-# $NetBSD: add_todo.pl,v 1.1.1.1 2009/08/30 10:40:34 wiz Exp $
+# $NetBSD: add_todo.pl,v 1.2 2021/05/20 10:51:42 wiz Exp $
 
 # TODO:
-# fix adding entry after last one (currently broken)
 # check if package was removed
 # check if package was downgraded (e.g. oto)
 # allow multiple command line arguments
@@ -17,7 +16,7 @@
 my ($comment, $entry, $grep_result, $newname, $newpkg, $newprinted,
     $newversion, %opt, $verbose);
 
-my $PKGSRCDIR = "@PKGSRCDIR@";
+ my $PKGSRCDIR = "@PKGSRCDIR@";
 my $input = "$PKGSRCDIR/doc/TODO";
 my $wipinput = "$PKGSRCDIR/wip/TODO";
 my $output = "$input.new";
@@ -90,11 +89,18 @@
 open IN, $input or die "can't open input file ``$input''";
 open OUT, ">$output" or die "can't open output file ``$output''";
 
+my $todo_list_found = 0;
 while (<IN>) {
-       if ($newprinted or not m/^      o /) {
+        if ($newprinted or (not m/^    o / and $todo_list_found == 0)) {
                print OUT $_;
                next;
        }
+       if (not m/^     o / and $todo_list_found == 1) {
+               print OUT "     o $newpkg\n";
+               print OUT $_;
+               $newprinted = 1;
+               next;
+       }
 
        chomp();
        s/^\to //;
@@ -106,6 +112,7 @@
                $comment = "";
        }
 
+       $todo_list_found = 1;
        $entry =~ regex_pkgname;
        my ($entryname, $entryversion) = ($1, $2);
 



Home | Main Index | Thread Index | Old Index