From 5e955b34e0d867253376cced229c885eb446614d Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Tue, 9 Jul 2013 16:09:38 -0400 Subject: [PATCH 01/24] add merge-to and merge-from commands --- bin/gt | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/bin/gt b/bin/gt index f49ceb36..21e43aa1 100755 --- a/bin/gt +++ b/bin/gt @@ -43,7 +43,6 @@ function check_in_details () { } function push_to_branch () { - set_branch echo "Pushing to $branch ..." git push origin $branch } @@ -90,6 +89,7 @@ case "$op" in ;; commit) + set_branch check_in_details push_to_branch ;; @@ -111,6 +111,32 @@ case "$op" in git master --set-upstream gh-pages origin/gh-pages ;; + merge-to) + set_branch + to=$1 + echo "Merging $branch into $to ..." + echo "Switching to $to ..." + git checkout $to + if [ $status -eq 0 ]; then + git merge --no-ff $branch + if [ $status -eq 0 ]; then + echo "Pushing to $to ..." + git push origin $to + fi + git checkout $branch + fi + ;; + + merge-from) + set_branch + from=$1 + echo "Merging $from into $branch ..." + git merge --no-ff $from + if [ $status -eq 0 ]; then + push_to_branch + fi + ;; + outstanding|out|what) set_branch git diff origin/$branch $branch @@ -118,6 +144,7 @@ case "$op" in push|pu|pom|pob) # Push all local changes to the origin/repo server + set_branch push_to_branch ;; From 150fff8166db4c371c77eaeb25f41dc460b151c2 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Tue, 9 Jul 2013 16:28:52 -0400 Subject: [PATCH 02/24] Use LIBSLAX_VERSION_EXTRA in code aped from juise/configure.ac --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c5602024..deb54888 100644 --- a/configure.ac +++ b/configure.ac @@ -430,7 +430,7 @@ if test -d $ac_abs_confdir/.git ; then extra=`git branch | awk '/\*/ { print $2 }'` if test "$extra" != "" -a "$extra" != "master" then - LIBJUISE_VERSION_EXTRA="-git-$extra" + LIBSLAX_VERSION_EXTRA="-git-$extra" fi fi From 804e1c798dc4cba4b19571da5def83abff06ed4e Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Tue, 9 Jul 2013 17:22:25 -0400 Subject: [PATCH 03/24] change "ci" alias to "check-in-details"; nuke current-tag (useless) --- bin/gt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bin/gt b/bin/gt index 21e43aa1..bd868784 100755 --- a/bin/gt +++ b/bin/gt @@ -66,7 +66,7 @@ case "$op" in fi ;; - checkin|ci|check|checkpoint) + checkin|check|checkpoint) git diff $file git status -s "$@" @@ -84,7 +84,7 @@ case "$op" in fi ;; - check-in-details|cid) + check-in-details|ci|cid) check_in_details ;; @@ -94,10 +94,6 @@ case "$op" in push_to_branch ;; - ctag|current-tag) - git tag -l '*' | sed 's/^v//' - ;; - diff|dif|delta) git diff "$@" ;; From 507d1e3337be1eb2e6fd27364034bbd7f2e1306b Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Wed, 10 Jul 2013 02:00:16 -0400 Subject: [PATCH 04/24] move packaging to a new dir --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index a17bbb5c..1d92b054 100644 --- a/Makefile.am +++ b/Makefile.am @@ -84,7 +84,7 @@ upload: dist @echo " gt tag ${PACKAGE_VERSION}" pkgconfigdir=$(libdir)/pkgconfig -pkgconfig_DATA = ${PACKAGE_NAME}.pc +pkgconfig_DATA = packaging/${PACKAGE_NAME}.pc get-wiki: git clone https://github.com/Juniper/${PACKAGE_NAME}.wiki.git wiki From 8579432dcf48775a7ddcb20be3a5be26512d5bf0 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Wed, 10 Jul 2013 02:00:25 -0400 Subject: [PATCH 05/24] move packaging to a new dir --- configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index deb54888..d21881e3 100644 --- a/configure.ac +++ b/configure.ac @@ -460,8 +460,9 @@ AC_CONFIG_FILES([ bin/Makefile doc/Makefile doc/oxtradoc/oxtradoc - libslax.pc - libslax.spec + packaging/libslax.pc + packaging/libslax.spec + packaging/libslax.rb ]) AC_OUTPUT From a5f459ad3c72a5dc5ec93f1ee9e7618994e2525d Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Wed, 10 Jul 2013 02:00:42 -0400 Subject: [PATCH 06/24] new script to find github URL --- bin/get-release-url.slax | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 bin/get-release-url.slax diff --git a/bin/get-release-url.slax b/bin/get-release-url.slax new file mode 100644 index 00000000..d7274761 --- /dev/null +++ b/bin/get-release-url.slax @@ -0,0 +1,37 @@ +#!/usr/local/bin/slaxproc -E -n +version 1.1; + +/* + * github puts a number in the URLs for the "releases" + * feature. It seems to be a monotonically increasing + * number in a global namespace. We need to find the + * url for the latest release and report it. + */ + +ns curl extension = "http://xml.libslax.org/curl"; + +param $user = "Juniper"; +param $project = "libslax"; + +var $base = "https://github.com/"; +var $url = $base _ $user _ "/" _ $project _ "/releases"; + +output-method text; + +match / { + var $options = { + ; + "html"; + } + var $results = curl:single($url, $options); + + var $href = $results/data//ul[@class == "release-downloads"][1] + /li[1]/a/@href; + var $link = string($href); + if ($link != "") { + if (not(starts-with($link, "http"))) { + expr "https://github.com"; + } + expr $link _ "\n"; + } +} From 1d916cb2960c005002667de8ba1ac4e705c4f745 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Wed, 10 Jul 2013 02:00:53 -0400 Subject: [PATCH 07/24] homebrew packaging --- packaging/libslax.rb.in | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packaging/libslax.rb.in diff --git a/packaging/libslax.rb.in b/packaging/libslax.rb.in new file mode 100644 index 00000000..58607c35 --- /dev/null +++ b/packaging/libslax.rb.in @@ -0,0 +1,27 @@ +# +# Homebrew formula file for libslax +# https://github.com/mxcl/homebrew +# + +require 'formula' + +class Libslax < Formula + homepage 'https://github.com/Juniper/libslax' + url '{URL}' + sha1 '{SHA1}' + + depends_on 'libtool' => :build + + # Need newer versions of these libraries + if MacOS.version <= :lion + depends_on 'libxml2' + depends_on 'libxslt' + depends_on 'curl' + end + + def install + system "./configure", "--disable-dependency-tracking", + "--prefix=#{prefix}" + system "make install" + end +end From 145a300e423cef0b9d8e01c51bc503602685e953 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Wed, 10 Jul 2013 02:08:44 -0400 Subject: [PATCH 08/24] set exit code for failure --- bin/get-release-url.slax | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/get-release-url.slax b/bin/get-release-url.slax index d7274761..27687e42 100644 --- a/bin/get-release-url.slax +++ b/bin/get-release-url.slax @@ -9,12 +9,13 @@ version 1.1; */ ns curl extension = "http://xml.libslax.org/curl"; +ns os extension = "http://xml.libslax.org/os"; param $user = "Juniper"; param $project = "libslax"; -var $base = "https://github.com/"; -var $url = $base _ $user _ "/" _ $project _ "/releases"; +var $base = "https://github.com"; +var $url = $base _ "/" _ $user _ "/" _ $project _ "/releases"; output-method text; @@ -28,9 +29,11 @@ match / { var $href = $results/data//ul[@class == "release-downloads"][1] /li[1]/a/@href; var $link = string($href); - if ($link != "") { - if (not(starts-with($link, "http"))) { - expr "https://github.com"; + if ($link == "") { + expr os:exit-code(1); + } else { + if (not(starts-with($link, $base))) { + expr $base; } expr $link _ "\n"; } From d779e6e532dacd6b1ff390b0a135f7ea1ed14bf2 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Wed, 10 Jul 2013 02:08:57 -0400 Subject: [PATCH 09/24] making base file, not the real thing --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d21881e3..8dbfb788 100644 --- a/configure.ac +++ b/configure.ac @@ -461,8 +461,8 @@ AC_CONFIG_FILES([ doc/Makefile doc/oxtradoc/oxtradoc packaging/libslax.pc - packaging/libslax.spec - packaging/libslax.rb + packaging/libslax.spec.base + packaging/libslax.rb.base ]) AC_OUTPUT From 630d691c1df1c730094021c947bb7419a090217c Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Wed, 10 Jul 2013 02:09:12 -0400 Subject: [PATCH 10/24] making base file, not the real thing --- packaging/libslax.rb.in | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 packaging/libslax.rb.in diff --git a/packaging/libslax.rb.in b/packaging/libslax.rb.in deleted file mode 100644 index 58607c35..00000000 --- a/packaging/libslax.rb.in +++ /dev/null @@ -1,27 +0,0 @@ -# -# Homebrew formula file for libslax -# https://github.com/mxcl/homebrew -# - -require 'formula' - -class Libslax < Formula - homepage 'https://github.com/Juniper/libslax' - url '{URL}' - sha1 '{SHA1}' - - depends_on 'libtool' => :build - - # Need newer versions of these libraries - if MacOS.version <= :lion - depends_on 'libxml2' - depends_on 'libxslt' - depends_on 'curl' - end - - def install - system "./configure", "--disable-dependency-tracking", - "--prefix=#{prefix}" - system "make install" - end -end From 365e18d4de9f941bde88ad60e434ca6ffdefa1ac Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Thu, 11 Jul 2013 11:34:01 -0400 Subject: [PATCH 11/24] Make "gt pull" (aka "gt up") match "gt push" --- bin/gt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/gt b/bin/gt index bd868784..166591ed 100755 --- a/bin/gt +++ b/bin/gt @@ -168,9 +168,10 @@ case "$op" in git push origin --tags $branch ;; - up|update) + pull|up|update) # Update working copy with repo's changes - git pull -v "$@" + set_branch + git pull -v origin $branch ;; *) From 222cb1c3027ba00f231ccdc1b4eb74f5ed016b7a Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Thu, 11 Jul 2013 11:38:02 -0400 Subject: [PATCH 12/24] move packaging files to packaging/ directory --- packaging/libslax.rb.base.in | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packaging/libslax.rb.base.in diff --git a/packaging/libslax.rb.base.in b/packaging/libslax.rb.base.in new file mode 100644 index 00000000..58607c35 --- /dev/null +++ b/packaging/libslax.rb.base.in @@ -0,0 +1,27 @@ +# +# Homebrew formula file for libslax +# https://github.com/mxcl/homebrew +# + +require 'formula' + +class Libslax < Formula + homepage 'https://github.com/Juniper/libslax' + url '{URL}' + sha1 '{SHA1}' + + depends_on 'libtool' => :build + + # Need newer versions of these libraries + if MacOS.version <= :lion + depends_on 'libxml2' + depends_on 'libxslt' + depends_on 'curl' + end + + def install + system "./configure", "--disable-dependency-tracking", + "--prefix=#{prefix}" + system "make install" + end +end From aa5d9ae2e670b820ea5cd33488ad682f7dae2b48 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Fri, 12 Jul 2013 09:12:50 -0400 Subject: [PATCH 13/24] Ignore errors --- bin/get-release-url.slax | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/get-release-url.slax b/bin/get-release-url.slax index 27687e42..a026cd52 100644 --- a/bin/get-release-url.slax +++ b/bin/get-release-url.slax @@ -23,6 +23,7 @@ match / { var $options = { ; "html"; + "ignore"; } var $results = curl:single($url, $options); From 392dd9aef9193500b04d40f99fe88837da7d9e19 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Fri, 12 Jul 2013 09:14:00 -0400 Subject: [PATCH 14/24] Catch errors based on the value of the new option --- extensions/curl/ext_curl.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/extensions/curl/ext_curl.c b/extensions/curl/ext_curl.c index d8bd32a4..d09e933a 100644 --- a/extensions/curl/ext_curl.c +++ b/extensions/curl/ext_curl.c @@ -52,6 +52,7 @@ typedef struct curl_opts_s { u_int8_t co_verbose; /* Verbose (debug) output */ u_int8_t co_insecure; /* Allow insecure SSL certs */ u_int8_t co_secure; /* Use SSL-enabled version of protocol */ + int co_errors; /* How to handle errors (SLAX_ERROR_*) */ long co_timeout; /* Operation timeout */ long co_connect_timeout; /* Connect timeout */ char *co_username; /* Value for CURLOPT_USERNAME */ @@ -147,6 +148,7 @@ extCurlOptionsCopy (curl_opts_t *top, curl_opts_t *fromp) COPY_FIELD(co_verbose); COPY_FIELD(co_insecure); COPY_FIELD(co_secure); + COPY_FIELD(co_errors); COPY_STRING(co_username); COPY_STRING(co_password); COPY_STRING(co_content_type); @@ -289,6 +291,8 @@ extCurlParseNode (curl_opts_t *opts, xmlNodePtr nodep) opts->co_insecure = TRUE; else if (streq(key, "secure")) opts->co_secure = TRUE; + else if (streq(key, "errors")) + opts->co_errors = slaxErrorValue(xmlNodeValue(nodep)); else if (streq(key, "timeout")) opts->co_timeout = atoi(xmlNodeValue(nodep)); else if (streq(key, "connect-timeout")) @@ -936,7 +940,7 @@ extCurlBuildDataParsed (curl_handle_t *curlp UNUSED, curl_opts_t *opts, const char *cp, *ep, *sp; char *nbuf = NULL, *vbuf = NULL; ssize_t nbufsiz = 0, vbufsiz = 0; - + xmlNodePtr errp = NULL; xmlNodePtr nodep = xmlNewDocNode(docp, NULL, (const xmlChar *) "data", NULL); if (nodep == NULL) @@ -946,6 +950,14 @@ extCurlBuildDataParsed (curl_handle_t *curlp UNUSED, curl_opts_t *opts, xmlSetProp(nodep, (const xmlChar *) "format", (const xmlChar *) opts->co_format); + + if (opts->co_errors) { + if (opts->co_errors == SLAX_ERROR_RECORD) + errp = xmlNewDocNode(docp, NULL, (const xmlChar *) "errors", NULL); + if (opts->co_errors != SLAX_ERROR_RECORD || errp) + slaxCatchErrors(opts->co_errors, errp); + } + if (streq(opts->co_format, "name")) { for (cp = raw_data; *cp; cp = ep + 1) { sp = strchr(cp, '='); @@ -1031,7 +1043,7 @@ extCurlBuildDataParsed (curl_handle_t *curlp UNUSED, curl_opts_t *opts, xmlp = xmlReadMemory(raw_data, strlen(raw_data), "raw_data", NULL, XML_PARSE_NOENT); if (xmlp == NULL) - return; + goto bail; xmlNodePtr childp = xmlDocGetRootElement(xmlp); if (childp) { @@ -1048,7 +1060,7 @@ extCurlBuildDataParsed (curl_handle_t *curlp UNUSED, curl_opts_t *opts, xmlp = htmlReadMemory(raw_data, strlen(raw_data), "raw_data", NULL, XML_PARSE_NOENT); if (xmlp == NULL) - return; + goto bail; xmlNodePtr childp = xmlDocGetRootElement(xmlp); if (childp) { @@ -1059,6 +1071,21 @@ extCurlBuildDataParsed (curl_handle_t *curlp UNUSED, curl_opts_t *opts, xmlFreeDoc(xmlp); } + + bail: + if (opts->co_errors) { + slaxCatchErrors(SLAX_ERROR_DEFAULT, NULL); + if (errp) { + /* + * If we have errors, record them; otherwise free the empty + * "errors" node. + */ + if (errp->children) + xmlAddChild(parent, errp); + else + xmlFreeNode(errp); + } + } } /* From fd705f9f39e7acf11da9237103f5e4ab99cd940f Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Fri, 12 Jul 2013 09:14:18 -0400 Subject: [PATCH 15/24] New facility to catch errors (slaxCatchErrors) --- libslax/slaxio.c | 105 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 92 insertions(+), 13 deletions(-) diff --git a/libslax/slaxio.c b/libslax/slaxio.c index 9faf8426..91819429 100644 --- a/libslax/slaxio.c +++ b/libslax/slaxio.c @@ -400,6 +400,20 @@ slaxLogToFile (FILE *fp) slaxLogFp = fp; } +static void +slaxLogv (const char *fmt, int newline, va_list vap) +{ + if (slaxLogCallback) { + slaxLogCallback(slaxLogCallbackData, fmt, vap); + } else { + vfprintf(slaxLogFp ?: stderr, fmt, vap); + if (newline) + fprintf(slaxLogFp ?: stderr, "\n"); + fflush(slaxLogFp ?: stderr); + } +} + + /** * Simple trace function that tosses messages to stderr if slaxLogIsEnabled * has been set to non-zero. @@ -415,15 +429,7 @@ slaxLog (const char *fmt, ...) return; va_start(vap, fmt); - - if (slaxLogCallback) { - slaxLogCallback(slaxLogCallbackData, fmt, vap); - } else { - vfprintf(slaxLogFp ?: stderr, fmt, vap); - fprintf(slaxLogFp ?: stderr, "\n"); - fflush(slaxLogFp ?: stderr); - } - + slaxLogv(fmt, TRUE, vap); va_end(vap); } @@ -442,10 +448,7 @@ slaxLog2 (void *ignore UNUSED, const char *fmt, ...) return; va_start(vap, fmt); - - vfprintf(slaxLogFp ?: stderr, fmt, vap); - fflush(slaxLogFp ?: stderr); - + slaxLogv(fmt, FALSE, vap); va_end(vap); } @@ -693,3 +696,79 @@ slaxGetExitCode (void) { return slaxExitCode; } + +typedef struct slax_error_data_s { + int sed_mode; /* Mode (SLAX_ERROR_*) */ + xmlNodePtr sed_nodep; /* Node to record into */ +} slax_error_data_t; + +static slax_error_data_t slax_error_data; + +static void +slaxGenericError (void *opaque, const char *fmt, ...) +{ + slax_error_data_t *sedp = opaque; + va_list vap; + + va_start(vap, fmt); + + switch (sedp->sed_mode) { + case SLAX_ERROR_RECORD: + if (sedp->sed_nodep) { + char buf[BUFSIZ]; + int bufsiz = sizeof(buf); + char *bp = buf; + int rc = vsnprintf(buf, bufsiz, fmt, vap); + if (rc >= bufsiz) { + bp = alloca(rc + 1); + vsnprintf(bp, rc + 1, fmt, vap); + } + if (rc > 0) { + xmlNodePtr tp = xmlNewText((const xmlChar *) bp); + if (tp) + xmlAddChild(sedp->sed_nodep, tp); + } + } + break; + case SLAX_ERROR_LOG: + if (slaxLogIsEnabled) + slaxLogv(fmt, FALSE, vap); + break; + } + + va_end(vap); +} + +/* + * Return the value cooresponding to the given name + */ +int +slaxErrorValue (const char *name) +{ + if (streq(name, "ignore")) + return SLAX_ERROR_IGNORE; + if (streq(name, "record")) + return SLAX_ERROR_RECORD; + if (streq(name, "log")) + return SLAX_ERROR_LOG; + return SLAX_ERROR_DEFAULT; +} + +/* + * Catch errors and do something specific with them + */ +int +slaxCatchErrors (int mode, xmlNodePtr recorder) +{ + if (mode == SLAX_ERROR_RECORD && recorder == NULL) { + slaxLog("slaxCatchErrors: can't catch with no target node"); + return -1; + } + + slax_error_data.sed_mode = mode; + slax_error_data.sed_nodep = recorder; + + xmlSetGenericErrorFunc(&slax_error_data, slaxGenericError); + + return 0; +} From 30bd72f2344e2442f8db46912f54cb27947976e1 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Fri, 12 Jul 2013 09:14:28 -0400 Subject: [PATCH 16/24] New facility to catch errors (slaxCatchErrors) --- libslax/slaxio.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libslax/slaxio.h b/libslax/slaxio.h index 9734e56e..30ac0084 100644 --- a/libslax/slaxio.h +++ b/libslax/slaxio.h @@ -55,3 +55,14 @@ slaxLog (const char *fmt, ...); */ void slaxLog2 (void *, const char *fmt, ...); + +#define SLAX_ERROR_DEFAULT 0 /* Default behavior */ +#define SLAX_ERROR_IGNORE 1 /* Ignore errors; discard them */ +#define SLAX_ERROR_RECORD 2 /* Record errors */ +#define SLAX_ERROR_LOG 3 /* Log errors (slaxLog()) */ + +int +slaxCatchErrors (int mode, xmlNodePtr recorder); + +int +slaxErrorValue (const char *name); From 61872e0d830c073cb64cd08e61f885e3d08ec456 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Fri, 12 Jul 2013 09:14:45 -0400 Subject: [PATCH 17/24] Check for NULL return from xmlNewText --- libslax/slaxtree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libslax/slaxtree.c b/libslax/slaxtree.c index 1d4be4fe..2b26571a 100644 --- a/libslax/slaxtree.c +++ b/libslax/slaxtree.c @@ -212,7 +212,8 @@ slaxAttribAdd (slax_data_t *sdp, int style, xmlNodePtr tp; tp = xmlNewText((const xmlChar *) value->ss_token); - slaxAddChildLineNo(sdp->sd_ctxt, sdp->sd_ctxt->node, tp); + if (tp) + slaxAddChildLineNo(sdp->sd_ctxt, sdp->sd_ctxt->node, tp); return; } From a117584674216e6c6b8adede690a9610fd350d9b Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Fri, 12 Jul 2013 09:16:02 -0400 Subject: [PATCH 18/24] Move packaging files to packaging/ directory --- libslax.pc.in => packaging/libslax.pc.in | 0 libslax.spec.in => packaging/libslax.spec.base.in | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename libslax.pc.in => packaging/libslax.pc.in (100%) rename libslax.spec.in => packaging/libslax.spec.base.in (100%) diff --git a/libslax.pc.in b/packaging/libslax.pc.in similarity index 100% rename from libslax.pc.in rename to packaging/libslax.pc.in diff --git a/libslax.spec.in b/packaging/libslax.spec.base.in similarity index 100% rename from libslax.spec.in rename to packaging/libslax.spec.base.in From d33155c1c679340e34792b4a8840c9fe831fe6ff Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Fri, 12 Jul 2013 11:10:57 -0400 Subject: [PATCH 19/24] "make packages" target to build packaging information --- Makefile.am | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 1d92b054..1723371c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -90,4 +90,14 @@ get-wiki: git clone https://github.com/Juniper/${PACKAGE_NAME}.wiki.git wiki get-gh-pages: - git clone https://github.com/Juniper/${PACKAGE_NAME}.git gh-pages -b gh-pages + git clone https://github.com/Juniper/${PACKAGE_NAME}.git \ + gh-pages -b gh-pages + +UPDATE_PACKAGE_FILE = -e "s/__SHA1__/$$SHA1/" + +packages: + @-[ -d ${GH_PAGES_DIR} ] && set -x \ + && echo "Updating packages on gh-pages ..." \ + && SHA1=`openssl sha1 ${PACKAGE_FILE} | awk '{print $$2}'` \ + && sed ${UPDATE_PACKAGE_FILE} packaging/libslax.rb.base \ + > packaging/libslax.rb From 5d67e1230085e50f977a2009d3477e7d92cabe47 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Fri, 12 Jul 2013 11:11:14 -0400 Subject: [PATCH 20/24] .spec doesn't need a .base. --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8dbfb788..cedf384b 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libslax], [0.16.10], [phil@juniper.net]) +AC_INIT([libslax], [0.16.11], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) AC_DISABLE_SHARED @@ -461,7 +461,7 @@ AC_CONFIG_FILES([ doc/Makefile doc/oxtradoc/oxtradoc packaging/libslax.pc - packaging/libslax.spec.base + packaging/libslax.spec packaging/libslax.rb.base ]) AC_OUTPUT From 0aa7df7761e79e03241cc88cea1ee984058ab7b9 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Fri, 12 Jul 2013 11:11:24 -0400 Subject: [PATCH 21/24] Document --- doc/slax.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/doc/slax.txt b/doc/slax.txt index 43252db2..bc422ddc 100644 --- a/doc/slax.txt +++ b/doc/slax.txt @@ -3514,6 +3514,37 @@ payload. SYNTAX:: "mime/type"; +**** + +The element controls how HTML and XML parsing errors are +handled. The default (display them on stderr) is often not +attractive. Instead errors can be ignored, logged, or recorded, based +on the contents of the element: + +|---------+-----------------------------------| +| Value | Special behavior | +|---------+-----------------------------------| +| default | Errors are displayed on stderr | +| ignore | Errors are discarded | +| log | Errors are logged (via slaxLog()) | +| record | Errors are recorded | +|---------+-----------------------------------| + +When is set to "record", all errors appear in a string under +the element in the XML node (as returned by +e.g. curl:perform). If no errors are generated, the element +will not be present, allowing it to be used as a test for errors: + + var $opt = { + $url; + "html"; + "record"; + } + var $res = curl:single($opts); + if ($res/errors) { + terminate "failure: " _ $res/errors; + } + **** The element indicates that the transfer should fail if From d12da9b47cee872b6ede2aae57fd2221a96be226 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Fri, 12 Jul 2013 11:11:48 -0400 Subject: [PATCH 22/24] Update url and sha1 values --- packaging/libslax.rb.base.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packaging/libslax.rb.base.in b/packaging/libslax.rb.base.in index 58607c35..ccc80d6b 100644 --- a/packaging/libslax.rb.base.in +++ b/packaging/libslax.rb.base.in @@ -6,9 +6,9 @@ require 'formula' class Libslax < Formula - homepage 'https://github.com/Juniper/libslax' - url '{URL}' - sha1 '{SHA1}' + homepage 'https://github.com/Juniper/@PACKAGE-NAME@' + url 'https://github.com/Juniper/@PACKAGE_NAME@/releases/@PACKAGE_VERSION@/@PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz' + sha1 '__SHA1__' depends_on 'libtool' => :build From a5f54e22abaadfcb72c9ea0a577cde4d7c0fea06 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Fri, 12 Jul 2013 11:12:02 -0400 Subject: [PATCH 23/24] .spec doesn't need a .base. --- packaging/libslax.spec.base.in | 70 ---------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 packaging/libslax.spec.base.in diff --git a/packaging/libslax.spec.base.in b/packaging/libslax.spec.base.in deleted file mode 100644 index 9d4f1c9a..00000000 --- a/packaging/libslax.spec.base.in +++ /dev/null @@ -1,70 +0,0 @@ -Name: @PACKAGE_NAME@ -Version: @PACKAGE_VERSION@ -Release: 1%{?dist} -Summary: Implementation of the SLAX language - -Group: Development/Libraries -License: MIT -URL: https://github.com/Juniper/libslax -Source0: https://github.com/Juniper/libslax/releases/%{version}/1103/libslax-${version}.tar.gz - -BuildRequires: libxml2-devel -BuildRequires: libxslt-devel -BuildRequires: curl-devel -BuildRequires: libedit-devel -BuildRequires: automake -BuildRequires: autoconf -BuildRequires: libtool - -%description -Welcome to libslax, an implementation of the SLAX language, an alternate -syntax for XSLT that follow the patterns of C and Perl. This library -builds on the most excellent work of Daniel Veillard et al in the -libxml2 and libxslt libraries, for which I heartily give thanks. - -#%package devel -#Summary: Development files for %{name} -#Group: Development/Libraries -#Requires: %{name} = %{version}-%{release} - -#%description devel -#The %{name}-devel package contains libraries and header files for -#developing applications that use %{name}. - -%prep -%setup -q -#sh ./bin/setup.sh - -%build -%configure -make %{?_smp_mflags} - -%install -rm -rf $RPM_BUILD_ROOT -%make_install -#find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' - -%clean -rm -rf $RPM_BUILD_ROOT - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - - -%files -%defattr(-,root,root,-) -%doc - -#%files devel -#%defattr(-,root,root,-) -#%doc -#%{_includedir}/* -#%{_libdir}/*.so - -%changelog -For the complete changelog, please see: - https://github.com/Juniper/libslax/commits/master/libslax.spec.in - -Thanks goes to John Deatherage for working this up. - From 21af76bf9420065d348a0a9a0d914aafc47cdc28 Mon Sep 17 00:00:00 2001 From: Phil Shafer Date: Fri, 12 Jul 2013 11:12:26 -0400 Subject: [PATCH 24/24] update Source0 value --- packaging/libslax.spec.in | 70 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 packaging/libslax.spec.in diff --git a/packaging/libslax.spec.in b/packaging/libslax.spec.in new file mode 100644 index 00000000..eddc2139 --- /dev/null +++ b/packaging/libslax.spec.in @@ -0,0 +1,70 @@ +Name: @PACKAGE_NAME@ +Version: @PACKAGE_VERSION@ +Release: 1%{?dist} +Summary: Implementation of the SLAX language + +Group: Development/Libraries +License: MIT +URL: https://github.com/Juniper/libslax +Source0: https://github.com/Juniper/@PACKAGE_NAME@/releases/@PACKAGE_VERSION@/@PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz + +BuildRequires: libxml2-devel +BuildRequires: libxslt-devel +BuildRequires: curl-devel +BuildRequires: libedit-devel +BuildRequires: automake +BuildRequires: autoconf +BuildRequires: libtool + +%description +Welcome to libslax, an implementation of the SLAX language, an alternate +syntax for XSLT that follow the patterns of C and Perl. This library +builds on the most excellent work of Daniel Veillard et al in the +libxml2 and libxslt libraries, for which I heartily give thanks. + +#%package devel +#Summary: Development files for %{name} +#Group: Development/Libraries +#Requires: %{name} = %{version}-%{release} + +#%description devel +#The %{name}-devel package contains libraries and header files for +#developing applications that use %{name}. + +%prep +%setup -q +#sh ./bin/setup.sh + +%build +%configure +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +%make_install +#find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + + +%files +%defattr(-,root,root,-) +%doc + +#%files devel +#%defattr(-,root,root,-) +#%doc +#%{_includedir}/* +#%{_libdir}/*.so + +%changelog +For the complete changelog, please see: + https://github.com/Juniper/libslax/commits/master/libslax.spec.in + +Thanks goes to John Deatherage for working this up. +