summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Viljanen2019-11-30 16:01:13 +0200
committerMatti Viljanen2019-11-30 16:01:13 +0200
commit70c6580630c76eca652b695f6ccc932c6373e38e (patch)
treed24e7da134537da956f923b2c1daf52e5ff8b585
parenta0fb725a1a3f4bdc8581a7a8b1ff9de58efeca00 (diff)
downloadaur-70c6580630c76eca652b695f6ccc932c6373e38e.tar.gz
Use perl instead of grep and sed
-rw-r--r--PKGBUILD2
-rwxr-xr-xupdate_pkg.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 9c07fe07abba..2b4d85b73949 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -27,6 +27,6 @@ prepare() {
}
package() {
- VIVALDI_VERSION=$(grep VIVALDI_VERSION /opt/vivaldi/vivaldi | head -1 | sed "s/'//g" | cut -d. -f-2 | cut -d= -f2)
+ VIVALDI_VERSION=$(cat /opt/vivaldi/vivaldi | perl -ne '/(?:VIVALDI_VERSION=.)(\d*\.\d*)/ and print "$1";')
install -Dm644 "$srcdir/usr/lib/chromium-browser/libffmpeg.so" "$pkgdir/opt/vivaldi/libffmpeg.so.$VIVALDI_VERSION"
}
diff --git a/update_pkg.sh b/update_pkg.sh
index 72b6b32f58a2..a8779390f146 100755
--- a/update_pkg.sh
+++ b/update_pkg.sh
@@ -1,6 +1,6 @@
#!/bin/bash
REPO='http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/'
-PACKAGE=$(wget -qO- $REPO | sed -e 's/<[^>]*>//g' | sed -rn "s/.*(chromium-codecs-ffmpeg-extra_(.*?)-(\w{8}).(.*?)_amd64.deb).*/\1#\2#\3#\4/p" | sort | tail -n 1)
+PACKAGE=$(wget -qO- $REPO | perl -ne '/(?<=href=")(chromium-codecs-ffmpeg-extra_(.*?)-(\w{8}).(.*?)_amd64.deb)(?=")/ and print "$1#$2#$3#$4\n";' | sort | tail -n 1)
deb=$(echo $PACKAGE | cut -d# -f1)
ver1=$(echo $PACKAGE | cut -d# -f2)