public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-catalyst] [PATCH] Commit a testpath file to source with instructions on it's use.
@ 2014-03-02 23:07 Brian Dolbec
  2014-03-05  4:02 ` [gentoo-catalyst] " W. Trevor King
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Dolbec @ 2014-03-02 23:07 UTC (permalink / raw
  To: gentoo-catalyst

Make testpath automagic via dwfeed's tweak
Update HOWTO on how to run the git checkout code directly without being installed.
---
 doc/HOWTO.txt | 10 ++++++++--
 testpath      | 19 +++++++++++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)
 create mode 100644 testpath

diff --git a/doc/HOWTO.txt b/doc/HOWTO.txt
index 8fe63c1..cec22c3 100644
--- a/doc/HOWTO.txt
+++ b/doc/HOWTO.txt
@@ -233,9 +233,15 @@ Running catalyst from a Git checkout
 
 If you're developing catalyst, you'll want to test your altered
 version.  An easy way to run it without reinstalling is to setup a
-local configuration file and run:
+local configuration file.  The checkout also includes a testpath file
+which when sourced adds it's bin/ to PATH and it's checkout dir to
+PYTHONPATH.  That terminal will then use the checkout bin/catalyst and
+the checkout's python modules.
 
-    # ./catalyst -c catalyst.conf -f path/to/your.spec
+cd into the checkout directory and run:
+
+    # source ./testpath
+    # catalyst -c catalyst.conf -f path/to/your.spec
 
 The local configuration file can use all the defaults except for
 `sharedir`, which you should change to point to your development
diff --git a/testpath b/testpath
new file mode 100644
index 0000000..8394ff6
--- /dev/null
+++ b/testpath
@@ -0,0 +1,19 @@
+
+# When sourced from the same directory as the checkout these 2 paths direct
+# commands use your git checkout in the terminal window you wish to run
+# the git code in...
+# cd ~/catalyst
+# source ./testpath
+# edit a config file "test.conf" with similar path changes for it to find
+# and use/run the git checkout code and to store it's data to a test directory
+# it can then be run on a system without being installed or replacing an existing
+# catalyst install which may be used for production.
+#
+# then run catalyst from there
+#  eg:
+#
+# catalyst -c ./test.conf -p  -f stage1.spec
+
+export PATH="$(dirname $BASH_SOURCE[0])/bin:${PATH}"
+
+export PYTHONPATH="$(dirname $BASH_SOURCE[0]):${PYTHONPATH}"
-- 
1.8.5.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-catalyst] Re: [PATCH] Commit a testpath file to source with instructions on it's use.
  2014-03-02 23:07 [gentoo-catalyst] [PATCH] Commit a testpath file to source with instructions on it's use Brian Dolbec
@ 2014-03-05  4:02 ` W. Trevor King
  0 siblings, 0 replies; 2+ messages in thread
From: W. Trevor King @ 2014-03-05  4:02 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 1640 bytes --]

On Sun, Mar 02, 2014 at 03:07:03PM -0800, Brian Dolbec wrote:
> Make testpath automagic via dwfeed's tweak
> Update HOWTO on how to run the git checkout code directly without
> being installed.

I think this patch is a bit excessive, since I don't expect people to
be running catalyst before they could understand something like:

  To run from the live checkout, use:

    PYTHONPATH=. ./bin/catalyst -c catalyst.conf -f path/to/your.spec

But if folks want a script to set that up for them, I won't complain
;).

> +    # source ./testpath
> +    # catalyst -c catalyst.conf -f path/to/your.spec

You use the versioned catalyst.conf file here, but…

> +# catalyst -c ./test.conf -p  -f stage1.spec

… suggest 'test.conf' here.  I think you should use catalyst.conf for
both, and leave it up to users to realize that they can have multiple,
non-overlapping configurations.

Also, there are two spaces after the '-p' ;).

> +export PATH="$(dirname $BASH_SOURCE[0])/bin:${PATH}"
> +
> +export PYTHONPATH="$(dirname $BASH_SOURCE[0]):${PYTHONPATH}"

I think you need braces around BASH_SOURCE[0]:

  $ cat test.sh 
  echo "'${0}'"
  echo "'${BASH_SOURCE[0]}'"
  echo "'$BASH_SOURCE[0]'"
  $ source test.sh 
  'bash'
  'test.sh'
  'test.sh[0]'

For extra elegance (to avoid a trailing colon if PYTHONPATH was
originally null or unset):

  export PYTHONPATH="$(dirname ${BASH_SOURCE[0]})${PYTHONPATH:+:}${PYTHONPATH}"

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-05  4:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-02 23:07 [gentoo-catalyst] [PATCH] Commit a testpath file to source with instructions on it's use Brian Dolbec
2014-03-05  4:02 ` [gentoo-catalyst] " W. Trevor King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox