summaryrefslogtreecommitdiff
path: root/app-misc/tdl
diff options
context:
space:
mode:
Diffstat (limited to 'app-misc/tdl')
-rw-r--r--app-misc/tdl/Manifest10
-rw-r--r--app-misc/tdl/files/1.5.2-ldflags.patch13
-rw-r--r--app-misc/tdl/files/tdl-1.5.2-list.c.patch34
-rw-r--r--app-misc/tdl/files/tdl-1.5.2-main.c.patch178
-rw-r--r--app-misc/tdl/files/tdl-1.5.2-man.patch507
-rw-r--r--app-misc/tdl/metadata.xml13
-rw-r--r--app-misc/tdl/tdl-1.5.2-r2.ebuild75
7 files changed, 830 insertions, 0 deletions
diff --git a/app-misc/tdl/Manifest b/app-misc/tdl/Manifest
new file mode 100644
index 000000000000..d383cf7fee27
--- /dev/null
+++ b/app-misc/tdl/Manifest
@@ -0,0 +1,10 @@
+AUX 1.5.2-ldflags.patch 350 SHA256 d4924e725a5595342ca530dc5988e3b8ac47a02c1928cf631d9b2c95dc6c9088 SHA512 a3bb6f75a56d350755edf4cbb7a36fbe3da2e87fb8744a5597f9909cfe9e03b9ea4a50d70d9ca0cb2c480c11597701fbf9866d5eb7e726617005679c41ec5e9d WHIRLPOOL 06e98a63fde429f0918bf898432ce84d1a06c190a8ea1360dff81c4813a190053702c143a75e40599c833662cf0970f678a83b6b6a788f51732e0827f1de9200
+AUX tdl-1.5.2-list.c.patch 1272 SHA256 7c79e4e84b1b35932d78a2dca1aa2f52e07e95f6398fa558d76f6fc992e4cba5 SHA512 a66d0728f06d386827dd1232e3c290c9e749689cb368b9240638cde86c5ef1ae5e9ce5923a6b7dbba5e04c30ded2174c1c16e24ca6a943754cd178098a732400 WHIRLPOOL aca725d5be23d47643932656fb0c395e51bcbb8feb1659e3e70ecb2d940939ad77342d1c71586fd4a99322c3823b5939a12910291c1222ef8f6927fb7336d290
+AUX tdl-1.5.2-main.c.patch 4967 SHA256 5f34ae0e08ce4fce8af4715bb87d69d5e52cddf49a608d2946e36eac3241f8e0 SHA512 b7036f2b4292263fcde59c6cb46a869dec92fe314f4d3a5d4f2f5411adb945ec5493e82a142372bca933d67c423c4deff333b297a1dc2481d993de1789faaeb2 WHIRLPOOL 05e03abe6ef75c5c4196275c02c35b9d37935ae43b54be6e3d6f5ab3f37207918bef6ca3dd9f658ab9f0f5bdfd460a302b4e8e4850589e11482d5274f4eb6c27
+AUX tdl-1.5.2-man.patch 11004 SHA256 bcb1f313dc7976f4a539b6a04c649e6b507f3a7437f43212bdcd0e3519b01a23 SHA512 fef2ca8f8c6db0b61037ad10269fe185f2d5cb1ffdee0560acdba61be87d71d2195471412d26a5c6e7766332d9a13bf95774b0374de14b6df7b4a97ad27e8d32 WHIRLPOOL e8117d3202b3f7992b990eace9dc767c67aaa8f55f0295c942fd0039a2beeb43bcee4f937923c5c87fa3fb369cca21dd47d8bb06fd89ad713902675816ed481b
+DIST tdl-1.5.2.tar.gz 66057 SHA256 b43ed73bbdc77527c164b7e99f28c5fe2b7626d30adace78d8c40cca74f7fbfb SHA512 8c07a5b6a5434bb567a2d68b6e0215bbfa7be3f7176ae1042652ac18684289117230af25d8d161fcf1ba27d9b740fd3fcd43c3213467b533de64390686481fe0 WHIRLPOOL e1e136bc01716e41b56df16caa6bc9bfa7742abf0b50a376a9aea9ddec61931d064eef2a1d59a3b1fa3eacf49ffd9164fd95d70af2811d6fb8fe1447c9fecde5
+DIST tdl-screenshot.png.tar 20480 SHA256 9deb053eebc426cd3fd694cfa953043faf7da86ff65c498a135d01bafe5d68c4 SHA512 caca9793626b320ded4c7f16425b98e4bfde9ab0ca3c1bea60ecc8aaa8db080ab6fc3c474aef4d56e394b6415ec1162671329912aa22452dbd5dc72b50c7c8f6 WHIRLPOOL e2dc07ecf38f9a1945299c919f797d946ba99c32274b132b3deb6d0889a474138bff2ed485a901188ec67917523fa9818e2692b21ba12e4a16ded6c5519b4c41
+EBUILD tdl-1.5.2-r2.ebuild 1513 SHA256 c54b976c91285b5ddb2bfd0a7acc3457d74ad2800c9db1947a867f6f4741308b SHA512 40c6116b132441e21d62bccb997b1e140879df1981684aaba097d8b3373b4f933d94b89e52b3dc2d864a1b08193b09811437bad3077e228a600d0275fb752794 WHIRLPOOL 204cd2c067e775f61ca1924c5f5ca9bc1e2dd5f8e2f622afb576446a334b366cd8cd0a2650f686b55b07b2395d6c865e284fb5f8b180a26c73e21ff546f923b7
+MISC ChangeLog 2566 SHA256 049395cb766fdd2bb8232703a320e34aab0461cfafb09d290e4d329665f0801a SHA512 bd665a85128d157e9dd2a3ddbafae8baebd33ac5b262bf8bd10cd092e0cc7686db890c6800a4fe253c3ea027e175dba2e686ff77bafa711c0f5f10d9b87b3f9e WHIRLPOOL ac9b1ccfbbd0c2444300fa738ffc4d2dca25ce84b173c1d7c7307c07aa331836eecbfa33184809e55f3d5ec8d1a393ba2c757d4a29fae393acd56e11490f3044
+MISC ChangeLog-2015 4232 SHA256 832767ec98146cad196c96a0b2de4eb8502a75aa655915ddd0c2db2f8781ee58 SHA512 f147799e7f80b16e4d0b7705b513403290ea7c2ff5ba26ad84604cfc0c28b6a1ad819306df21255f31444b31ec6c8cd7d9823d565de2b3923b3abed130acc9ed WHIRLPOOL 9d566746d2c514e2e0d7520a9c36c9aeadc7359e6d6e2f9b9a76d2e84a5392347de04cde64926cf122e60a6845e805666dbe11bdfd00a7df49b6998a18631082
+MISC metadata.xml 507 SHA256 ec9add1ed5e43b55491c8af47772aaac7a441ca8722ea0e3df5eed02cd7f3a63 SHA512 ce0e36e0dc95b3c050f17e33220bb85c07946127337ae766b7c3af2d9d0891187bb9ab73d8cb01f91bad4f061620d19a403f3af85c801e3194f0a9dc6a0b6ce2 WHIRLPOOL 190c4220b5928102255f2d7a72bd5e866b05384c6f8f72939cc8b8a355568d982bcfd69bf8a8a093f3b091ac0fe04a9c878769768fda4cea0ff679659457e7d3
diff --git a/app-misc/tdl/files/1.5.2-ldflags.patch b/app-misc/tdl/files/1.5.2-ldflags.patch
new file mode 100644
index 000000000000..d807fdf02246
--- /dev/null
+++ b/app-misc/tdl/files/1.5.2-ldflags.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile.in b/Makefile.in
+index 46b05ca..eb9b656 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -52,7 +52,7 @@ OBJ = main.o io.o add.o done.o remove.o move.o list.o \
+ all : tdl
+
+ tdl : $(OBJ)
+- $(CC) $(CFLAGS) -o tdl $(OBJ) $(LIB_READLINE)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o tdl $(OBJ) $(LIB_READLINE)
+
+ %.o : %.c
+ $(CC) $(CFLAGS) -c $<
diff --git a/app-misc/tdl/files/tdl-1.5.2-list.c.patch b/app-misc/tdl/files/tdl-1.5.2-list.c.patch
new file mode 100644
index 000000000000..d2cc39bd49c1
--- /dev/null
+++ b/app-misc/tdl/files/tdl-1.5.2-list.c.patch
@@ -0,0 +1,34 @@
+--- tdl-1.5.2.orig/list.c
++++ tdl-1.5.2/list.c
+@@ -75,14 +75,15 @@
+ static void print_timestamp(int timestamp, char *leader, int indent, int monochrome)/*{{{*/
+ {
+ char buffer[32];
+- time_t now;
++ time_t now, timestamp2;
+ long diff, days_ago, days_ahead;
+
+ now = time(NULL);
+ diff = now - timestamp;
+ days_ago = (diff + ((diff > 0) ? 43200 : -43200)) / 86400;
++ timestamp2 = (time_t) timestamp;
+ strftime(buffer, sizeof(buffer), "%a %d %b %Y %H:%M",
+- localtime((time_t *)&timestamp));
++ localtime(&timestamp2));
+ do_indent(indent+2);
+ if (days_ago < 0) {
+ days_ahead = - days_ago;
+@@ -524,6 +525,13 @@
+ * Otherwise, use the priority from the specified node, _except_ when
+ * that is higher than normal, in which case use normal. */
+ prio_to_use = (prio_set) ? prio : ((node_prio > prio) ? prio : node_prio);
++ /* if listing up-to-some-depth (option -N) and also
++ * beginning at some top-level (option NNN) then depth must be
++ * decremented by 1
++ * see: http://bugs.debian.org/364083 */
++ if (options.depth > 0) {
++ options.depth--;
++ }
+ list_chain(&n->kids, INDENT_TAB, 0, &options, index_buffer, prio_to_use, now, hits);
+ }
+ } else if ((y[0] == '-') && (y[1] == '-')) {
diff --git a/app-misc/tdl/files/tdl-1.5.2-main.c.patch b/app-misc/tdl/files/tdl-1.5.2-main.c.patch
new file mode 100644
index 000000000000..c195a1e5cb7c
--- /dev/null
+++ b/app-misc/tdl/files/tdl-1.5.2-main.c.patch
@@ -0,0 +1,178 @@
+--- tdl-1.5.2.orig/main.c
++++ tdl-1.5.2/main.c
+@@ -80,7 +80,7 @@
+ return;
+ }
+ /*}}}*/
+-static volatile void unlock_and_exit(int code)/*{{{*/
++static void unlock_and_exit(int code)/*{{{*/
+ {
+ unlock_database();
+ exit(code);
+@@ -237,22 +237,91 @@
+
+ }
+ /*}}}*/
+-static void rename_database(char *path)/*{{{*/
++static mode_t get_mode(const char *path); /* prototype */
++/*}}}*/
++static int copy_file_contents(char *pathsrc, char *pathdest) {
++ int src, dest;
++ ssize_t rdsize = 1;
++ char buf[4096];
++
++ src = open(pathsrc, O_RDONLY);
++ if (src == -1) {
++ perror("warning, couldn't open database");
++ return 0;
++ }
++ dest = open(pathdest, O_WRONLY | O_CREAT, get_mode(pathsrc));
++ if (dest == -1) {
++ perror("warning, couldn't open/create backup database");
++ close(src);
++ return 0;
++ }
++ if (ftruncate(dest,0) != 0) {
++ perror("warning, couldn't truncate backup database");
++ close(src);
++ close(dest);
++ return 0;
++ }
++ lseek(src,0,SEEK_SET);
++ lseek(dest,0,SEEK_SET);
++ while (rdsize > 0) {
++ rdsize = read(src, buf, 4096);
++ if (rdsize == -1) {
++ perror("warning, error reading database");
++ close(src);
++ close(dest);
++ return 0;
++ }
++ if (rdsize > 0) {
++ if (write(dest, buf, rdsize) != rdsize) {
++ perror("warning, error writing to backup database");
++ close(src);
++ close(dest);
++ return 0;
++ }
++ }
++ }
++ close(src);
++ close(dest);
++ return 1;
++}
++/*}}}*/
++static int path_is_symlink(char *path) {
++ int i;
++ struct stat s;
++ i = lstat(path, &s);
++ if ((i == 0) && (S_ISLNK(s.st_mode))) {
++ return 1; /* is a symlink */
++ }
++ return 0; /* not a symlink */
++}
++/*}}}*/
++static int rename_database(char *path)/*{{{*/
+ {
+- int len;
++ /* the rename_database function returns 1 if database or/and
++ * database backup file are symlinks; otherwise returns 0 */
++ int len, symlinks;
+ char *pathbak;
+-
++
+ len = strlen(path);
+ pathbak = new_array(char, len + 5);
+ strcpy(pathbak, path);
+ strcat(pathbak, ".bak");
+- if (rename(path, pathbak) < 0) {
+- if (is_noisy) {
+- perror("warning, couldn't save backup database:");
++
++ symlinks = path_is_symlink(path) | path_is_symlink(pathbak);
++
++ if (symlinks) {
++ if (access(path,F_OK) == 0) {
++ copy_file_contents(path, pathbak);
++ }
++ } else {
++ if (rename(path, pathbak) < 0) {
++ if (is_noisy) {
++ perror("warning, couldn't save backup database:");
++ }
+ }
+ }
+ free(pathbak);
+- return;
++ return symlinks;
+ }
+ /*}}}*/
+ static char *executable_name(char *argv0)/*{{{*/
+@@ -315,7 +384,7 @@
+ /*}}}*/
+ static void save_database(char *path)/*{{{*/
+ {
+- FILE *out;
++ FILE *out = NULL;
+ int out_fd;
+ mode_t database_mode;
+ if (is_loaded && currently_dirty) {
+@@ -324,20 +393,34 @@
+ /* The next line only used to happen if the command wasn't 'create'.
+ * However, it should quietly fail for create, where the existing database
+ * doesn't exist */
+- rename_database(path);
+-
+- /* Open database this way so that the permissions from the existing
+- database can be duplicated onto the new one in way free of race
+- conditions. */
+- out_fd = open(path, O_WRONLY | O_CREAT | O_EXCL, database_mode);
+- if (out_fd < 0) {
+- fprintf(stderr, "Could not open new database %s for writing : %s\n",
+- path, strerror(errno));
+- unlock_and_exit(1);
++ if (rename_database(path) == 0) {
++ /* database is a regular file */
++ /* Open database this way so that the permissions from the existing
++ database can be duplicated onto the new one in way free of race
++ conditions. */
++ out_fd = open(path, O_WRONLY | O_CREAT | O_EXCL, database_mode);
++ if (out_fd < 0) {
++ fprintf(stderr, "Could not open new database %s for writing : %s\n",
++ path, strerror(errno));
++ unlock_and_exit(1);
++ }
+ } else {
+- /* Normal case */
+- out = fdopen(out_fd, "wb");
++ /* database and/or backup database are symlinks */
++ /* we should truncate existing file and write its contents */
++ out_fd = open(path, O_WRONLY | O_CREAT, database_mode);
++ if (out_fd < 0) {
++ fprintf(stderr, "Could not open database %s for writing : %s\n",
++ path, strerror(errno));
++ unlock_and_exit(1);
++ } else {
++ /* Normal case */
++ if (ftruncate(out_fd, 0) != 0) {
++ perror("warning, couldn't truncate database:");
++ unlock_and_exit(1);
++ }
++ }
+ }
++ out = fdopen(out_fd, "wb");
+ if (!out) {
+ fprintf(stderr, "Cannot open database %s for writing\n", path);
+ unlock_and_exit(1);
+@@ -728,6 +811,11 @@
+
+ if (!is_loaded && cmds[index].load_db) {
+ load_database(current_database_path);
++ if (is_interactive && (!is_loaded)) {
++ fprintf(stderr, "error: could not open database. please create a "
++ "database with 'tdl create' before using this tdl command\n");
++ unlock_and_exit(-1);
++ }
+ }
+
+ pp = is_tdl ? (p + 1) : p;
diff --git a/app-misc/tdl/files/tdl-1.5.2-man.patch b/app-misc/tdl/files/tdl-1.5.2-man.patch
new file mode 100644
index 000000000000..955201a2fe2f
--- /dev/null
+++ b/app-misc/tdl/files/tdl-1.5.2-man.patch
@@ -0,0 +1,507 @@
+--- tdl-1.5.2.orig/tdl.1
++++ tdl-1.5.2/tdl.1
+@@ -2,25 +2,25 @@
+ .SH NAME
+ tdl \- To do list manager
+ .SH SYNOPSIS
+-tdl [-q]
++tdl [\-q]
+ .br
+-tdl [-q] add|edit|defer|log
++tdl [\-q] add|edit|defer|log
+ .br
+-tdl [-q] list|done|undo|report
++tdl [\-q] list|done|undo|report
+ .br
+-tdl [-q] remove|above|below|into|clone|copyto
++tdl [\-q] remove|above|below|into|clone|copyto
+ .br
+-tdl [-q] postpone|ignore|open
++tdl [\-q] postpone|ignore|open
+ .br
+-tdl [-q] which|version|help
++tdl [\-q] which|version|help
+ .br
+-tdla [-q]
++tdla [\-q]
+ .br
+-tdll [-q]
++tdll [\-q]
+ .br
+-tdld [-q]
++tdld [\-q]
+ .br
+-tdlg [-q]
++tdlg [\-q]
+
+ .SH DESCRIPTION
+ A program for managing a to-do list.
+@@ -68,9 +68,9 @@
+ modified database back to the disk. Only use it if you want to discard
+ all changes made in this tdl run.
+
+-.pp
++.PP
+ All forms may take
+-.I -q
++.I \-q
+ as the first command line argument. Currently, this suppresses the warning
+ message if no existing database can be found. The intended use is for using
+ .B tdll
+@@ -104,7 +104,7 @@
+ appear as the last children of the parent node afterwards.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl add
+ .I [@datespec]
+@@ -156,7 +156,7 @@
+ environment is set, in which case this specifies the path to use).
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl below
+ .I index_to_insert_below
+@@ -173,7 +173,7 @@
+ appear as the first children of the parent node afterwards.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl clone
+ .I index_to_clone ...
+@@ -185,7 +185,7 @@
+ to change its text.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl copyto
+ .I new_parent_index
+@@ -197,7 +197,7 @@
+ children of an existing entry, rather than making them new top level entries.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl create
+ .PP
+@@ -217,7 +217,7 @@
+ TDL_DATABASE.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl defer
+ .I [@datespec]
+@@ -233,7 +233,7 @@
+ .P
+ which defers entries 1, 2.1 and all its children, and 5 until the following Friday.
+ To list deferred entries, use
+-.I list -p
++.I list \-p
+ , to defer entries indefinitely, see
+ .I postpone
+ command.
+@@ -242,7 +242,7 @@
+ command.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl done
+ .I @datespec
+@@ -278,7 +278,7 @@
+ section later in this page.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl edit
+ .I index_to_change
+@@ -294,7 +294,7 @@
+ command.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B exit
+ .PP
+@@ -308,7 +308,7 @@
+ command, which loses all updates made during the current tdl run.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl export
+ .I filename
+@@ -322,14 +322,14 @@
+ the original database.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl help
+ .PP
+ This command displays a summary of use of each of the commands.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl ignore
+ .I index_to_ignore ...
+@@ -353,7 +353,7 @@
+ it
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl import
+ .I filename
+@@ -367,7 +367,7 @@
+ wanted to merge their entries to form one combo database.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl into
+ .I new_parent_index
+@@ -381,23 +381,23 @@
+ argument has ".0" appended to it.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl list
+-.I [-v]
+-.I [-a]
+-.I [-p]
+-.I [-m]
+-.I [-1...9]
++.I [\-v]
++.I [\-a]
++.I [\-p]
++.I [\-m]
++.I [\-1...9]
+ .I [<min-priority>]
+ .I [<parent_index>|<search_conditions>...]
+ .br
+ .B tdll
+-.I [-v]
+-.I [-a]
+-.I [-p]
+-.I [-m]
+-.I [-1...9]
++.I [\-v]
++.I [\-a]
++.I [\-p]
++.I [\-m]
++.I [\-1...9]
+ .I [<min-priority>]
+ .I [<parent_index>|<search_conditions...]
+ .PP
+@@ -410,13 +410,13 @@
+ .B done
+ and which don't have start times deferred into the future are shown. If you
+ want to display all entries, include the
+-.B -a
++.B \-a
+ option (which means 'all'). If you want to display the dates and times when
+ the entries were added and/or done, include the
+-.B -v
++.B \-v
+ option (which means 'verbose').
+ The
+-.B -p
++.B \-p
+ option stands for postponed. It means that tasks which are 'deferred' or 'postponed'
+ are shown as well as open tasks.
+ .PP
+@@ -431,14 +431,14 @@
+ top node of each part of the database you want to show. So if your database
+ contains entries with indices 1, 2, 2.1, 2.2, 2.2.1, 3 and 4, the command
+ .PP
+-tdl list -a 2
++tdl list \-a 2
+ .PP
+ will show all entries 2, 2.1, 2.2 and 2.2.1, whether or not they are completed.
+ .PP
+ Also by default, all entries in the database, at any depth, will be shown. If
+ you only wish to show 'top-level' entries, for example, you can use
+ .PP
+-tdl list -1
++tdl list \-1
+ .PP
+ This lists level-1 entries. Any level-1 entry with hidden child entries
+ underneath it will show a summary of how many such children there are. For
+@@ -454,11 +454,11 @@
+ the normal 'negative index' method can't be used to specify an entry a certain
+ distance from the end of the list. If you want to do this, use a syntax like
+ .PP
+-tdl list -- -1
++tdl list \-\- \-1
+ .PP
+ to show the last index in the array, or
+ .PP
+-tdl list -2 -- -3 -2 -1
++tdl list \-2 \-\- \-3 \-2 \-1
+ .PP
+ to show level-1 and level-2 entries within the last 3 level-1 entries in the
+ list.
+@@ -489,7 +489,7 @@
+ approximate matches with keys up to 31 characters.
+ .PP
+ By default, the listing is produced with colour highlighting. The
+-.B -m
++.B \-m
+ option can be used to produce a monochrome listing instead. Alternatively, the
+ .B TDL_LIST_MONOCHROME
+ enviroment variable can be set (to any value) to achieve the same effect.
+@@ -512,7 +512,7 @@
+ .TE
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl log
+ .br
+@@ -530,7 +530,7 @@
+ command.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B narrow
+ .I new_root_index
+@@ -562,7 +562,7 @@
+ wouldn't make much sense).
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl open
+ .I index_to_reopen[...] ...
+@@ -573,7 +573,7 @@
+ current time.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl postpone
+ .I index_to_postpone[...] ...
+@@ -586,7 +586,7 @@
+ command.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl pri
+ .I new_priority
+@@ -602,7 +602,7 @@
+ command.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl purge
+ .I since_epoch
+@@ -626,7 +626,7 @@
+ descendents. The default is to purge the entire database.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B quit
+ .PP
+@@ -642,7 +642,7 @@
+ The main use for the quit command would be to avoid damaging the database if a serious error had been made.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl remove
+ .I index_to_remove ...
+@@ -659,7 +659,7 @@
+ descendents. This provides a quick way to remove a whole sub-tree of tasks.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl report
+ .I start_time
+@@ -688,12 +688,12 @@
+ will list all tasks completed between 2 and 1 weeks ago.
+ .PP
+ Where a child entry has been completed in the reporting period, but its parent
+-has not been completed, the parent text in the report will be surrounded by
+-'[[' and ']]'. To give one example, this will happen if the parent has other
++has not been completed, the parent text in the report will be surrounded by '[['
++and ']]'. To give one example, this will happen if the parent has other
+ child entries that haven't been completed yet.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B revert
+ .PP
+@@ -706,7 +706,7 @@
+ The revert command does not take any arguments.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B save
+ .PP
+@@ -728,7 +728,7 @@
+ The save command does not take any arguments.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl undo
+ .I index_of_entry_to_undo ...
+@@ -742,7 +742,7 @@
+ descendents. This provides a quick way to re-open a whole sub-tree of tasks.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl usage
+ .PP
+@@ -751,21 +751,21 @@
+ (q.v.)
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl version
+ .PP
+ Show the version number of the software.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B tdl which
+ .PP
+ Show the filename of the database that tdl accesses in the current context.
+ .P
+ .ce 1
+---ooOOoo--
++\-\-ooOOoo-\-
+ .PP
+ .B widen
+ .I n_level
+@@ -831,30 +831,30 @@
+ .TS
+ tab(&);
+ l l.
+--1h & exactly 1 hour ago
+--2d & exactly 2 days ago
++\-1h & exactly 1 hour ago
++\-2d & exactly 2 days ago
+ +1w & exactly 1 week in the future
+ +1m & exactly 1 month (30 days) in the future
+ +2y & exactly 2 years in the future
+--1d-0815 & 08:15am yesterday
++\-1d-0815 & 08:15am yesterday
+ +1d-08 & 8am tomorrow
+ +1w-08 & 8am on the same day as today next week
+ +6h-08 & 8am on the day containing the time 6 hours ahead of now
+-\.-08 & 8am today
+-\.-20 & 8pm today
++\.\-08 & 8am today
++\.\-20 & 8pm today
+ 20011020 & absolute : 12 noon on 20th October 2001
+ 011020 & absolute : 12 noon on 20th October 2001 (current century)
+ 1020 & absolute : 12 noon on 20th October 2001 (current century and year)
+ 20 & absolute : 12 noon on 20th October 2001 (current century, year and month)
+-20011020-081500 & absolute : 08:15am on 20th October 2001
+-20011020-0815 & absolute : 08:15am on 20th October 2001 (seconds=0)
+-20011020-08 & absolute : 08:00am on 20th October 2001 (minutes=seconds=0)
+-011020-08 & absolute : 08:00am on 20th October 2001 (minutes=seconds=0, current century)
++20011020\-081500 & absolute : 08:15am on 20th October 2001
++20011020\-0815 & absolute : 08:15am on 20th October 2001 (seconds=0)
++20011020\-08 & absolute : 08:00am on 20th October 2001 (minutes=seconds=0)
++011020\-08 & absolute : 08:00am on 20th October 2001 (minutes=seconds=0, current century)
+ etc & (see below)
+--sun & 12 noon on the previous Sunday
++\-sun & 12 noon on the previous Sunday
+ +sat & 12 noon on the following Saturday
+ +sat-08 & 8am on the following Saturday
+--tue-0815 & 08:15am on the previous Tuesday
++\-tue-0815 & 08:15am on the previous Tuesday
+ etc & (see below)
+ .TE
+ .PP
+@@ -876,7 +876,7 @@
+ of the more uses of this mode are rather far-fetched.
+ .PP
+ For the weekday and relative formats, the sign is actually optional. The
+-default sign (implying past (-) or future (+)) will then be assumed depending on
++default sign (implying past (\-) or future (+)) will then be assumed depending on
+ the command as shown below:
+
+ .PP
+@@ -886,9 +886,9 @@
+ Command & Default & Reason
+ _
+ add & + & Add entries with deferred start times
+-done & - & Entries have been completed at some time in the past
+-report & - & Reporting on earlier completed tasks not future ones
+-purge & - & Tasks won't be completed in the future, so no need to purge future ones
++done & \- & Entries have been completed at some time in the past
++report & \- & Reporting on earlier completed tasks not future ones
++purge & \- & Tasks won't be completed in the future, so no need to purge future ones
+ .TE
+
+ .SH HOMEPAGE
+@@ -943,16 +943,7 @@
+ .IP
+ cd project1
+ .br
+-ln -s ../project2/.tdldb .
++ln \-s ../project2/.tdldb .
+
+ .SH BUGS
+ Please report them to the author.
+-
+-.SH SEE ALSO
+-The full documentation for tdl is maintained as a Texinfo manual. If the info and tdl
+-programs are properly installed at your site, the command
+-.IP
+-info tdl
+-.PP
+-should give you access to the complete manual.
+-
diff --git a/app-misc/tdl/metadata.xml b/app-misc/tdl/metadata.xml
new file mode 100644
index 000000000000..fbad613d45e5
--- /dev/null
+++ b/app-misc/tdl/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>shell-tools@gentoo.org</email>
+ <name>Gentoo Shell Tools Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ tdl is a command-line application for managing a list of outstanding
+ tasks that you have to do. It can organise tasks in a hierarchy, produce
+ weekly reports of completed tasks and so on.
+ </longdescription>
+</pkgmetadata>
diff --git a/app-misc/tdl/tdl-1.5.2-r2.ebuild b/app-misc/tdl/tdl-1.5.2-r2.ebuild
new file mode 100644
index 000000000000..3b105616d7c0
--- /dev/null
+++ b/app-misc/tdl/tdl-1.5.2-r2.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Command line To Do List manager"
+HOMEPAGE="http://www.rc0.org.uk/tdl/"
+SRC_URI="
+ http://www.rpcurnow.force9.co.uk/tdl/${P}.tar.gz
+ https://dev.gentoo.org/~jlec/distfiles/${PN}-screenshot.png.tar"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="doc readline"
+
+RDEPEND="
+ sys-libs/ncurses
+ sys-libs/readline"
+DEPEND="${RDEPEND}
+ sys-apps/sed
+ sys-apps/texinfo
+ doc? ( virtual/texi2dvi )"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PV}-ldflags.patch \
+ "${FILESDIR}"/${P}-list.c.patch \
+ "${FILESDIR}"/${P}-main.c.patch \
+ "${FILESDIR}"/${P}-man.patch
+
+ tc-export CC
+}
+
+src_configure() {
+ local myconf="--prefix=${EPREFIX}/usr"
+
+ if ! use readline; then
+ myconf="${myconf} --without-readline"
+
+ sed -i 's#\($(LIB_READLINE)\)#\1 -lncurses##g' "${S}"/Makefile.in || die
+ fi
+ sed -i 's#-ltermcap#-lncurses#g' "${S}"/configure || die
+
+ # XXX: do not replace with econf.
+ "${S}"/configure ${myconf} || die "configure failed, sorry!"
+}
+
+src_compile() {
+ emake all tdl.info tdl.html tdl.txt
+ use doc && emake tdl.dvi tdl.ps tdl.pdf
+}
+
+src_install() {
+ local i
+
+ dodoc README NEWS tdl.txt "${WORKDIR}"/screenshot.png
+ doinfo tdl.info
+ dohtml tdl.html
+
+ dobin tdl
+ doman tdl.1
+
+ for i in tdl{a,l,d,g}
+ do
+ dosym tdl /usr/bin/${i}
+ dosym tdl.1 /usr/share/man/man1/${i}.1
+ done
+
+ if use doc; then
+ dodoc tdl.dvi tdl.ps tdl.pdf
+ fi
+}