pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
todotxt: Rename to todotxt-git
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Mon Oct 3 01:29:50 2016 +0200
Changeset: bb55c7aeb9a71140b5df38ab7665f2342e88c3ad
Modified Files:
Makefile
Added Files:
todotxt-git/DESCR
todotxt-git/MESSAGE
todotxt-git/Makefile
todotxt-git/PLIST
todotxt-git/distinfo
todotxt-git/patches/patch-todo.cfg
todotxt-git/patches/patch-todo.sh
Removed Files:
todotxt/DESCR
todotxt/MESSAGE
todotxt/Makefile
todotxt/PLIST
todotxt/distinfo
todotxt/patches/patch-todo.cfg
todotxt/patches/patch-todo.sh
Log Message:
todotxt: Rename to todotxt-git
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=bb55c7aeb9a71140b5df38ab7665f2342e88c3ad
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 2 +-
todotxt-git/DESCR | 1 +
todotxt-git/MESSAGE | 12 ++++
todotxt-git/Makefile | 46 ++++++++++++
todotxt-git/PLIST | 5 ++
todotxt-git/distinfo | 4 ++
todotxt-git/patches/patch-todo.cfg | 15 ++++
todotxt-git/patches/patch-todo.sh | 143 +++++++++++++++++++++++++++++++++++++
todotxt/DESCR | 1 -
todotxt/MESSAGE | 12 ----
todotxt/Makefile | 46 ------------
todotxt/PLIST | 5 --
todotxt/distinfo | 4 --
todotxt/patches/patch-todo.cfg | 15 ----
todotxt/patches/patch-todo.sh | 143 -------------------------------------
15 files changed, 227 insertions(+), 227 deletions(-)
diffs:
diff --git a/Makefile b/Makefile
index d6b7d53..45d0062 100644
--- a/Makefile
+++ b/Makefile
@@ -4080,7 +4080,7 @@ SUBDIR+= tmuni-ttf
SUBDIR+= tmva
SUBDIR+= tmw
SUBDIR+= tnt
-SUBDIR+= todotxt
+SUBDIR+= todotxt-git
SUBDIR+= tome
SUBDIR+= tome2
SUBDIR+= tophat
diff --git a/todotxt-git/DESCR b/todotxt-git/DESCR
new file mode 100644
index 0000000..b58f997
--- /dev/null
+++ b/todotxt-git/DESCR
@@ -0,0 +1 @@
+A simple and extensible shell script for managing your todo.txt file.
diff --git a/todotxt-git/MESSAGE b/todotxt-git/MESSAGE
new file mode 100644
index 0000000..41fb1bd
--- /dev/null
+++ b/todotxt-git/MESSAGE
@@ -0,0 +1,12 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.3 2014/05/21 14:06:31 ttys Exp $
+
+First steps before using tototxt.
+
+- Create configuration directory target:
+ $ mkdir ~/.todo
+
+- Copy configuration file:
+ $ cp /usr/pkg/share/examples/todotxt/todo.cfg ~/.todo/config
+
+===========================================================================
diff --git a/todotxt-git/Makefile b/todotxt-git/Makefile
new file mode 100644
index 0000000..1607aed
--- /dev/null
+++ b/todotxt-git/Makefile
@@ -0,0 +1,46 @@
+# $NetBSD: Makefile,v 1.4 2014/05/21 14:06:31 ttys Exp $
+
+PKGNAME= todotxt-2.10
+CATEGORIES= misc
+MASTER_SITES= https://github.com/ginatrapani/todo.txt-cli
+
+COMMENT= Simple and extensible shell script for managing your todo.txt file
+LICENSE= gnu-gpl-v3
+
+GIT_REPOSITORIES= todo.txt-cli
+GIT_REPO.todo.txt-cli= git://github.com/ginatrapani/todo.txt-cli.git
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= http://todotxt.com/
+
+PKG_DESTDIR_SUPPORT= user-destdir
+DEPENDS= bash>=4.3:../../shells/bash
+DEPENDS+= bash-completion>=2.1:../../shells/bash-completion
+
+WRKSRC= ${WRKDIR}/todo.txt-cli
+
+SUBST_CLASSES+= prefix
+SUBST_STAGE.prefix= pre-configure
+SUBST_FILES.prefix+= todo.sh
+SUBST_SED.prefix+= -e "s,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},"
+
+USE_TOOLS+= bash
+REPLACE_BASH= todo.sh
+
+USE_LANGUAGES= # none
+
+NO_BUILD= yes
+
+EGDIR= share/examples/todotxt
+DOCDIR= share/doc/todotxt
+
+INSTALLATION_DIRS= bin ${DOCDIR} ${EGDIR}
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/todo.sh ${DESTDIR}${PREFIX}/bin
+ ${INSTALL_DATA} ${WRKSRC}/todo.cfg ${DESTDIR}${PREFIX}/${EGDIR}
+ ${INSTALL_DATA} ${WRKSRC}/todo_completion ${DESTDIR}${PREFIX}/${EGDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README.textile ${DESTDIR}${PREFIX}/${DOCDIR}
+
+.include "../../wip/mk/git-package.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/todotxt-git/PLIST b/todotxt-git/PLIST
new file mode 100644
index 0000000..2e91161
--- /dev/null
+++ b/todotxt-git/PLIST
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.3 2014/05/21 14:06:31 ttys Exp $
+bin/todo.sh
+share/doc/todotxt/README.textile
+share/examples/todotxt/todo.cfg
+share/examples/todotxt/todo_completion
diff --git a/todotxt-git/distinfo b/todotxt-git/distinfo
new file mode 100644
index 0000000..4e1078a
--- /dev/null
+++ b/todotxt-git/distinfo
@@ -0,0 +1,4 @@
+$NetBSD: distinfo,v 1.4 2014/05/21 14:06:31 ttys Exp $
+
+SHA1 (patch-todo.cfg) = 164e266bb2036f2343091968a6a3f116bc27add2
+SHA1 (patch-todo.sh) = d4cd017af5abaec5f3405e9f9f006e98f401bbbf
diff --git a/todotxt-git/patches/patch-todo.cfg b/todotxt-git/patches/patch-todo.cfg
new file mode 100644
index 0000000..fd4ac4a
--- /dev/null
+++ b/todotxt-git/patches/patch-todo.cfg
@@ -0,0 +1,15 @@
+$NetBSD: patch-todo.cfg,v 1.4 2014/05/21 14:06:31 ttys Exp $
+
+Change the $HOME directory.
+
+--- todo.cfg.orig 2014-05-13 12:31:25.000000000 +0000
++++ todo.cfg
+@@ -2,7 +2,7 @@
+
+ # Your todo.txt directory
+ #export TODO_DIR="/Users/gina/Documents/todo"
+-export TODO_DIR=$(dirname "$0")
++export TODO_DIR="${HOME}/.todo"
+
+ # Your todo/done/report.txt locations
+ export TODO_FILE="$TODO_DIR/todo.txt"
diff --git a/todotxt-git/patches/patch-todo.sh b/todotxt-git/patches/patch-todo.sh
new file mode 100644
index 0000000..ab9d40f
--- /dev/null
+++ b/todotxt-git/patches/patch-todo.sh
@@ -0,0 +1,143 @@
+$NetBSD: patch-todo.sh,v 1.4 2014/05/21 14:06:31 ttys Exp $
+
+Use temp file for "in-place" option not available in BSD/sed
+
+--- todo.sh.orig 2014-05-21 12:49:20.000000000 +0000
++++ todo.sh
+@@ -26,6 +26,9 @@ TODO_SH=$(basename "$0")
+ TODO_FULL_SH="$0"
+ export TODO_SH TODO_FULL_SH
+
++# Create temp file for "in-place" option not available in BSD/sed
++TODO_TMP="/tmp/.todo.tmp"
++
+ oneline_usage="$TODO_SH [-fhpantvV] [-d todo_config] action [task_number] [task_description]"
+
+ usage()
+@@ -449,7 +452,8 @@ replaceOrPrepend()
+ # change (replace/prepend) and re-insert the existing priority and prepended
+ # date again.
+ cleaninput "for sed"
+- sed -i.bak -e "$item s/^${priority}${prepdate}//" -e "$item s|^.*|${priority}${prepdate}${input}${backref}|" "$TODO_FILE"
++ sed -e "$item s/^${priority}${prepdate}//" -e "$item s|^.*|${priority}${prepdate}${input}${backref}|" "$TODO_FILE" \
++ > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
+ if [ $TODOTXT_VERBOSE -gt 0 ]; then
+ getNewtodo "$item"
+ case "$action" in
+@@ -594,7 +598,7 @@ TODOTXT_DEFAULT_ACTION=${TODOTXT_DEFAULT
+ TODOTXT_SORT_COMMAND=${TODOTXT_SORT_COMMAND:-env LC_COLLATE=C sort -f -k2}
+ TODOTXT_DISABLE_FILTER=${TODOTXT_DISABLE_FILTER:-}
+ TODOTXT_FINAL_FILTER=${TODOTXT_FINAL_FILTER:-cat}
+-TODOTXT_GLOBAL_CFG_FILE=${TODOTXT_GLOBAL_CFG_FILE:-/etc/todo/config}
++TODOTXT_GLOBAL_CFG_FILE=${TODOTXT_GLOBAL_CFG_FILE:-@PKG_SYSCONFDIR@/todo/config}
+
+ # Export all TODOTXT_* variables
+ export ${!TODOTXT_@}
+@@ -1052,7 +1056,7 @@ case $action in
+ esac
+ cleaninput "for sed"
+
+- if sed -i.bak $item" s|^.*|&${appendspace}${input}|" "$TODO_FILE"; then
++ if sed $item" s|^.*|&${appendspace}${input}|" "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"; then
+ if [ $TODOTXT_VERBOSE -gt 0 ]; then
+ getNewtodo "$item"
+ echo "$item $newtodo"
+@@ -1064,10 +1068,10 @@ case $action in
+
+ "archive" )
+ # defragment blank lines
+- sed -i.bak -e '/./!d' "$TODO_FILE"
++ sed -e '/./!d' "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
+ [ $TODOTXT_VERBOSE -gt 0 ] && grep "^x " "$TODO_FILE"
+ grep "^x " "$TODO_FILE" >> "$DONE_FILE"
+- sed -i.bak '/^x /d' "$TODO_FILE"
++ sed '/^x /d' "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
+ if [ $TODOTXT_VERBOSE -gt 0 ]; then
+ echo "TODO: $TODO_FILE archived."
+ fi
+@@ -1089,10 +1093,10 @@ case $action in
+ if [ "$ANSWER" = "y" ]; then
+ if [ $TODOTXT_PRESERVE_LINE_NUMBERS = 0 ]; then
+ # delete line (changes line numbers)
+- sed -i.bak -e $item"s/^.*//" -e '/./!d' "$TODO_FILE"
++ sed -e $item"s/^.*//" -e '/./!d' "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
+ else
+ # leave blank line behind (preserves line numbers)
+- sed -i.bak -e $item"s/^.*//" "$TODO_FILE"
++ sed -e $item"s/^.*//" "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
+ fi
+ if [ $TODOTXT_VERBOSE -gt 0 ]; then
+ echo "$item $todo"
+@@ -1102,13 +1106,13 @@ case $action in
+ echo "TODO: No tasks were deleted."
+ fi
+ else
+- sed -i.bak \
++ sed \
+ -e $item"s/^\((.) \)\{0,1\} *$3 */\1/g" \
+ -e $item"s/ *$3 *\$//g" \
+ -e $item"s/ *$3 */ /g" \
+ -e $item"s/ *$3 */ /g" \
+ -e $item"s/$3//g" \
+- "$TODO_FILE"
++ "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
+ getNewtodo "$item"
+ if [ "$todo" = "$newtodo" ]; then
+ [ $TODOTXT_VERBOSE -gt 0 ] && echo "$item $todo"
+@@ -1133,7 +1137,7 @@ case $action in
+ getTodo "$item"
+
+ if [[ "$todo" = \(?\)\ * ]]; then
+- sed -i.bak -e $item"s/^(.) //" "$TODO_FILE"
++ sed -e $item"s/^(.) //" "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
+ if [ $TODOTXT_VERBOSE -gt 0 ]; then
+ getNewtodo "$item"
+ echo "$item $newtodo"
+@@ -1160,8 +1164,8 @@ case $action in
+ if [ "${todo:0:2}" != "x " ]; then
+ now=$(date '+%Y-%m-%d')
+ # remove priority once item is done
+- sed -i.bak $item"s/^(.) //" "$TODO_FILE"
+- sed -i.bak $item"s|^|x $now |" "$TODO_FILE"
++ sed $item"s/^(.) //" "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
++ sed $item"s|^|x $now |" "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
+ if [ $TODOTXT_VERBOSE -gt 0 ]; then
+ getNewtodo "$item"
+ echo "$item $newtodo"
+@@ -1285,10 +1289,10 @@ case $action in
+ if [ "$ANSWER" = "y" ]; then
+ if [ $TODOTXT_PRESERVE_LINE_NUMBERS = 0 ]; then
+ # delete line (changes line numbers)
+- sed -i.bak -e $item"s/^.*//" -e '/./!d' "$src"
++ sed -e $item"s/^.*//" -e '/./!d' "$src" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
+ else
+ # leave blank line behind (preserves line numbers)
+- sed -i.bak -e $item"s/^.*//" "$src"
++ sed -e $item"s/^.*//" "$src" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
+ fi
+ echo "$todo" >> "$dest"
+
+@@ -1323,7 +1327,7 @@ note: PRIORITY must be anywhere from A t
+ fi
+
+ if [ "$oldpri" != "$newpri" ]; then
+- sed -i.bak -e $item"s/^(.) //" -e $item"s/^/($newpri) /" "$TODO_FILE"
++ sed -e $item"s/^(.) //" -e $item"s/^/($newpri) /" "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
+ fi
+ if [ $TODOTXT_VERBOSE -gt 0 ]; then
+ getNewtodo "$item"
+@@ -1396,12 +1400,12 @@ note: PRIORITY must be anywhere from A t
+ # h; - replace the hold space with the expanded pattern space
+ # P; - print up to the first newline (that is, the input line)
+ # b - end processing of the current line
+- sed -i.bak -n \
++ sed -n \
+ -e 'G; s/\n/&&/; /^\([^\n]*\n\).*\n\1/b dedup' \
+ -e 's/\n//; h; P; b' \
+ -e ':dedup' \
+ -e "$deduplicateSedCommand" \
+- "$TODO_FILE"
++ "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
+
+ newTaskNum=$( sed -e '/./!d' "$TODO_FILE" | sed -n '$ =' )
+ deduplicateNum=$(( originalTaskNum - newTaskNum ))
diff --git a/todotxt/DESCR b/todotxt/DESCR
deleted file mode 100644
index b58f997..0000000
--- a/todotxt/DESCR
+++ /dev/null
@@ -1 +0,0 @@
-A simple and extensible shell script for managing your todo.txt file.
diff --git a/todotxt/MESSAGE b/todotxt/MESSAGE
deleted file mode 100644
index 41fb1bd..0000000
--- a/todotxt/MESSAGE
+++ /dev/null
@@ -1,12 +0,0 @@
-===========================================================================
-$NetBSD: MESSAGE,v 1.3 2014/05/21 14:06:31 ttys Exp $
-
-First steps before using tototxt.
-
-- Create configuration directory target:
- $ mkdir ~/.todo
-
-- Copy configuration file:
- $ cp /usr/pkg/share/examples/todotxt/todo.cfg ~/.todo/config
-
-===========================================================================
diff --git a/todotxt/Makefile b/todotxt/Makefile
deleted file mode 100644
index 1607aed..0000000
--- a/todotxt/Makefile
+++ /dev/null
@@ -1,46 +0,0 @@
-# $NetBSD: Makefile,v 1.4 2014/05/21 14:06:31 ttys Exp $
-
-PKGNAME= todotxt-2.10
-CATEGORIES= misc
-MASTER_SITES= https://github.com/ginatrapani/todo.txt-cli
-
-COMMENT= Simple and extensible shell script for managing your todo.txt file
-LICENSE= gnu-gpl-v3
-
-GIT_REPOSITORIES= todo.txt-cli
-GIT_REPO.todo.txt-cli= git://github.com/ginatrapani/todo.txt-cli.git
-
-MAINTAINER= pkgsrc-users%NetBSD.org@localhost
-HOMEPAGE= http://todotxt.com/
-
-PKG_DESTDIR_SUPPORT= user-destdir
-DEPENDS= bash>=4.3:../../shells/bash
-DEPENDS+= bash-completion>=2.1:../../shells/bash-completion
-
-WRKSRC= ${WRKDIR}/todo.txt-cli
-
-SUBST_CLASSES+= prefix
-SUBST_STAGE.prefix= pre-configure
-SUBST_FILES.prefix+= todo.sh
-SUBST_SED.prefix+= -e "s,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},"
-
-USE_TOOLS+= bash
-REPLACE_BASH= todo.sh
-
-USE_LANGUAGES= # none
-
-NO_BUILD= yes
-
-EGDIR= share/examples/todotxt
-DOCDIR= share/doc/todotxt
-
-INSTALLATION_DIRS= bin ${DOCDIR} ${EGDIR}
-
-do-install:
- ${INSTALL_SCRIPT} ${WRKSRC}/todo.sh ${DESTDIR}${PREFIX}/bin
- ${INSTALL_DATA} ${WRKSRC}/todo.cfg ${DESTDIR}${PREFIX}/${EGDIR}
- ${INSTALL_DATA} ${WRKSRC}/todo_completion ${DESTDIR}${PREFIX}/${EGDIR}
- ${INSTALL_DATA} ${WRKSRC}/README.textile ${DESTDIR}${PREFIX}/${DOCDIR}
-
-.include "../../wip/mk/git-package.mk"
-.include "../../mk/bsd.pkg.mk"
diff --git a/todotxt/PLIST b/todotxt/PLIST
deleted file mode 100644
index 2e91161..0000000
--- a/todotxt/PLIST
+++ /dev/null
@@ -1,5 +0,0 @@
-@comment $NetBSD: PLIST,v 1.3 2014/05/21 14:06:31 ttys Exp $
-bin/todo.sh
-share/doc/todotxt/README.textile
-share/examples/todotxt/todo.cfg
-share/examples/todotxt/todo_completion
diff --git a/todotxt/distinfo b/todotxt/distinfo
deleted file mode 100644
index 4e1078a..0000000
--- a/todotxt/distinfo
+++ /dev/null
@@ -1,4 +0,0 @@
-$NetBSD: distinfo,v 1.4 2014/05/21 14:06:31 ttys Exp $
-
-SHA1 (patch-todo.cfg) = 164e266bb2036f2343091968a6a3f116bc27add2
-SHA1 (patch-todo.sh) = d4cd017af5abaec5f3405e9f9f006e98f401bbbf
diff --git a/todotxt/patches/patch-todo.cfg b/todotxt/patches/patch-todo.cfg
deleted file mode 100644
index fd4ac4a..0000000
--- a/todotxt/patches/patch-todo.cfg
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-todo.cfg,v 1.4 2014/05/21 14:06:31 ttys Exp $
-
-Change the $HOME directory.
-
---- todo.cfg.orig 2014-05-13 12:31:25.000000000 +0000
-+++ todo.cfg
-@@ -2,7 +2,7 @@
-
- # Your todo.txt directory
- #export TODO_DIR="/Users/gina/Documents/todo"
--export TODO_DIR=$(dirname "$0")
-+export TODO_DIR="${HOME}/.todo"
-
- # Your todo/done/report.txt locations
- export TODO_FILE="$TODO_DIR/todo.txt"
diff --git a/todotxt/patches/patch-todo.sh b/todotxt/patches/patch-todo.sh
deleted file mode 100644
index ab9d40f..0000000
--- a/todotxt/patches/patch-todo.sh
+++ /dev/null
@@ -1,143 +0,0 @@
-$NetBSD: patch-todo.sh,v 1.4 2014/05/21 14:06:31 ttys Exp $
-
-Use temp file for "in-place" option not available in BSD/sed
-
---- todo.sh.orig 2014-05-21 12:49:20.000000000 +0000
-+++ todo.sh
-@@ -26,6 +26,9 @@ TODO_SH=$(basename "$0")
- TODO_FULL_SH="$0"
- export TODO_SH TODO_FULL_SH
-
-+# Create temp file for "in-place" option not available in BSD/sed
-+TODO_TMP="/tmp/.todo.tmp"
-+
- oneline_usage="$TODO_SH [-fhpantvV] [-d todo_config] action [task_number] [task_description]"
-
- usage()
-@@ -449,7 +452,8 @@ replaceOrPrepend()
- # change (replace/prepend) and re-insert the existing priority and prepended
- # date again.
- cleaninput "for sed"
-- sed -i.bak -e "$item s/^${priority}${prepdate}//" -e "$item s|^.*|${priority}${prepdate}${input}${backref}|" "$TODO_FILE"
-+ sed -e "$item s/^${priority}${prepdate}//" -e "$item s|^.*|${priority}${prepdate}${input}${backref}|" "$TODO_FILE" \
-+ > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
- if [ $TODOTXT_VERBOSE -gt 0 ]; then
- getNewtodo "$item"
- case "$action" in
-@@ -594,7 +598,7 @@ TODOTXT_DEFAULT_ACTION=${TODOTXT_DEFAULT
- TODOTXT_SORT_COMMAND=${TODOTXT_SORT_COMMAND:-env LC_COLLATE=C sort -f -k2}
- TODOTXT_DISABLE_FILTER=${TODOTXT_DISABLE_FILTER:-}
- TODOTXT_FINAL_FILTER=${TODOTXT_FINAL_FILTER:-cat}
--TODOTXT_GLOBAL_CFG_FILE=${TODOTXT_GLOBAL_CFG_FILE:-/etc/todo/config}
-+TODOTXT_GLOBAL_CFG_FILE=${TODOTXT_GLOBAL_CFG_FILE:-@PKG_SYSCONFDIR@/todo/config}
-
- # Export all TODOTXT_* variables
- export ${!TODOTXT_@}
-@@ -1052,7 +1056,7 @@ case $action in
- esac
- cleaninput "for sed"
-
-- if sed -i.bak $item" s|^.*|&${appendspace}${input}|" "$TODO_FILE"; then
-+ if sed $item" s|^.*|&${appendspace}${input}|" "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"; then
- if [ $TODOTXT_VERBOSE -gt 0 ]; then
- getNewtodo "$item"
- echo "$item $newtodo"
-@@ -1064,10 +1068,10 @@ case $action in
-
- "archive" )
- # defragment blank lines
-- sed -i.bak -e '/./!d' "$TODO_FILE"
-+ sed -e '/./!d' "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
- [ $TODOTXT_VERBOSE -gt 0 ] && grep "^x " "$TODO_FILE"
- grep "^x " "$TODO_FILE" >> "$DONE_FILE"
-- sed -i.bak '/^x /d' "$TODO_FILE"
-+ sed '/^x /d' "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
- if [ $TODOTXT_VERBOSE -gt 0 ]; then
- echo "TODO: $TODO_FILE archived."
- fi
-@@ -1089,10 +1093,10 @@ case $action in
- if [ "$ANSWER" = "y" ]; then
- if [ $TODOTXT_PRESERVE_LINE_NUMBERS = 0 ]; then
- # delete line (changes line numbers)
-- sed -i.bak -e $item"s/^.*//" -e '/./!d' "$TODO_FILE"
-+ sed -e $item"s/^.*//" -e '/./!d' "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
- else
- # leave blank line behind (preserves line numbers)
-- sed -i.bak -e $item"s/^.*//" "$TODO_FILE"
-+ sed -e $item"s/^.*//" "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
- fi
- if [ $TODOTXT_VERBOSE -gt 0 ]; then
- echo "$item $todo"
-@@ -1102,13 +1106,13 @@ case $action in
- echo "TODO: No tasks were deleted."
- fi
- else
-- sed -i.bak \
-+ sed \
- -e $item"s/^\((.) \)\{0,1\} *$3 */\1/g" \
- -e $item"s/ *$3 *\$//g" \
- -e $item"s/ *$3 */ /g" \
- -e $item"s/ *$3 */ /g" \
- -e $item"s/$3//g" \
-- "$TODO_FILE"
-+ "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
- getNewtodo "$item"
- if [ "$todo" = "$newtodo" ]; then
- [ $TODOTXT_VERBOSE -gt 0 ] && echo "$item $todo"
-@@ -1133,7 +1137,7 @@ case $action in
- getTodo "$item"
-
- if [[ "$todo" = \(?\)\ * ]]; then
-- sed -i.bak -e $item"s/^(.) //" "$TODO_FILE"
-+ sed -e $item"s/^(.) //" "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
- if [ $TODOTXT_VERBOSE -gt 0 ]; then
- getNewtodo "$item"
- echo "$item $newtodo"
-@@ -1160,8 +1164,8 @@ case $action in
- if [ "${todo:0:2}" != "x " ]; then
- now=$(date '+%Y-%m-%d')
- # remove priority once item is done
-- sed -i.bak $item"s/^(.) //" "$TODO_FILE"
-- sed -i.bak $item"s|^|x $now |" "$TODO_FILE"
-+ sed $item"s/^(.) //" "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
-+ sed $item"s|^|x $now |" "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
- if [ $TODOTXT_VERBOSE -gt 0 ]; then
- getNewtodo "$item"
- echo "$item $newtodo"
-@@ -1285,10 +1289,10 @@ case $action in
- if [ "$ANSWER" = "y" ]; then
- if [ $TODOTXT_PRESERVE_LINE_NUMBERS = 0 ]; then
- # delete line (changes line numbers)
-- sed -i.bak -e $item"s/^.*//" -e '/./!d' "$src"
-+ sed -e $item"s/^.*//" -e '/./!d' "$src" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
- else
- # leave blank line behind (preserves line numbers)
-- sed -i.bak -e $item"s/^.*//" "$src"
-+ sed -e $item"s/^.*//" "$src" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
- fi
- echo "$todo" >> "$dest"
-
-@@ -1323,7 +1327,7 @@ note: PRIORITY must be anywhere from A t
- fi
-
- if [ "$oldpri" != "$newpri" ]; then
-- sed -i.bak -e $item"s/^(.) //" -e $item"s/^/($newpri) /" "$TODO_FILE"
-+ sed -e $item"s/^(.) //" -e $item"s/^/($newpri) /" "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
- fi
- if [ $TODOTXT_VERBOSE -gt 0 ]; then
- getNewtodo "$item"
-@@ -1396,12 +1400,12 @@ note: PRIORITY must be anywhere from A t
- # h; - replace the hold space with the expanded pattern space
- # P; - print up to the first newline (that is, the input line)
- # b - end processing of the current line
-- sed -i.bak -n \
-+ sed -n \
- -e 'G; s/\n/&&/; /^\([^\n]*\n\).*\n\1/b dedup' \
- -e 's/\n//; h; P; b' \
- -e ':dedup' \
- -e "$deduplicateSedCommand" \
-- "$TODO_FILE"
-+ "$TODO_FILE" > "$TODO_TMP" && cat "$TODO_TMP" > "$TODO_FILE"
-
- newTaskNum=$( sed -e '/./!d' "$TODO_FILE" | sed -n '$ =' )
- deduplicateNum=$(( originalTaskNum - newTaskNum ))
Home |
Main Index |
Thread Index |
Old Index