1 |
commit: c0d7f1955c2d84b73f044d672921759f400ce166 |
2 |
Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Feb 23 02:04:18 2020 +0000 |
4 |
Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
5 |
CommitDate: Sun Feb 23 02:04:18 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c0d7f195 |
7 |
|
8 |
app-portage/showbuild: new package |
9 |
|
10 |
from the cj-overlay |
11 |
|
12 |
Package-Manager: Portage-2.3.89, Repoman-2.3.20 |
13 |
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com> |
14 |
|
15 |
app-portage/showbuild/files/showbuild-0.9.1 | 41 +++++++++++++++++++++++++ |
16 |
app-portage/showbuild/metadata.xml | 15 +++++++++ |
17 |
app-portage/showbuild/showbuild-0.9.1-r1.ebuild | 27 ++++++++++++++++ |
18 |
3 files changed, 83 insertions(+) |
19 |
|
20 |
diff --git a/app-portage/showbuild/files/showbuild-0.9.1 b/app-portage/showbuild/files/showbuild-0.9.1 |
21 |
new file mode 100644 |
22 |
index 0000000..2026dfc |
23 |
--- /dev/null |
24 |
+++ b/app-portage/showbuild/files/showbuild-0.9.1 |
25 |
@@ -0,0 +1,41 @@ |
26 |
+#!/bin/bash |
27 |
+ |
28 |
+log="$(portageq envvar PORTAGE_TMPDIR)/portage/*/*/temp/build.log" |
29 |
+cmd="${SB:-tail -f}" |
30 |
+c=0 |
31 |
+ |
32 |
+die() { echo -e "$*" >&2; exit 1; } |
33 |
+ |
34 |
+if [[ $1 = -h || $1 = --help ]]; then |
35 |
+ echo "Script to follow log of running portage builds" |
36 |
+ echo |
37 |
+ echo "Usage: ${0##*/} # see running builds" |
38 |
+ echo " ${0##*/} N # follow build #N" |
39 |
+ echo " ${0##*/} --fetch # follow emerge-fetch.log" |
40 |
+ echo " ${0##*/} --help # show this help" |
41 |
+ echo |
42 |
+ echo "Use environment variable SB to override the default cmd ($cmd)" |
43 |
+elif [[ $1 = -f || $1 = --fetch ]]; then |
44 |
+ log="$(portageq envvar EMERGE_LOG_DIR)" |
45 |
+ log="${log:=$(portageq envvar EPREFIX)/var/log}/emerge-fetch.log" |
46 |
+ [[ -f $log ]] || die "Could open '$log'" |
47 |
+ exec $cmd $log |
48 |
+elif [[ $(echo $log) = "$log" ]]; then |
49 |
+ echo "No running build found (try '${0##*/} --help')" |
50 |
+elif [[ ! $1 ]]; then |
51 |
+ echo "Running builds - use '${0##*/} NUMBER' to select" |
52 |
+ for i in $log; do |
53 |
+ [[ $i =~ ^${log%%\**}([^/]*)/([^/]*)${log##*\*}$ ]] || continue |
54 |
+ echo -e "$((++c))\t${BASH_REMATCH[2]}\t(${BASH_REMATCH[1]})" |
55 |
+ done |
56 |
+else |
57 |
+ [[ -z ${1//[0-9]} && $1 -gt 0 ]] || die "Argument should be a number greater 0" |
58 |
+ for i in $log; do |
59 |
+ [[ $i =~ ^${log%%\**}([^/]*)/([^/]*)${log##*\*}$ ]] || continue |
60 |
+ [[ $((++c)) -eq $((10#$1)) ]] || continue |
61 |
+ [[ -f ${i} ]] || die "Build number $1 was gone in the meanwhile" |
62 |
+ echo -ne "\033]0;Viewing: ${BASH_REMATCH[2]}\t(${BASH_REMATCH[1]})\007" |
63 |
+ exec $cmd $i |
64 |
+ done |
65 |
+ die "Build number $1 not found (there are only $((c--)) build(s) running)" |
66 |
+fi |
67 |
|
68 |
diff --git a/app-portage/showbuild/metadata.xml b/app-portage/showbuild/metadata.xml |
69 |
new file mode 100644 |
70 |
index 0000000..d9c0c63 |
71 |
--- /dev/null |
72 |
+++ b/app-portage/showbuild/metadata.xml |
73 |
@@ -0,0 +1,15 @@ |
74 |
+<?xml version="1.0" encoding="UTF-8"?> |
75 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
76 |
+<pkgmetadata> |
77 |
+ <maintainer type="person"> |
78 |
+ <email>lssndrbarbieri@×××××.com</email> |
79 |
+ <name>Alessandro Barbieri</name> |
80 |
+ </maintainer> |
81 |
+ <upstream> |
82 |
+ <maintainer> |
83 |
+ <email>ottxor@g.o</email> |
84 |
+ <name>Christoph Junghans</name> |
85 |
+ </maintainer> |
86 |
+ <remote-id type="github">junghans/cj-overlay</remote-id> |
87 |
+ </upstream> |
88 |
+</pkgmetadata> |
89 |
|
90 |
diff --git a/app-portage/showbuild/showbuild-0.9.1-r1.ebuild b/app-portage/showbuild/showbuild-0.9.1-r1.ebuild |
91 |
new file mode 100644 |
92 |
index 0000000..d3e8c45 |
93 |
--- /dev/null |
94 |
+++ b/app-portage/showbuild/showbuild-0.9.1-r1.ebuild |
95 |
@@ -0,0 +1,27 @@ |
96 |
+# Copyright 1999-2020 Gentoo Authors |
97 |
+# Distributed under the terms of the GNU General Public License v2 |
98 |
+ |
99 |
+EAPI="7" |
100 |
+ |
101 |
+DESCRIPTION="Script to follow log of running portage builds" |
102 |
+HOMEPAGE="https://github.com/junghans/cj-overlay" |
103 |
+SRC_URI="" |
104 |
+ |
105 |
+LICENSE="GPL-2" |
106 |
+SLOT="0" |
107 |
+KEYWORDS="~amd64 ~arm ~x86 ~x86-linux ~x64-macos ~x86-macos" |
108 |
+ |
109 |
+IUSE="" |
110 |
+ |
111 |
+DEPEND="" |
112 |
+RDEPEND=" |
113 |
+ sys-apps/coreutils |
114 |
+ sys-apps/portage |
115 |
+ app-shells/bash |
116 |
+" |
117 |
+ |
118 |
+S="${FILESDIR}" |
119 |
+ |
120 |
+src_install () { |
121 |
+ newbin "${P}" "${PN}" |
122 |
+} |