summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO12
-rw-r--r--.gitignore7
-rw-r--r--Makefile31
-rw-r--r--PKGBUILD19
-rw-r--r--requirements.txt3
-rw-r--r--source.ini11
-rwxr-xr-xupdate.sh35
7 files changed, 118 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..77be26666f29
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,12 @@
+pkgbase = dive
+ pkgdesc = A tool for exploring each layer in a docker image
+ pkgver = 0.0.8
+ pkgrel = 1
+ url = https://github.com/wagoodman/dive
+ arch = x86_64
+ license = MIT
+ source_x86_64 = https://github.com/wagoodman/dive/releases/download/v0.0.8/dive_0.0.8_linux_amd64.tar.gz
+ md5sums_x86_64 = 56cdcd34bbbc6e8b668927020fb1b25c
+
+pkgname = dive
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..140b04d3f05d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+pkg/**
+src/**
+**.pkg.tar
+**.tgz
+**.tar.gz
+venv/*
+new_ver.txt
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..2edd2db8d424
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,31 @@
+# SHELL:=/bin/bash
+.DEFAULT_GOAL:=update
+
+export ROOTDIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
+export VIRTUAL_ENV:=$(ROOTDIR)/venv
+
+## Install all dependencies
+# Usage:
+# make deps
+deps:
+ @cd "$(ROOTDIR)"
+ @if [ ! -d $(VIRTUAL_ENV)/bin ] ; \
+ then \
+ virtualenv --python=python3 "$(VIRTUAL_ENV)" ;\
+ fi
+ @. $(VIRTUAL_ENV)/bin/activate ; \
+ $(VIRTUAL_ENV)/bin/pip3 install -r $(ROOTDIR)/requirements.txt -q
+
+
+## Check for updates
+## will update "new_ver.txt"
+
+## Update (automatic)
+update: deps
+ nvchecker source.ini
+ ./update.sh wagoodman/dive
+ makepkg --printsrcinfo > .SRCINFO
+
+clean:
+ rm -rf src pkg *.tar.xz *.gz *.pkg.tar *.tar.gz
+ rm -rf $(VIRTUAL_ENV)
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d041fed55f25
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,19 @@
+# Maintainer: David Stark <david@starkers.org>
+
+pkgname=dive
+pkgver=0.0.8
+_build=${pkgver}
+pkgrel=1
+pkgdesc="A tool for exploring each layer in a docker image"
+url="https://github.com/wagoodman/dive"
+arch=("x86_64")
+license=("MIT")
+conflicts=()
+
+source_x86_64=("https://github.com/wagoodman/dive/releases/download/v${pkgver}/dive_${pkgver}_linux_amd64.tar.gz")
+md5sums_x86_64=("56cdcd34bbbc6e8b668927020fb1b25c")
+
+package() {
+ install -d ${pkgdir}/usr/bin
+ install -Dm755 ${srcdir}/dive ${pkgdir}/usr/bin/dive
+}
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 000000000000..8930223f7063
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,3 @@
+aiohttp
+tornado
+nvchecker
diff --git a/source.ini b/source.ini
new file mode 100644
index 000000000000..22610ac5c98f
--- /dev/null
+++ b/source.ini
@@ -0,0 +1,11 @@
+[__config__]
+oldver = old_ver.txt
+newver = new_ver.txt
+
+
+
+[src]
+github = wagoodman/dive
+; github = geofffranks/spruce
+; use_latest_release = true
+use_max_tag = true
diff --git a/update.sh b/update.sh
new file mode 100755
index 000000000000..1ad55925be14
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+verold="$(grep ^pkgver= PKGBUILD | cut -d "=" -f 2)"
+oldrel="$(grep ^pkgrel= PKGBUILD | cut -d "=" -f 2)"
+md5old="$(grep md5sums_x86_64 PKGBUILD | cut -d '"' -f 2)"
+newrel=$(($oldrel + 1))
+
+pkgver="$(cat new_ver.txt | awk '{print $2}'| sed "s+v++")"
+
+if [ X${verold} == X${pkgver} ]; then
+ echo "NO UPDATE DETECTED (old: ${verold}, new: ${pkgver} - $1)"
+ exit 0
+fi
+
+# determine new md5sum
+tempdir="$(mktemp -d)"
+tempfile="${tempdir}/filename"
+curl -sL https://github.com/wagoodman/dive/releases/download/v${pkgver}/dive_${pkgver}_linux_amd64.tar.gz -o "${tempfile}"
+md5new="$(md5sum "${tempfile}" | awk '{print $1}')"
+# rm -rf "${tempdir}"
+
+echo md5old=${md5old}, md5new=${md5new}
+
+#update the buildfile
+sed "s+pkgver=${verold}+pkgver=${pkgver}+g" -i PKGBUILD
+sed "s+pkgrel=${oldrel}+pkgrel=${newrel}+g" -i PKGBUILD
+sed "s+${md5old}+${md5new}+g" -i PKGBUILD
+
+set -eu
+
+makepkg -f
+
+#update srcinfo
+makepkg --printsrcinfo > .SRCINFO
+