summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Beard2023-05-07 21:53:11 +0100
committerJohn Beard2023-05-07 21:54:52 +0100
commit67f9e41e8857bd6405fcd3f44f164f7cd839d02f (patch)
tree1fc5efe5cea6dd61db54e2136257a7a6d11bb5d8
parentff6f943d70baa77c80d64409b5c694ada6187f28 (diff)
downloadaur-goldendict-cc-cedict-content.tar.gz
Move extracted filename to global scope
I'm pretty sure prepare() should have put that in the global scope by the time pkgver() happens, but I got a report that it wasn't working and this should be as good. Also fix a typo in a comment.
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD18
2 files changed, 10 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6a2e034660fc..d5d8dc9e152c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = goldendict-cc-cedict-content
pkgdesc = CC-CEDICT Chinese-English Dictionary for Goldendict
- pkgver = 1.0_r20230219
+ pkgver = 1.0_r20230506
pkgrel = 1
url = https://www.mdbg.net/chinese/dictionary?page=cedict
install = goldendict-cc-cedict-content.install
diff --git a/PKGBUILD b/PKGBUILD
index 458e53a1cc3d..6eb401ac3775 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
# Maintainer: John Beard <john.j.beard@gmail.com>
pkgname=goldendict-cc-cedict-content
-pkgver=1.0_r20230219
+pkgver=1.0_r20230506
pkgrel=1
pkgdesc="CC-CEDICT Chinese-English Dictionary for Goldendict"
arch=("any")
@@ -21,22 +21,22 @@ md5sums=('729e16b892fb38a6d1c5853330191e93'
'747cb41a7c6ddb22a508164f768dae2a'
'SKIP')
+_extractedFile="cedict.txt"
+
prepare() {
cd "${srcdir}"
- extracted="cedict.txt"
-
- gzip -d -c cedict*.txt.gz > ${extracted}
+ gzip -d -c cedict*.txt.gz > ${_extractedFile}
}
pkgver() {
cd "${srcdir}"
- version=$(grep -m 100 '#! version' ${extracted} | cut -d'=' -f2 | tr -d '\r\n')
- subversion=$(grep -m 100 '#! subversion' ${extracted} | cut -d= -f2 | tr -d '\r\n')
- datecode=$(grep -m 100 '#! date' ${extracted} | cut -d= -f2 | cut -dT -f1 | tr -d '\r\n-')
+ version=$(grep -m 100 '#! version' ${_extractedFile} | cut -d'=' -f2 | tr -d '\r\n')
+ subversion=$(grep -m 100 '#! subversion' ${_extractedFile} | cut -d= -f2 | tr -d '\r\n')
+ datecode=$(grep -m 100 '#! date' ${_extractedFile} | cut -d= -f2 | cut -dT -f1 | tr -d '\r\n-')
verstr="${version}.${subversion}_r${datecode}"
@@ -48,13 +48,13 @@ build() {
cd "${srcdir}"
# convert to Stardict format
- pyglossary cedict.txt cc-cedict.ifo\
+ pyglossary ${_extractedFile} cc-cedict.ifo\
--read-format=CC-CEDICT --write-format=Stardict
# update the bookname: this is what GoldenDict will display as the dictionary name
sed -i 's/bookname=.*/bookname=CC-CEDICT/' cc-cedict.ifo
- # the .ifo version field if the Stardict format version, _not_ the dictionary version
+ # the .ifo version field is the Stardict format version, _not_ the dictionary version
# zip the dict file to save installation space
# gzip -c cc-cedict.dict > cc-cedict.dict.dz