~alpine/aports

1

[alpine-aports] [PATCH] testing/apk-post-messages: new aport

Details
Message ID
<1436621412-47637-1-git-send-email-developer@it-offshore.co.uk>
Sender timestamp
1436621412
DKIM signature
missing
Download raw message
Patch: +44 -0
This is a trigger for doc packages. If a /usr/share/doc/$pkg/README.alpine
exists it will cat the file.

Some examples of the output: http://hastebin.com/aronohenuk.sm

I tried creating a trigger to monitor /usr/share/doc/*/README.alpine but the
apk trigger seems to only monitor directories.

To monitor a specific file(s) the patched 'inotify-tools-inc' with an --include
regex works.
---
 testing/apk-post-messages/APKBUILD                 | 25 ++++++++++++++++++++++
 .../apk-post-messages/apk-post-messages.trigger    | 19 ++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 testing/apk-post-messages/APKBUILD
 create mode 100644 testing/apk-post-messages/apk-post-messages.trigger

diff --git a/testing/apk-post-messages/APKBUILD b/testing/apk-post-messages/APKBUILD
new file mode 100644
index 0000000..dad2aa6
--- /dev/null
+++ b/testing/apk-post-messages/APKBUILD
@@ -0,0 +1,25 @@
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=apk-post-messages
pkgver=0.10
pkgrel=0
pkgdesc="Print apk post-install messages"
url="http://alpinelinux.org"
arch="noarch"
license="GPL"
depends="apk-tools"
triggers="$pkgname.trigger=/usr/share/doc/*"
source=""

_builddir="$srcdir"

build() {
	cd "$_builddir"
	echo "Building $pkgname trigger package"
}

package() {
	cd "$_builddir"
	mkdir -p "$pkgdir"
}

diff --git a/testing/apk-post-messages/apk-post-messages.trigger b/testing/apk-post-messages/apk-post-messages.trigger
new file mode 100644
index 0000000..a7fb21e
--- /dev/null
+++ b/testing/apk-post-messages/apk-post-messages.trigger
@@ -0,0 +1,19 @@
#!/bin/sh

files="README.alpine README.Alpine README.ALPINE"

for i; do
	for x in $files; do
		if [ -f "$i/$x" ]; then
			msg="| $i: $x |"
			msg_len=$(( $(echo $msg |wc -m) - 1))
			printf "%${msg_len}s" | sed 's/ /-/g'
			echo -e "\n$msg"
			printf "%${msg_len}s" | sed 's/ /=/g'
			echo -e "\n"
			cat $i/$x
			echo -e; break
		fi
	done
done

-- 
2.4.5



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20150713085601.0d4d7cfb@ncopa-desktop.alpinelinux.org>
In-Reply-To
<1436621412-47637-1-git-send-email-developer@it-offshore.co.uk> (view parent)
Sender timestamp
1436770561
DKIM signature
missing
Download raw message
On Sat, 11 Jul 2015 13:30:12 +0000
Stuart Cardall <developer@it-offshore.co.uk> wrote:

> This is a trigger for doc packages. If a /usr/share/doc/$pkg/README.alpine
> exists it will cat the file.
> 
> Some examples of the output: http://hastebin.com/aronohenuk.sm
> 
> I tried creating a trigger to monitor /usr/share/doc/*/README.alpine but the
> apk trigger seems to only monitor directories.
> 
> To monitor a specific file(s) the patched 'inotify-tools-inc' with an --include
> regex works.
> ---
>  testing/apk-post-messages/APKBUILD                 | 25 ++++++++++++++++++++++
>  .../apk-post-messages/apk-post-messages.trigger    | 19 ++++++++++++++++
>  2 files changed, 44 insertions(+)
>  create mode 100644 testing/apk-post-messages/APKBUILD
>  create mode 100644 testing/apk-post-messages/apk-post-messages.trigger
> 
> diff --git a/testing/apk-post-messages/APKBUILD b/testing/apk-post-messages/APKBUILD
> new file mode 100644
> index 0000000..dad2aa6
> --- /dev/null
> +++ b/testing/apk-post-messages/APKBUILD
> @@ -0,0 +1,25 @@
> +# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
> +# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
> +pkgname=apk-post-messages
> +pkgver=0.10
> +pkgrel=0
> +pkgdesc="Print apk post-install messages"
> +url="http://alpinelinux.org"
> +arch="noarch"
> +license="GPL"
> +depends="apk-tools"
> +triggers="$pkgname.trigger=/usr/share/doc/*"
> +source=""
> +
> +_builddir="$srcdir"
> +
> +build() {
> +	cd "$_builddir"
> +	echo "Building $pkgname trigger package"
> +}
> +
> +package() {
> +	cd "$_builddir"
> +	mkdir -p "$pkgdir"
> +}
> +
> diff --git a/testing/apk-post-messages/apk-post-messages.trigger b/testing/apk-post-messages/apk-post-messages.trigger
> new file mode 100644
> index 0000000..a7fb21e
> --- /dev/null
> +++ b/testing/apk-post-messages/apk-post-messages.trigger
> @@ -0,0 +1,19 @@
> +#!/bin/sh
> +
> +files="README.alpine README.Alpine README.ALPINE"

I think we can use only README.alpine to force consistency.

> +
> +for i; do
> +	for x in $files; do
> +		if [ -f "$i/$x" ]; then
> +			msg="| $i: $x |"
> +			msg_len=$(( $(echo $msg |wc -m) - 1))
> +			printf "%${msg_len}s" | sed 's/ /-/g'
> +			echo -e "\n$msg"
> +			printf "%${msg_len}s" | sed 's/ /=/g'
> +			echo -e "\n"
> +			cat $i/$x
> +			echo -e; break
> +		fi
> +	done
> +done
> +



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)