mirror of
https://github.com/SlackBuildsOrg/slackbuilds
synced 2024-09-28 15:21:00 +02:00
system/betty: Patched, build bump.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
This commit is contained in:
parent
003a2110e1
commit
7c51c9105e
4 changed files with 112 additions and 5 deletions
|
@ -5,3 +5,9 @@ run into situations like this.
|
|||
|
||||
This means you don't have to leave your command line to look up an
|
||||
obscure but useful command. Just ask Betty!
|
||||
|
||||
|
||||
Optional Dependency
|
||||
|
||||
If you want enable the speak functionality, install espeak or any
|
||||
equivalent software and speech-dispatcher.
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#
|
||||
# Slackware build script for betty
|
||||
# Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
|
||||
# 2017 Dhaby Xiloj <slack.dhabyx@gmail.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -23,12 +24,12 @@
|
|||
|
||||
PRGNAM=betty
|
||||
VERSION=${VERSION:-0.1.7}
|
||||
BUILD=${BUILD:-1}
|
||||
BUILD=${BUILD:-2}
|
||||
TAG=${TAG:-_SBo}
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) ARCH=i486 ;;
|
||||
i?86) ARCH=i586 ;;
|
||||
arm*) ARCH=arm ;;
|
||||
*) ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
|
@ -50,6 +51,10 @@ tar xvf $CWD/$PRGNAM-$VERSION.tar.gz -C $PKG/opt/$PRGNAM || tar xvf $CWD/v$VERSI
|
|||
mv $PKG/opt/$PRGNAM/$PRGNAM-$VERSION/* $PKG/opt/$PRGNAM
|
||||
rm -rf $PKG/opt/$PRGNAM/$PRGNAM-$VERSION
|
||||
|
||||
pushd $PKG/opt/$PRGNAM
|
||||
patch -p1 < $CWD/fix-slackware.patch
|
||||
popd
|
||||
|
||||
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
||||
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
PRGNAM="betty"
|
||||
VERSION="0.1.7"
|
||||
HOMEPAGE="https://github.com/pickhardt/betty"
|
||||
DOWNLOAD="https://github.com/pickhardt/betty/archive/v0.1.7.tar.gz"
|
||||
DOWNLOAD="https://github.com/pickhardt/betty/archive/v0.1.7/betty-0.1.7.tar.gz"
|
||||
MD5SUM="c98f5b3733f3eaeeeb531d6a0b4b0062"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES=""
|
||||
MAINTAINER="Ryan P.C. McQuen"
|
||||
EMAIL="ryanpcmcquen@member.fsf.org"
|
||||
MAINTAINER="DhabyX"
|
||||
EMAIL="slack.dhabyx@gmail.com"
|
||||
|
|
96
system/betty/fix-slackware.patch
Normal file
96
system/betty/fix-slackware.patch
Normal file
|
@ -0,0 +1,96 @@
|
|||
diff -Naur betty-0.1.7a/lib/user.rb betty-0.1.7b/lib/user.rb
|
||||
--- betty-0.1.7a/lib/user.rb 2014-09-21 20:23:43.000000000 -0600
|
||||
+++ betty-0.1.7b/lib/user.rb 2017-03-12 16:20:56.147749890 -0600
|
||||
@@ -1,19 +1,19 @@
|
||||
-module User
|
||||
+module User
|
||||
def self.has_command?(command)
|
||||
- response = `which #{ command }`
|
||||
+ response = `which #{ command } 2> /dev/null`
|
||||
response != ""
|
||||
end
|
||||
|
||||
def self.interpret(command)
|
||||
responses = []
|
||||
-
|
||||
+
|
||||
if command.match(/^who\s+am\si$/i) || command.match(/^what\'?s?(\s+is)?\s+my\s(user)?name\??$/i)
|
||||
responses << {
|
||||
:command => "whoami",
|
||||
:explanation => "Gets your system username."
|
||||
}
|
||||
end
|
||||
-
|
||||
+
|
||||
if command.match(/^who\s+am\si$/i) || command.match(/^what\'?s?(\s+is)?\s+my\s((real|full|actual)\s+)?name\??$/i)
|
||||
responses << {
|
||||
:command => "finger $(whoami) | sed 's/.*: *//;q'",
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
if command.match(/^what\'?s?(\s+is)?(\s+my)?\s?(public|external|internal|private|local)?(\s+ip)?\s?(address)?\??$/i)
|
||||
responses << {
|
||||
- :command => "ifconfig",
|
||||
+ :command => "/sbin/ifconfig",
|
||||
:explanation => "Gets your internal ip address."
|
||||
} if not command.match(/(public|external)/)
|
||||
responses << {
|
||||
@@ -31,7 +31,7 @@
|
||||
:explanation => "Gets your external ip address."
|
||||
} if not command.match(/(internal|private|local)/)
|
||||
end
|
||||
-
|
||||
+
|
||||
if command.match(/^who\'?s?(\s+else)?(\s+is)?\s(logged|signed|connected)\s+?in\??$/i)
|
||||
responses << {
|
||||
:command => "who | cut -f 1 -d ' ' | uniq",
|
||||
@@ -45,11 +45,11 @@
|
||||
:explanation => "Shows you your current directory."
|
||||
}
|
||||
end
|
||||
-
|
||||
-
|
||||
+
|
||||
+
|
||||
if command.match(/^what\'?s?(?:\s+is)?(?:\s+(?:the|my))?\s+version(?:\s+of)?(\s[a-zA-Z\-_]+)+\??$/i)
|
||||
program = $1.strip
|
||||
-
|
||||
+
|
||||
command_to_use = ""
|
||||
case program
|
||||
when "go"
|
||||
@@ -61,7 +61,7 @@
|
||||
else
|
||||
command_to_use = "#{ program } --version"
|
||||
end
|
||||
-
|
||||
+
|
||||
responses << {
|
||||
:command => command_to_use,
|
||||
:explanation => "Gets the version of #{ program }."
|
||||
diff -Naur betty-0.1.7a/main.rb betty-0.1.7b/main.rb
|
||||
--- betty-0.1.7a/main.rb 2014-09-21 20:23:43.000000000 -0600
|
||||
+++ betty-0.1.7b/main.rb 2017-03-12 16:13:11.337693583 -0600
|
||||
@@ -135,7 +135,7 @@
|
||||
|
||||
if Internet.connection_enable?
|
||||
|
||||
- if has_afplay || has_mpg123
|
||||
+ if has_afplay
|
||||
require 'open-uri'
|
||||
text = sanitize(text)
|
||||
speech_path = '/tmp/betty_speech.mp3'
|
||||
@@ -156,12 +156,12 @@
|
||||
end
|
||||
else
|
||||
if has_spd_say
|
||||
- system("spd-say -t female2 -m some -r 5 -p -25 -s #{text}")
|
||||
+ system("spd-say -t female2 -m some -r 5 -p -25 -s \"#{text}\"")
|
||||
end
|
||||
end
|
||||
else
|
||||
if has_spd_say
|
||||
- system("spd-say -t female2 -m some -r 5 -p -25 -s #{text}")
|
||||
+ system("spd-say -t female2 -m some -r 5 -p -25 -s \"#{text}\"")
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue