All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [dim PATCH 2/4] dim: move dim update check near the end
Date: Tue,  4 Apr 2017 16:59:00 +0300	[thread overview]
Message-ID: <1491314342-7122-2-git-send-email-jani.nikula@intel.com> (raw)
In-Reply-To: <1491314342-7122-1-git-send-email-jani.nikula@intel.com>

Reserve the middle part of the script for function and alias definitions
only.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 dim | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/dim b/dim
index 8671bcb84845..a76e4e4d3f09 100755
--- a/dim
+++ b/dim
@@ -204,6 +204,10 @@ if [ "$subcommand" != "setup" ] && [ "$subcommand" != "help" ] && [ "$subcommand
 fi
 
 #
+# Only function and alias definitions until the subcommand handling at the end.
+#
+
+#
 # Variable naming convetion:
 #
 # repo:
@@ -333,10 +337,6 @@ function git_branch_exists # branch
 	fi
 }
 
-if [[ "$(($(date +%s) % 100))" -eq "0" ]] ; then
-        dim_uptodate || true
-fi
-
 # get message id from file
 # $1 = file
 message_get_id ()
@@ -1893,6 +1893,11 @@ function dim_usage
 	echo "See '$dim help' for more information."
 }
 
+# occasional check for dim updates
+if [[ "$(($(date +%s) % 100))" -eq "0" ]] ; then
+        dim_uptodate || true
+fi
+
 # dim subcommand aliases (with bash 4.3+)
 if ! declare -n subcmd=dim_alias_${subcommand//-/_} &> /dev/null || \
 		test -z "${subcmd:-}"; then
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-04-04 13:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 13:58 [dim PATCH 1/4] dim: do not bail out if the script is not up-to-date Jani Nikula
2017-04-04 13:59 ` Jani Nikula [this message]
2017-04-04 13:59 ` [dim PATCH 3/4] dim: move helper functions above command line options handling Jani Nikula
2017-04-04 13:59 ` [dim PATCH 4/4] dim: run executables in $PATH named dim-subcommand as dim subcommands Jani Nikula
2017-04-04 15:03   ` Daniel Vetter
2017-04-05  7:28     ` Jani Nikula
2017-04-05  9:12       ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491314342-7122-2-git-send-email-jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.