Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/1.2-dev' into 1.2-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Wadolowski committed Jan 16, 2015
2 parents 697e5c4 + 6300a9e commit 267f798
Show file tree
Hide file tree
Showing 10 changed files with 1,946 additions and 13 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CQ-Unix-Toolkit
===============

![CQ Unix Toolkit logo](logo.png)

Table of contents
-----------------
Expand All @@ -21,8 +22,8 @@ Introduction
CQ Unix Toolkit is a set of POSIX shell tools that calls curl and other 3rd
party commands to perform some different tasks on Adobe CQ platform such as:

* Create, Build, upload, list, download, install and deletion of CRX zip
packages
* Create, build, rewrite, upload, list, download, install and deletion of CRX
zip packages
* Maintenance tasks: consistency checks, TarPM compaction and index merge,
DataStore garbage collection
* Clear/invalidate dispatcher cache for subtree specified by `/statfilelevel`
Expand Down Expand Up @@ -56,10 +57,14 @@ Below there is a list of separate tools and short purpose phrase for each one:
* `cqpkg` -- Creates empty zip package on local filesystem using provided
specification (name, group, version, paths, filters) which is valid
and minimal CRX FileVault package. CQ connection not required.
* `cqrepkg`-- Read or rewrite package definition and/or content i.e. name,
group etc and JCR filters
* `cqbld` -- Builds remotely uploaded CQ package using connection parameters
* `cqcp` -- Makes a copy of remote CQ package to your local environment
* `cqget` -- Makes a copy of CQ resource to your local environment
* `cqrun` -- Install uploaded CQ package on remote instanse
* `cqrun` -- Install uploaded CQ package on remote instance
* `cqrev` -- Revert previously installed CQ package on remote instance (if
still exists)
* `cqdel` -- Remove completely remotely available CQ package
* `cqput` -- Upload package from your local environment
* `cqls` -- List packages uploaded/installed in remote CQ
Expand All @@ -69,6 +74,7 @@ Below there is a list of separate tools and short purpose phrase for each one:
* `cqmrg` -- Merge CQ TarPM indexes
* `cqtpm` -- Deletes effectively removed content from TarPM CQ storage
* `cqwfl` -- Display active (or broken) workflow instances
* `cqjcr` -- Browse and modify JCR tree on nodes and properties level
* `cqosgi` -- Display bundles list and manage them by starting/stopping on demand
* `cqclr` -- Simulates activation on dispatcher to clear its cache. Use dispatcher
URL, (not CQ one) as instance URL (-i option).
Expand Down Expand Up @@ -126,9 +132,14 @@ Notes on Windows/Cygwin compatibility
In order to use toolkit on cygwin make sure you have marked/installed the
following cygwin packages:

* `util-linux` (required for all tools)
* `util-linux` (required for all tools)
![Marking curl package](doc/cygwin1-curl.png)
* `curl` (required for almost all tools)
* `zip` (required for cqpkg tool)
![Marking util-linux package](doc/cygwin2-util-linux.png)
* `unzip`, `zip` (required for cqrepkg, cqpkg tools)
![Marking zip/unzip package](doc/cygwin3-zip.png)

If you have any problems, please see [cygwin installation screencast](http://www.youtube.com/watch?v=11ilswbIjkg).

To test commands just type in command line the following expressions and
compare results:
Expand Down
34 changes: 26 additions & 8 deletions cqapi
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ Examples:
cqapi -s # Returns command and parameter required for
# sed extended mode (extended regexp) to
# be compatible with BSD/Mac OS X.
cqapi -w # Returns command and parameter required for
# extended printing purposes (interpreting
# escape sequences) to be compatible
# with BSD/Mac OS X.
echo " " | cqapi -f # Convert space into URL-encoded format
echo "Col1\tCol2" | cqapi -F 0 # Format tab-separated columns into
echo "Col1\tCol2" | cqapi -F 1 # fully-aligned output (0)
Expand All @@ -62,8 +58,6 @@ Options:
stack trace at the same time
-e Detect if on stdin thereis exception stacktrace
-v Provides toolkit version
-w Print echo command line or path with escaped sequences
turned on
-f Encode text into URL-friendly format (percent enc)
-F Preformatting of columns (filled with tabs for
machine-readable format)
Expand Down Expand Up @@ -379,7 +373,32 @@ _format_output()



OPTIONS=":Pu:p:i:csC:H:fF:Evwe-:"

_format_output()
{
ECHO=$(which echo)
[ ${?} -ne 0 -o -z "${ECHO}" ] && ECHO="echo" || ECHO="${ECHO} -e "
SEP='|'
machine_friendly=${1}
output=$(cat -)
if [ "${machine_friendly}" -eq 1 ]
then
${ECHO} "${output}"
else
COLUMN=$(which column)
if [ ${?} -ne 0 -o -z "${COLUMN}" ]
then
echo "Cannot find column utility"
exit 1
fi
${ECHO} "${output}" | tr '\t' "${SEP}" | column -xt -s "${SEP}"
fi
exit
}



OPTIONS=":Pu:p:i:csC:H:fF:Eve-:"
PARSE_OPTIONS="u:p:i:"

sed --version >/dev/null 2>/dev/null
Expand Down Expand Up @@ -423,7 +442,6 @@ case "${mode}" in
E) _java_exception;;
e) _java_exception_detection;;
v) _version;;
w) _echopath;;
f) _urlencode;;
F) _format_output "${argument}";;
esac
Expand Down
Loading

0 comments on commit 267f798

Please sign in to comment.