diff options
author | FichteFoll | 2020-05-09 14:11:25 +0200 |
---|---|---|
committer | FichteFoll | 2020-05-09 14:11:25 +0200 |
commit | e97b6a076a4adb43058031e458f966096e27d552 (patch) | |
tree | b487c0aabed9b27c3f0c4d81daa2ef3075696cf6 | |
parent | 7978fb4a5f2becd0cc907f539664303762b7950d (diff) | |
download | aur-e97b6a076a4adb43058031e458f966096e27d552.tar.gz |
Update to 0.4
-rw-r--r-- | .SRCINFO | 13 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 51 | ||||
-rw-r--r-- | cli-output.patch | 125 | ||||
-rw-r--r-- | cli_context-deprecated.patch | 119 |
5 files changed, 27 insertions, 285 deletions
@@ -1,19 +1,14 @@ pkgbase = dashing pkgdesc = A Dash Generator Script for Any HTML - pkgver = 0.3.0 - pkgrel = 2 + pkgver = 0.4.0 + pkgrel = 1 url = https://github.com/technosophos/dashing arch = i686 arch = x86_64 license = MIT makedepends = go - makedepends = glide - source = dashing-0.3.0.tar.gz::https://github.com/technosophos/dashing/archive/0.3.0.tar.gz - source = cli_context-deprecated.patch - source = cli-output.patch - sha256sums = f6569f3df80c964c0482e7adc1450ea44532d8da887091d099ce42a908fc8136 - sha256sums = e0ec017227a3f8aa58095fbdfe18db3e5376e530b41b1d34164461c51623ac2b - sha256sums = c412b3b2ccae6193aee5989d131bc6e8df7c80eee305794e406dd020a44c1ccb + source = dashing-0.4.0.tar.gz::https://github.com/technosophos/dashing/archive/0.4.0.tar.gz + sha256sums = 81b21acae83c144f10d9eea05a0b89f0dcdfa694c3760c2a25bd4eab72a2a3b9 pkgname = dashing diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..62d631e64c0c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +src/ +pkg/ +*.log +*pkg.tar.* @@ -1,50 +1,37 @@ -# Maintainer: Icaro Perseo <icaroperseo[at]protonmail[dot]com> +# Maintainer: FichteFoll <fichtefoll2@googlemail.om> pkgname=dashing -pkgver=0.3.0 -pkgrel=2 +pkgver=0.4.0 +pkgrel=1 pkgdesc="A Dash Generator Script for Any HTML" url="https://github.com/technosophos/dashing" license=('MIT') arch=('i686' 'x86_64') -makedepends=('go' 'glide') -source=("${pkgname}-${pkgver}.tar.gz::https://github.com/technosophos/${pkgname}/archive/${pkgver}.tar.gz" - "cli_context-deprecated.patch" - "cli-output.patch") -sha256sums=('f6569f3df80c964c0482e7adc1450ea44532d8da887091d099ce42a908fc8136' - 'e0ec017227a3f8aa58095fbdfe18db3e5376e530b41b1d34164461c51623ac2b' - 'c412b3b2ccae6193aee5989d131bc6e8df7c80eee305794e406dd020a44c1ccb') +makedepends=('go') +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/technosophos/${pkgname}/archive/${pkgver}.tar.gz") +sha256sums=('81b21acae83c144f10d9eea05a0b89f0dcdfa694c3760c2a25bd4eab72a2a3b9') prepare() { cd "${pkgname}-${pkgver}" - patch -p1 -i ../cli_context-deprecated.patch - patch -p1 -i ../cli-output.patch - export GOPATH="${srcdir}/${pkgname}-${pkgver}" - mkdir -p src - mv dashing.go src/ - glide install - mv vendor/* src/ } build() { - cd "${pkgname}-${pkgver}/src" - go build -o dashing -ldflags "-X main.version=${pkgver}" dashing.go + cd "${pkgname}-${pkgver}" + go build \ + -trimpath \ + -ldflags "-extldflags $LDFLAGS -X main.version=${pkgver}" \ + -o dashing dashing.go } package() { cd "${pkgname}-${pkgver}" - - # Bin file - install -Dm755 "src/${pkgname}" \ - "${pkgdir}/usr/bin/${pkgname}" - - # Doc files - install -Dm644 README.md \ - "${pkgdir}/usr/share/doc/${pkgname}/README.md" - - # License - install -Dm644 LICENSE.txt \ - "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm755 "${pkgname}" "${pkgdir}/usr/bin/${pkgname}" + install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md" + install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } -# vim:set ts=2 sw=2 cc=80 et: +# Doesn't work +# check() { +# cd "${pkgname}-${pkgver}" +# go test ./... +# } diff --git a/cli-output.patch b/cli-output.patch deleted file mode 100644 index e14547869c9b..000000000000 --- a/cli-output.patch +++ /dev/null @@ -1,125 +0,0 @@ ---- b/dashing.go 2017-01-05 14:48:00.403357303 -0600 -+++ c/dashing.go 2017-01-05 15:32:17.327116746 -0600 -@@ -74,13 +74,8 @@ - // Transform structs. - type Transform struct { - Type string -- -- // Perform a replace operation on the text - Regexp *regexp.Regexp - Replacement string -- -- // Skip files that don't match this path -- MatchPath *regexp.Regexp - } - - var ignoreHash map[string]bool -@@ -128,7 +123,7 @@ - { - Name: "version", - Usage: "Print version and exit.", -- Action: func(c *cli.Context) error { fmt.Println(version);return nil }, -+ Action: func(c *cli.Context) { fmt.Println(version) }, - Flags: []cli.Flag{ - cli.StringFlag{ - Name: "config, f", -@@ -139,7 +134,7 @@ - } - } - --func create(c *cli.Context) error { -+func create(c *cli.Context) { - f := c.String("config") - if len(f) == 0 { - f = "dashing.json" -@@ -160,14 +155,14 @@ - } - err = ioutil.WriteFile(f, j, 0755) - if err != nil { -- fmt.Errorf("Could not initialize JSON file: %s", err) -+ fmt.Errorf("Could not initialize JSON file: %s\n", err) - os.Exit(1) - } -- fmt.Printf("You may now edit %s", f) -- return nil -+ fmt.Printf("You may now edit %s\n", f) -+ - } - --func build(c *cli.Context) error { -+func build(c *cli.Context) { - var dashing Dashing - - source_depth := 0 -@@ -212,11 +207,10 @@ - db, err := createDB(name) - if err != nil { - fmt.Printf("Failed to create database: %s\n", err) -- return nil -+ return - } - defer db.Close() - texasRanger(source, source_depth, name, dashing, db) -- return nil - } - - func decodeSelectField(d *Dashing) error { -@@ -230,37 +224,30 @@ - } - } else if rv.Kind() == reflect.Map { - val := val.(map[string]interface{}) -- var ttype, trep string -- var creg, cmatchpath *regexp.Regexp -- var err error -- -- if r, ok := val["type"]; ok { -- ttype = r.(string) -+ var ttype, treg, trep string -+ if t, ok := val["type"]; ok { -+ ttype = t.(string) - } - if r, ok := val["regexp"]; ok { -- creg, err = regexp.Compile(r.(string)) -- if err != nil { -- return fmt.Errorf("failed to compile regexp '%s': %s", r.(string), err) -- } -+ treg = r.(string) - } - if r, ok := val["replacement"]; ok { - trep = r.(string) - } -- if r, ok := val["matchpath"]; ok { -- cmatchpath, err = regexp.Compile(r.(string)) -- if err != nil { -- return fmt.Errorf("failed to compile regexp '%s': %s", r.(string), err) -+ var creg *regexp.Regexp -+ var err error -+ if len(treg) > 0 { -+ if creg, err = regexp.Compile(treg); err != nil { -+ return fmt.Errorf("failed to compile regexp '%s': %s", treg, err) - } - } - trans = &Transform{ - Type: ttype, - Regexp: creg, - Replacement: trep, -- MatchPath: cmatchpath, - } - } else { - fmt.Errorf("Expected string or map. Kind is %s.", rv.Kind().String()) -- return nil - } - d.selectors[sel] = trans - } -@@ -454,11 +441,6 @@ - } - - for pattern, sel := range dashing.selectors { -- // Skip this selector if file path doesn't match -- if sel.MatchPath != nil && ! sel.MatchPath.MatchString(path) { -- continue -- } -- - m := css.MustCompile(pattern) - found := m.MatchAll(top) - for _, n := range found { diff --git a/cli_context-deprecated.patch b/cli_context-deprecated.patch deleted file mode 100644 index f082eb23301d..000000000000 --- a/cli_context-deprecated.patch +++ /dev/null @@ -1,119 +0,0 @@ ---- a/dashing.go 2015-12-31 15:38:22.000000000 -0600 -+++ b/dashing.go 2017-01-05 14:48:00.403357303 -0600 -@@ -74,8 +74,13 @@ - // Transform structs. - type Transform struct { - Type string -+ -+ // Perform a replace operation on the text - Regexp *regexp.Regexp - Replacement string -+ -+ // Skip files that don't match this path -+ MatchPath *regexp.Regexp - } - - var ignoreHash map[string]bool -@@ -123,7 +128,7 @@ - { - Name: "version", - Usage: "Print version and exit.", -- Action: func(c *cli.Context) { fmt.Println(version) }, -+ Action: func(c *cli.Context) error { fmt.Println(version);return nil }, - Flags: []cli.Flag{ - cli.StringFlag{ - Name: "config, f", -@@ -134,7 +139,7 @@ - } - } - --func create(c *cli.Context) { -+func create(c *cli.Context) error { - f := c.String("config") - if len(f) == 0 { - f = "dashing.json" -@@ -159,10 +164,10 @@ - os.Exit(1) - } - fmt.Printf("You may now edit %s", f) -- -+ return nil - } - --func build(c *cli.Context) { -+func build(c *cli.Context) error { - var dashing Dashing - - source_depth := 0 -@@ -207,10 +212,11 @@ - db, err := createDB(name) - if err != nil { - fmt.Printf("Failed to create database: %s\n", err) -- return -+ return nil - } - defer db.Close() - texasRanger(source, source_depth, name, dashing, db) -+ return nil - } - - func decodeSelectField(d *Dashing) error { -@@ -224,30 +230,37 @@ - } - } else if rv.Kind() == reflect.Map { - val := val.(map[string]interface{}) -- var ttype, treg, trep string -- if t, ok := val["type"]; ok { -- ttype = t.(string) -+ var ttype, trep string -+ var creg, cmatchpath *regexp.Regexp -+ var err error -+ -+ if r, ok := val["type"]; ok { -+ ttype = r.(string) - } - if r, ok := val["regexp"]; ok { -- treg = r.(string) -+ creg, err = regexp.Compile(r.(string)) -+ if err != nil { -+ return fmt.Errorf("failed to compile regexp '%s': %s", r.(string), err) -+ } - } - if r, ok := val["replacement"]; ok { - trep = r.(string) - } -- var creg *regexp.Regexp -- var err error -- if len(treg) > 0 { -- if creg, err = regexp.Compile(treg); err != nil { -- return fmt.Errorf("failed to compile regexp '%s': %s", treg, err) -+ if r, ok := val["matchpath"]; ok { -+ cmatchpath, err = regexp.Compile(r.(string)) -+ if err != nil { -+ return fmt.Errorf("failed to compile regexp '%s': %s", r.(string), err) - } - } - trans = &Transform{ - Type: ttype, - Regexp: creg, - Replacement: trep, -+ MatchPath: cmatchpath, - } - } else { - fmt.Errorf("Expected string or map. Kind is %s.", rv.Kind().String()) -+ return nil - } - d.selectors[sel] = trans - } -@@ -441,6 +454,11 @@ - } - - for pattern, sel := range dashing.selectors { -+ // Skip this selector if file path doesn't match -+ if sel.MatchPath != nil && ! sel.MatchPath.MatchString(path) { -+ continue -+ } -+ - m := css.MustCompile(pattern) - found := m.MatchAll(top) - for _, n := range found { |