X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id D7F10DC19F5 for ; Sat, 11 Jul 2015 13:30:30 +0000 (UTC) Received: from apollo.thewebhostserver.com (apollomail.thewebhostserver.com [46.23.65.248]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id AE39ADC01AA for ; Sat, 11 Jul 2015 13:30:25 +0000 (UTC) Received: from [81.4.121.188] (port=52689 helo=localhost.localdomain) by apollo.thewebhostserver.com with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.85) (envelope-from ) id 1ZDurF-0008ta-PY; Sat, 11 Jul 2015 14:30:21 +0100 From: Stuart Cardall To: alpine-aports@lists.alpinelinux.org Cc: Stuart Cardall Subject: [alpine-aports] [PATCH] testing/apk-post-messages: new aport Date: Sat, 11 Jul 2015 13:30:12 +0000 Message-Id: <1436621412-47637-1-git-send-email-developer@it-offshore.co.uk> X-Mailer: git-send-email 2.4.5 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - apollo.thewebhostserver.com X-AntiAbuse: Original Domain - lists.alpinelinux.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - it-offshore.co.uk X-Get-Message-Sender-Via: apollo.thewebhostserver.com: authenticated_id: developer@it-offshore.co.uk X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: ClamAV using ClamSMTP X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: 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 +# Maintainer: Stuart Cardall +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 ---