Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update xmlsh to 1.2.0 #13324

Closed
wants to merge 1 commit into from

3 participants

@Zearin

Also: formula now deletes Win32 and cygwin files during installation.

Zearin Update xmlsh to `1.2.0` (and formula tweaks)
Formula now deletes Win32 and cygwin files during installation.
369229d
@adamv
Owner

Is this an update or new formula?

@Zearin

Oh, damn! You’re correct, this is a new formula.

I thought I had submitted this one already, but looks like I got mixed up. Sorry for the confusion!


That said, can I formally request the addition of this formula? I’ve been using it locally for the past 3 releases of xmlsh and it’s working fine for me.

@adamv

Don't need self before libexec

@adamv

We generally don't reference XDG paths

Also, for completeness, there are a few things wrong with this line, if I'm reading your intentions correctly.

The construct "variable = val || other_val" doesn't exist in that form in shell script.

What you want is probably something along the lines of

: ${XDG_CONFIG_HOME:=$HOME}
test -n "$XDG_CONFIG_HOME" || exit 1

note that anything in parens is executed in a subshell, so exiting in that subshell will not exit the parent script early. You can see this with this simple example:

#!/bin/sh
(exit 1)
echo "foo"
@adamv

blank line in script file

@adamv

Fix or remove TODO

@adamv

Need to be "#{bin}/xmlsh"

@adamv
Owner

Please address the issues above and squash to a single commit for review.

@Zearin

Okay…gimme a few. I’m not as 1337 as you core devs. :P

@jacknagel
Owner

Closing due to no response, feel free to reopen with the above addressed.

@jacknagel jacknagel closed this
@Zearin Zearin referenced this pull request
Closed

Add formula: xmlsh (1.2.1) #15339

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 10, 2012
  1. Update xmlsh to `1.2.0` (and formula tweaks)

    Zearin authored
    Formula now deletes Win32 and cygwin files during installation.
This page is out of date. Refresh to see the latest.
Showing with 58 additions and 0 deletions.
  1. +58 −0 Library/Formula/xmlsh.rb
View
58 Library/Formula/xmlsh.rb
@@ -0,0 +1,58 @@
+require 'formula'
+
+
+class Xmlsh < Formula
+ homepage 'http://www.xmlsh.org'
+ url 'http://downloads.sourceforge.net/project/xmlsh/xmlsh/1.2.0/xmlsh_1_2_0.zip'
+ sha1 '999cff2dd41778924f26ea558d6a684c6988173d'
+ version '1.2.0'
+
+ def shim_script target
+ <<-EOS.undent
+ #!/usr/bin/env bash
+
+ # Use XDG_CONFIG_HOME if it exists
+ XDG_CONFIG_HOME=$XDG_CONFIG_HOME || $HOME || ( echo "ERROR IN STARTUP SCRIPT!"; exit 1 )
+ #{self.libexec}/unix/xmlsh -rcfile ${XDG_CONFIG_HOME}/.xmlshrc
+
+ EOS
+ end
+
+
+ # @TODO
+ # Look at maven.rb formula for example of installing
+ # things like README, LICENSE, etc. to the #{prefix}
+ # directory.
+
+
+ def install
+ libexec.install Dir["*"]
+
+ # the provided executable is, by default...uh, not executable.
+ system "chmod", "a+x", "#{self.libexec}/unix/xmlsh"
+
+ # remove windows files
+ system "rm", "-rf", "#{self.libexec}/win32", "#{self.libexec}/cygwin"
+
+ # Write mini-script to run as executable instead of `jar blah blah...`
+ (bin + 'xmlsh').write shim_script('xmlsh')
+ end
+
+
+ def caveats; <<-EOS.undent
+ This package uses the Java JLine library <jline.sourceforge.net>
+ for command line editing. It is known to be buggy on some (possible most)
+ OS X systems.
+
+ In spite of this, 'xmlsh' is still a powerful tool for working XML. Using
+ '*.xsh' scripts is also a workaround (somewhat...) to dealing with the
+ command line editing bugs.
+ EOS
+ end
+
+
+ def test
+ system "xmlsh", "#{self.libexec}/test/run_tests.xsh"
+ end
+
+end
Something went wrong with that request. Please try again.