From: Jean-Philippe Orsini Date: Sat, 19 Oct 2013 13:49:17 +0000 (+0000) Subject: use rc.confirmation=no for tw 2.2.0 X-Git-Tag: v0.0.6~101 X-Git-Url: http://git.wpitchoune.net/gitweb/?p=ptask.git;a=commitdiff_plain;h=3a4f20601cd297f4e7db412e377a0f649363e136 use rc.confirmation=no for tw 2.2.0 --- diff --git a/NEWS b/NEWS index 721bcab..565f9b3 100644 --- a/NEWS +++ b/NEWS @@ -9,9 +9,9 @@ v0.0.4 * added manpage. * popup error dialog when .taskrc does not exist. * added --debug. - * supported version of taskwarrior is 2.2.0. + * supported versions of taskwarrior are 2.2.0 and 2.0.0. * added taskwarrior version checking. - * added .taskrc check (must exist). + * added support for taskwarrior 2.2.0 (avoid confirmation query). v0.0.3 ------ diff --git a/NEWS.html b/NEWS.html index 901d329..1e42666 100644 --- a/NEWS.html +++ b/NEWS.html @@ -775,7 +775,7 @@ added --debug.
  • -supported version of taskwarrior is 2.2.0. +supported versions of taskwarrior are 2.2.0 and 2.0.0.

  • @@ -785,7 +785,7 @@ added taskwarrior version checking.
  • -added .taskrc check (must exist). +added support for taskwarrior 2.2.0 (avoid confirmation query).

  • @@ -856,7 +856,7 @@ Initial release.

    diff --git a/config.status b/config.status index 3819bc5..7a9ef8b 100755 --- a/config.status +++ b/config.status @@ -428,7 +428,7 @@ $config_commands Report bugs to . ptask home page: ." -ac_cs_config="" +ac_cs_config="'--prefix=/tmp'" ac_cs_version="\ ptask config.status 0.0.x configured by ./configure, generated by GNU Autoconf 2.69, @@ -520,7 +520,7 @@ if $ac_cs_silent; then fi if $ac_cs_recheck; then - set X /bin/bash './configure' $ac_configure_extra_args --no-create --no-recursion + set X /bin/bash './configure' '--prefix=/tmp' $ac_configure_extra_args --no-create --no-recursion shift $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 CONFIG_SHELL='/bin/bash' @@ -746,7 +746,7 @@ S["libexecdir"]="${exec_prefix}/libexec" S["sbindir"]="${exec_prefix}/sbin" S["bindir"]="${exec_prefix}/bin" S["program_transform_name"]="s,x,x," -S["prefix"]="/usr/local" +S["prefix"]="/tmp" S["exec_prefix"]="${prefix}" S["PACKAGE_URL"]="http://wpitchoune.net/ptask" S["PACKAGE_BUGREPORT"]="jeanfi@gmail.com" diff --git a/po/Makefile b/po/Makefile index 430bf0b..ea8150b 100644 --- a/po/Makefile +++ b/po/Makefile @@ -21,7 +21,7 @@ srcdir = . top_srcdir = .. -prefix = /usr/local +prefix = /tmp exec_prefix = ${prefix} datarootdir = ${prefix}/share datadir = ${datarootdir} diff --git a/po/Makefile.in b/po/Makefile.in index 9db3564..ca508b4 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -21,7 +21,7 @@ srcdir = . top_srcdir = .. -prefix = /usr/local +prefix = /tmp exec_prefix = ${prefix} datarootdir = ${prefix}/share datadir = ${datarootdir} diff --git a/src/main.c b/src/main.c index 6a98b1c..36c0d19 100644 --- a/src/main.c +++ b/src/main.c @@ -209,10 +209,7 @@ static void refresh() GTK_BUTTONS_CLOSE, _("Error loading tasks, verify " "that a supported version of " - "taskwarrior is installed " - "and its configuration file " - "exist." - )); + "taskwarrior is installed ")); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); } diff --git a/src/tw.c b/src/tw.c index 2b82693..30f5dcb 100644 --- a/src/tw.c +++ b/src/tw.c @@ -29,30 +29,6 @@ #include #include "tw.h" - -static int has_taskrc() -{ - char *home, *path; - int ret; - struct stat st; - - home = getenv("HOME"); - - if (!home) { - log_err("HOME environment variable not defined"); - return 0; - } - - path = malloc(strlen(home) + 1 + strlen(".taskrc") + 1); - sprintf(path, "%s/%s", home, ".taskrc"); - - ret = lstat(path, &st); - - free(path); - - return ret == 0; -} - static char *task_exec(char *opts) { FILE *f; @@ -115,7 +91,7 @@ static int task_check_version() log_debug("task version: %s", ver); - if (!strcmp(ver, "2.2.0")) + if (!strcmp(ver, "2.2.0") || !strcmp(ver, "2.0.0")) return 1; else return 0; @@ -123,8 +99,7 @@ static int task_check_version() static char *tw_exec(char *opts) { - if (!has_taskrc()) - return NULL; + char *opts2; if (!task_check_version()) { log_err("ptask is not compatible with the installed version of" @@ -132,7 +107,13 @@ static char *tw_exec(char *opts) return NULL; } - return task_exec(opts); + opts2 = malloc(strlen("rc.confirmation:no ") + + strlen(opts) + + 1); + strcpy(opts2, "rc.confirmation:no "); + strcat(opts2, opts); + + return task_exec(opts2); } static struct json_object *task_exec_json(char *opts)