summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Bouvet2020-10-12 11:20:45 +0200
committerQuentin Bouvet2020-10-12 11:20:45 +0200
commit82a7e7a442064b5b87718b7f92942a8d641684bd (patch)
tree6ef2e38e30e9c2e545f8ace9d2546e513ade966b
downloadaur-82a7e7a442064b5b87718b7f92942a8d641684bd.tar.gz
Initial commit
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD38
-rw-r--r--bash-command-timer-git.install35
3 files changed, 88 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..393b6f9f280d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = bash-command-timer-git
+ pkgdesc = Pretty-print execution time for each bash command.
+ pkgver = r39.f1b5412
+ pkgrel = 1
+ url = https://github.com/jichu4n/bash-command-timer
+ install = bash-command-timer-git.install
+ arch = any
+ license = APACHE
+ depends = bash-preexec-git
+ provides = bash-command-timer
+ source = bash-command-timer-git-r39.f1b5412::git+https://github.com/jichu4n/bash-command-timer.git#branch=master
+ md5sums = SKIP
+
+pkgname = bash-command-timer-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..4ba98fd211ff
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,38 @@
+
+# Maintainer: Quentin Bouvet <qbouvet at outlook dot com>
+pkgname=bash-command-timer-git
+provides=(bash-command-timer)
+pkgver=r39.f1b5412
+pkgrel=1
+pkgdesc="Pretty-print execution time for each bash command."
+arch=('any')
+url="https://github.com/jichu4n/bash-command-timer"
+license=('APACHE')
+#makedepends=('')
+depends=('bash-preexec-git')
+
+source=("${pkgname}-${pkgver}::git+https://github.com/jichu4n/bash-command-timer.git#branch=master")
+install="${pkgname}.install"
+md5sums=('SKIP')
+
+pkgver() {
+ cd "$srcdir/$pkgname-$pkgver"
+ # Cf. https://wiki.archlinux.org/index.php/VCS_package_guidelines#Git
+ ( set -o pipefail
+ git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ )
+}
+
+#build() {
+#
+#}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ install -D -m0755 "$srcdir/$pkgname-$pkgver/bash_command_timer.sh" "$pkgdir/usr/share/bash-command-timer/bash_command_timer.sh"
+}
+
+#
+# makepkg --printsrcinfo > .SRCINFO
+#
diff --git a/bash-command-timer-git.install b/bash-command-timer-git.install
new file mode 100644
index 000000000000..b926a89cf1b0
--- /dev/null
+++ b/bash-command-timer-git.install
@@ -0,0 +1,35 @@
+
+bash_command_timer_path=/usr/share/bash-command-timer/bash_command_timer.sh
+preexec_path=/usr/share/bash-prexec/bash_preexec.sh # bash-preexec dependancy
+
+post_install() {
+ printf "\
+>
+>
+> To complete installation, add the following to your bashrc:
+>
+> # Define timer callback functions
+> [[ -f $bash_command_timer_path ]] && source $bash_timer_path
+> # Register callback functions with bash-preexec
+> [[ -f $preexec_path ]] && source $preexec_path
+>
+>
+"
+# echo \"[[ -f $bash_timer_path ]] && source $bash_timer_path\" >> /etc/bash.bashrc
+# echo \"[[ -f $preexec_path ]] && source $preexec_path\" >> /etc/bash.bashrc
+}
+
+post_remove() {
+ printf "\
+>
+>
+> To complete removal, remove the 'source' directives from your bashrc.
+>
+> # Define timer callback functions
+> [[ -f $bash_command_timer_path ]] && source $bash_timer_path
+> # Register callback functions with bash-preexec
+> [[ -f $preexec_path ]] && source $preexec_path
+>
+>
+"
+}