diff options
author | Patrick McCarty | 2017-12-10 18:33:02 -0800 |
---|---|---|
committer | Patrick McCarty | 2017-12-10 18:33:02 -0800 |
commit | e91977035271559f9eb9a9949e3a8d1257b88aa3 (patch) | |
tree | c6083fc10d33ae86e27a3677f9809027ff4b1d95 | |
parent | 7250dc9e4557681bb2e8f4f017e5e4a827e9e96a (diff) | |
download | aur-e91977035271559f9eb9a9949e3a8d1257b88aa3.tar.gz |
Add patch from pending upstream PR
See https://github.com/clearlinux/abireport/pull/2
-rw-r--r-- | PKGBUILD | 11 | ||||
-rw-r--r-- | use-unzip-for-eopkg.patch | 89 |
2 files changed, 98 insertions, 2 deletions
@@ -8,8 +8,15 @@ arch=('i686' 'x86_64') url="https://github.com/clearlinux/abireport" license=('Apache') depends=('go') -source=("https://github.com/clearlinux/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz") -sha256sums=('a0b6fa0a5b160e3a40937e7e636729aaf55a033986f8c3abe59742d83216e162') +source=("https://github.com/clearlinux/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz" + "use-unzip-for-eopkg.patch") +sha256sums=('a0b6fa0a5b160e3a40937e7e636729aaf55a033986f8c3abe59742d83216e162' + '5a9930baeb8b850f116b13f8d86a852d0bfd12d642d81f85f69f27e353f0fab9') + +prepare() { + cd "$pkgname-$pkgver" + patch -p1 -i "$srcdir/use-unzip-for-eopkg.patch" +} build() { cd "$pkgname-$pkgver" diff --git a/use-unzip-for-eopkg.patch b/use-unzip-for-eopkg.patch new file mode 100644 index 000000000000..592c3504b760 --- /dev/null +++ b/use-unzip-for-eopkg.patch @@ -0,0 +1,89 @@ +From cfa7b0ad93b5c848ade2beb89ba1b60c597a9a8b Mon Sep 17 00:00:00 2001 +From: Ikey Doherty <ikey@solus-project.com> +Date: Wed, 22 Nov 2017 19:12:26 +0000 +Subject: [PATCH] explode/eopkg: Use a portable function to explode the eopkg + +This function is much like the RPM explosion helper, by using a simple +pipe to get directly to the contents of the package. Here we simply +pipe unzip to tar xf, explicitly passing the `install.tar.xz` payload +to tar. Internally an eopkg is simply a ZIP file with a tarball payload +and some XML data, so this is always going to work. + +Signed-off-by: Ikey Doherty <ikey@solus-project.com> +--- + src/explode/eopkg.go | 39 ++++++++++++++++++++++++++++++--------- + 1 file changed, 30 insertions(+), 9 deletions(-) + +diff --git a/src/explode/eopkg.go b/src/explode/eopkg.go +index cea004d..2ecdca5 100644 +--- a/src/explode/eopkg.go ++++ b/src/explode/eopkg.go +@@ -17,20 +17,21 @@ + package explode + + import ( ++ "io" + "io/ioutil" +- "os" + "os/exec" + "path/filepath" + "strings" + ) + +-// Eopkg will explode all .eopkg's specified and then return +-// the install/ path inside that exploded tree. ++// Eopkg will explode all eopkgs passed to it and return the path to ++// the "root" to walk. + func Eopkg(pkgs []string) (string, error) { + rootDir, err := ioutil.TempDir("", "abireport-eopkg") + if err != nil { + return "", err + } ++ + // Ensure cleanup happens + OutputDir = rootDir + +@@ -43,17 +44,37 @@ func Eopkg(pkgs []string) (string, error) { + if strings.HasSuffix(archive, ".delta.eopkg") { + continue + } +- eopkg := exec.Command("uneopkg", []string{ ++ ++ eopkg := exec.Command("unzip", []string{ ++ "-p", + fp, ++ "install.tar.xz", ++ }...) ++ tar := exec.Command("tar", []string{ ++ "-xJf", ++ "-", + }...) +- eopkg.Stdout = nil +- eopkg.Stderr = os.Stderr +- eopkg.Dir = rootDir ++ // Pipe eopkg into tar ++ r, w := io.Pipe() ++ defer r.Close() ++ eopkg.Stdout = w ++ tar.Stdin = r ++ tar.Stdout = nil ++ tar.Stderr = nil ++ tar.Dir = rootDir + +- if err = eopkg.Run(); err != nil { ++ eopkg.Start() ++ tar.Start() ++ go func() { ++ defer w.Close() ++ eopkg.Wait() ++ }() ++ if err := tar.Wait(); err != nil { ++ r.Close() + return "", err + } ++ r.Close() + } + +- return filepath.Join(rootDir, "install"), nil ++ return rootDir, nil + } |