diff options
author | dtbaumann | 2016-01-16 10:22:54 +0100 |
---|---|---|
committer | dtbaumann | 2016-01-16 10:22:54 +0100 |
commit | ab51c194ced721114a1ba85ee939fd615329da20 (patch) | |
tree | f2602f4b86b17b4fd70c2e24d14bc790a1169bf9 | |
parent | 8372bdb247f2c2d240cbae107756fe6b37cf18a2 (diff) | |
download | aur-ab51c194ced721114a1ba85ee939fd615329da20.tar.gz |
Make sure that the database is stored in the known directory; make sure that database is readable to prevent infinite loop (phreeqc.el)
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 11 | ||||
-rw-r--r-- | phreeqc.el | 20 |
3 files changed, 25 insertions, 14 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Tue Dec 15 19:19:22 UTC 2015 +# Sat Jan 16 09:19:03 UTC 2016 pkgbase = phreeqc - pkgdesc = PHREEQC - A Computer Program for Speciation, Batch-Reaction, One-Dimensional Transport, and Inverse Geochemical Calculations + pkgdesc = A Computer Program for Speciation, Batch-Reaction, One-Dimensional Transport, and Inverse Geochemical Calculations pkgver = 3.3.3 - pkgrel = 3 + pkgrel = 5 url = http://wwwbrr.cr.usgs.gov/projects/GWC_coupled/phreeqc/ install = install.sh arch = i686 @@ -16,7 +16,7 @@ pkgbase = phreeqc source = https://raw.githubusercontent.com/jaalto/project-emacs--folding-mode/master/folding.el md5sums = b4b1f11e5855d3b034473ec51c76f7cc md5sums = 8facd6e784cd1985b2c57c092b753002 - md5sums = 81a6827b2d0d1d2675cbf4e117095208 + md5sums = 98b0c08bd9bc4adb2ffe6706d4411b4e md5sums = d262512bd4a19a68805914d35f8f9019 pkgname = phreeqc @@ -2,8 +2,8 @@ pkgname=phreeqc pkgver=3.3.3 _pkgsvn=10424 -pkgrel=3 -pkgdesc="PHREEQC - A Computer Program for Speciation, Batch-Reaction, One-Dimensional Transport, and Inverse Geochemical Calculations" +pkgrel=5 +pkgdesc="A Computer Program for Speciation, Batch-Reaction, One-Dimensional Transport, and Inverse Geochemical Calculations" arch=('i686' 'x86_64') url="http://wwwbrr.cr.usgs.gov/projects/GWC_coupled/phreeqc/" license=('custom') @@ -25,7 +25,7 @@ source=("ftp://brrftp.cr.usgs.gov/pub/charlton/phreeqc/phreeqc-$pkgver-$_pkgsvn. "https://raw.githubusercontent.com/jaalto/project-emacs--folding-mode/master/folding.el") md5sums=('b4b1f11e5855d3b034473ec51c76f7cc' '8facd6e784cd1985b2c57c092b753002' - '81a6827b2d0d1d2675cbf4e117095208' + '98b0c08bd9bc4adb2ffe6706d4411b4e' 'd262512bd4a19a68805914d35f8f9019') build() { @@ -39,6 +39,11 @@ package() { make DESTDIR="${pkgdir}" install + # move database and example files into previous location + mkdir -p ${pkgdir}/usr/share/phreeqc/ + mv ${pkgdir}/usr/share/doc/phreeqc/database ${pkgdir}/usr/share/phreeqc/ + mv ${pkgdir}/usr/share/doc/phreeqc/examples ${pkgdir}/usr/share/phreeqc/ + # install supplementary files mkdir -p ${pkgdir}/usr/share/emacs/site-lisp/$pkgname diff --git a/phreeqc.el b/phreeqc.el index 93366e4708da..6fdb9c6463df 100644 --- a/phreeqc.el +++ b/phreeqc.el @@ -461,13 +461,19 @@ with no args, if that value is non-nil." (if (re-search-forward "^DATABASE \\(.*.dat\\)" nil t) (setq database (match-string 1)))) - (with-temp-file ctrlfile - (insert infile "\n" - outfile "\n" - database "\n")) - - (call-process phreeqc-compile-command ctrlfile "*phreeqc*" nil) - (delete-file ctrlfile))) + ;; make sure that the database file is readable + (if (not (file-readable-p database)) + (progn (goto-char 0) + (re-search-forward "^DATABASE \\(.*.dat\\)" nil t) + (message "Database file \"%s\" not found, please check your input file." + database)) + (with-temp-file ctrlfile + (insert infile "\n" + outfile "\n" + database "\n")) + + (call-process phreeqc-compile-command ctrlfile "*phreeqc*" nil) + (delete-file ctrlfile)))) (defun phreeqc-visit-output () |