Skip to content

Commit

Permalink
Merge branch 'issue-32'
Browse files Browse the repository at this point in the history
  • Loading branch information
sp1ff committed Jul 28, 2023
2 parents b80a4a2 + 4e2951e commit cc1a05a
Show file tree
Hide file tree
Showing 12 changed files with 192 additions and 35 deletions.
79 changes: 70 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Simple workflow to build the package & execute unit tests. Runs:
# Simple workflow to build the package, execute unit tests & test the tarball. Runs:
#
# - on demand
# - on push
Expand All @@ -19,37 +19,98 @@ on:
- cron: '35 01 * * *'

jobs:

# These all seem to run in `/home/runner/work/elfeed-score/elfeed-score`
lint_and_test:
name: Lint & Test
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:

- name: Checkout repo
uses: actions/checkout@v2

- name: Install tooling
shell: bash
run: |
set -ex
pwd
sudo apt-get update
sudo apt-get install -y autoconf automake emacs texlive
sudo apt-get upgrade
sudo apt-get install -y autoconf automake texlive emacs
echo "EMACSLOADPATH=$(pwd):$(pwd)/elfeed:$(pwd)/elfeed/tests:$(ls -d /usr/share/emacs/2*)/lisp" >> $GITHUB_ENV
echo "Will now use the emacs at $(type -p emacs): $(emacs --version|head -n1)"
git clone https://github.com/skeeto/elfeed.git
- name: Install least version of Emacs supported by elfeed-score
if: matrix.os == 'ubuntu-20.04'
shell: bash
run: |
set -ex
pwd
pushd /tmp
curl -LO http://mirrors.ocf.berkeley.edu/gnu/emacs/emacs-26.1.tar.gz
tar xf emacs-26.1.tar.gz && cd emacs-26.1
./configure --prefix=/usr/local --with-x-toolkit=no --with-xpm=no --with-gif=no -with-gnutls=no
make
sudo make install
popd
hash -r
ls /usr/local/share
echo "EMACSLOADPATH=$(pwd):$(pwd)/elfeed:$(pwd)/elfeed/tests:$(ls -d /usr/local/share/emacs/26.1)/lisp" >> $GITHUB_ENV
echo "Will now use the emacs at $(type -p emacs): $(emacs --version|head -n1)"
- name: Install a modern version of automake
shell: bash
run: |
set -x
set -ex
cd /tmp
curl -L -O https://ftp.gnu.org/gnu/automake/automake-1.16.4.tar.xz
tar -xf automake-1.16.4.tar.xz
cd automake-1.16.4
./configure && make
sudo make install
- name: Run unit tests
hash -r
echo "Will now use the automake at $(type -p automake): $(automake --version|head -n1)"
- name: Get the current version number from configure.ac
run: |
set -ex
export version=`awk '/^AC_INIT/ {print substr($2, 2, length($2)-3)}' configure.ac`
echo "ELFEED_SCORE_VERSION=${version}" >> $GITHUB_ENV
echo "version is ${{ env.ELFEED_SCORE_VERSION }}"
- name: Configure & make
shell: bash
run: |
set -x
export EMACSLOADPATH=$(pwd):$(pwd)/elfeed:$(pwd)/elfeed/tests:$(ls -d /usr/share/emacs/2*)/lisp
set -ex
export EMACSLOADPATH=${{ env.EMACSLOADPATH }}
./bootstrap
./configure
make
make check
make distcheck
- name: Run the unit tests
shell: bash
run: |
set -x
export EMACSLOADPATH=${{ env.EMACSLOADPATH }}
make check || cat test/test-suite.log
- name: Check the Autotools distribution
shell: bash
run: |
set -x
pwd
export EMACSLOADPATH=${{ env.EMACSLOADPATH }}
if ! make distcheck; then
cand_build="elfeed-score-${{ env.ELFEED_SCORE_VERSION }}/_build/sub/test/test-suite.log"
cand_inst="elfeed-score-${{ env.ELFEED_SCORE_VERSION }}/_inst/sub/test/test-suite.log"
if -f ${cand_build}; then
cat ${cand_build}
elif -f ${cand_inst}; then
cat {$cand_inst}
fi
fi
2 changes: 1 addition & 1 deletion .github/workflows/melpazoid.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# melpazoid <https://github.com/riscy/melpazoid> build checks.
name: melpazoid
name: Run melpazoid

on:
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Setting up a release workflow for `elfeed-score'. Much thanks to
# BurntShushi from whom I shamelessly copied a lot of this
# <https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml>
name: release
name: Cut a release
on:
# allow this workflow to be triggered manually, which is what this
# event allegedly does
Expand Down
59 changes: 54 additions & 5 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,21 +1,71 @@
2023-07-28 Michael Herstine <[email protected]>

Fix issue #32 Parent dirs in elfeed-score-rule-stats-file are not
Setting `elfeed-score-rule-stats-file` to a path with intermediate
directories that don't exist will error-out. This fix will at
least attempt to create them.

Also, update the CI workflow & generally prep for the merge
(new versions in docs &c)

As an aside, the regression test was originally written using
`file-name-concat' which was only introduced in Emacs 28.1
(we support 26.1). It now uses a purpose-build Emacs Lisp
replacement.

2023-07-27 Michael Herstine <[email protected]>

Fix the Continuous Integration job.
I neglected to do `sudo apt-get update` before doing an `apt-get
install`. This commit remedies that.

2023-07-12 Michael Herstine <[email protected]>

Fix the Continuous Integration job.
I neglected to do `sudo apt-get update` before doing an `apt-get
install`. This commit remedies that.

2023-06-17 Michael Herstine <[email protected]>

Allow the melpazoid check to run on-demand as well as nightly

2023-06-14 Michael Herstine <[email protected]>

Fix make distcheck

2023-06-13 Michael Herstine <[email protected]>

Fix CI

2023-05-06 Michael Herstine <[email protected]>

- Updated the elfeed-score manual to reflect this
- Fixed a unit test that was broken by the previous merge
- Added swflint to AUTHORS
Updating project workflows.

Make release 1.2.6.

Merge branch 'elfeed-enable-configurably'

- Updated the elfeed-score manual to reflect this - Fixed a unit test that was broken by the previous merge - Added swflint to AUTHORS

2023-05-02 Samuel W. Flint <[email protected]>

Add configurability to elfeed-score-scoring-score-entry depth

2023-04-18 Michael Herstine <[email protected]>
2023-04-19 Michael <[email protected]>

Merge pull request #29 from sp1ff/pr-process
Maintenance commit. This commit:

2023-04-19 Michael Herstine <[email protected]>

Maintenance commit. This commit:
- fixes the unit tests
- updates copyrights
- adds a new workflow for PRs
- changes the logic for the "melpazoid" workflow

2023-04-18 Michael Herstine <[email protected]>

Merge branch 'master' of github.com:sp1ff/elfeed-score

Updating the Python version in the Melpazoid checks.
Expand All @@ -25,7 +75,6 @@
Merge pull request #28 from swflint/master
Use with-help-window to make the explanation buffer easily quittable


2023-03-09 Samuel W. Flint <[email protected]>

Use with-help-window to make the explanation buffer easily quittable
Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ elfeed-score News -- history of user-visible changes -*- outline -*-

* elfeed-score 1.2

** changes in elfeed-score 1.2.7

*** address issue #32 Parent dirs in elfeed-score-rule-stats-file are not created automatically

If you set `elfeed-score-rule-stats-file` to a path in which some intermediate directories don't exist, elfeed-score will error on saving stats.
** changes in elfeed-score 1.2.6

*** make the depth at which the scoring function runs configurable in the new entry hook
Expand Down
16 changes: 8 additions & 8 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#+DESCRIPTION: Gnus-style scoring for Elfeed
#+AUTHOR: Michael Herstine
#+EMAIL: [email protected]
#+DATE: <2023-05-06 Sat 08:17>
#+DATE: <2023-07-26 Wed 07:28>
#+AUTODATE: t
#+OPTIONS: toc:nil org-md-headline-style:setext *:t ^:nil
#+STARTUP: overview
Expand Down Expand Up @@ -73,7 +73,7 @@ The easiest way to install elfeed-score is [[https://github.com/melpa/melpa][MEL
If you would prefer to install the package manually, you can also download the Emacs package file on the GitHub releases [[https://github.com/sp1ff/elfeed-score/releases][page]] or from my personal [[https://www.unwoundstack/distros.html][page]]. Then say:

#+BEGIN_SRC elisp
(package-install-file "elfeed-score-1.2.6.tar")
(package-install-file "elfeed-score-1.2.7.tar")
#+END_SRC

** Autotools Source Distributions
Expand All @@ -82,8 +82,8 @@ You can also download Autotools source tarballs (again available either on the G

#+BEGIN_SRC bash
cd /tmp
curl -L --output elfeed-score-1.2.6.tar.gz https://github.com/sp1ff/elfeed-score/releases/download/1.2.6/elfeed-score-1.2.6.tar.gz
tar xvf elfeed-score-1.2.6.tar.gz && cd elfeed-score-1.2.6
curl -L --output elfeed-score-1.2.7.tar.gz https://github.com/sp1ff/elfeed-score/releases/download/1.2.7/elfeed-score-1.2.7.tar.gz
tar xvf elfeed-score-1.2.7.tar.gz && cd elfeed-score-1.2.7
export EMACSLOADPATH=$HOME/.emacs.d/elpa/elfeed-20200209.1942:$EMACSLOADPATH
./configure
make
Expand All @@ -98,16 +98,16 @@ The unit tests require some macros defined by the [[https://github.com/skeeto/el
#+BEGIN_SRC bash
cd /tmp
git clone https://github.com/skeeto/elfeed.git
curl -L --output=elfeed-score-1.2.6.tar.gz https://github.com/sp1ff/elfeed-score/releases/download/1.2.6/elfeed-score-1.2.6.tar.gz
tar xvf elfeed-score-1.2.6.tar.gz && cd elfeed-score-1.2.6
export EMACSLOADPATH=/tmp/elfeed-score-1.2.6:/tmp/elfeed:/tmp/elfeed/tests:$EMACSLOADPATH
curl -L --output=elfeed-score-1.2.7.tar.gz https://github.com/sp1ff/elfeed-score/releases/download/1.2.7/elfeed-score-1.2.7.tar.gz
tar xvf elfeed-score-1.2.7.tar.gz && cd elfeed-score-1.2.7
export EMACSLOADPATH=/tmp/elfeed-score-1.2.7:/tmp/elfeed:/tmp/elfeed/tests:$EMACSLOADPATH
./configure
make
make check
sudo make install
#+END_SRC

Again, unless you already use =EMACSLOADPATH=, you'll need to set =EMACSLOADPATH= appropriately to your system, something like =EMACSLOADPATH=/tmp/elfeed-score-1.2.6:/tmp/elfeed:/tmp/elfeed/tests:/usr/share/emacs/25.2/lisp=.
Again, unless you already use =EMACSLOADPATH=, you'll need to set =EMACSLOADPATH= appropriately to your system, something like =EMACSLOADPATH=/tmp/elfeed-score-1.2.7:/tmp/elfeed:/tmp/elfeed/tests:/usr/share/emacs/25.2/lisp=.
** Building From Source

Finally, you can of course just clone this repo & build there. I've started a [[https://github.com/sp1ff/elfeed-score/wiki][wiki]], whose intended audience are people looking to hack on elfeed-score, that includes build instructions.
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ([2.69])
AC_INIT([elfeed-score], [1.2.6], [[email protected]], [elfeed-score], [https://github.com/sp1ff/elfeed-score])
AC_INIT([elfeed-score], [1.2.7], [[email protected]], [elfeed-score], [https://github.com/sp1ff/elfeed-score])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([./elfeed-score.el])
AC_PROG_MAKE_SET
Expand Down
4 changes: 2 additions & 2 deletions doc/version.texi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@set UPDATED 6 May 2023
@set UPDATED-MONTH May 2023
@set EDITION 1.2.6
@set VERSION 1.2.6
@set EDITION 1.2.7
@set VERSION 1.2.7
2 changes: 1 addition & 1 deletion elfeed-score-pkg.el
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(define-package
"elfeed-score"
"1.2.6"
"1.2.7"
"Gnus-style scoring for Elfeed"
'((emacs "26.1") (elfeed "3.3.0")))
15 changes: 10 additions & 5 deletions elfeed-score-rule-stats.el
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ This is a utility function for persisting LISP S-expressions to
file. If possible, it will write SEXP to a temporary file in the
same directory as FILE-NAME and then rename the temporary file to
replace the original. Since the move operation is usually atomic
\(so long as both the source & the target are on the same volume)
any error leaves the original untouched, and there is never any
instant where the file is nonexistent.
\(so long as both the source & the target are on the same
filesystem) any error leaves the original untouched, and there is
never any instant where the file is nonexistent.
This implementation will first check that the target file is
writable and signal an error if it is not. Note that it will not
Expand All @@ -145,7 +145,7 @@ heavily derivative of `basic-save-buffer-2'."
(if (not (file-directory-p dir))
(if (file-exists-p dir)
(error "%s is not a directory" dir)
(error "%s: no such directory" dir))
(make-directory dir t))
(if (not (file-exists-p file-name))
(error "Directory %s write-protected" dir)
(error "Attempt to save to a file that you aren't allowed to write")))))
Expand Down Expand Up @@ -181,7 +181,11 @@ heavily derivative of `basic-save-buffer-2'."
"Current count of in-memory stats changes.")

(defun elfeed-score-rule-stats-write (stats-file)
"Write the in-memory stats to STATS-FILE."
"Write the in-memory stats to STATS-FILE.
If STATS-FILE doesn't exist, it will be created. If any parent
directories in its path don't exist, and the caller has
permission to create them, they will be created."
(interactive
(list
(read-file-name "stats file: " nil elfeed-score-rule-stats-file t
Expand Down Expand Up @@ -254,6 +258,7 @@ Returns a default-constructed stats object if RULE isn't in the table."
;; `elfeed-update-init-hooks' & restore it here, but I'm uncomfortable
;; with the risk that the update may be interrupted somehow, leaving
;; `elfeed-score-rule-stats-dirty-threshold' "stuck" from then on.

(defun elfeed-score-rule-stats-update-hook (_url)
"Write stats when an elfeed update is complete."
(when (and (eq (elfeed-queue-count-total) 0)
Expand Down
4 changes: 2 additions & 2 deletions elfeed-score.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Copyright (C) 2019-2023 Michael Herstine <[email protected]>

;; Author: Michael Herstine <[email protected]>
;; Version: 1.2.6
;; Version: 1.2.7
;; Package-Requires: ((emacs "26.1") (elfeed "3.3.0"))
;; Keywords: news
;; URL: https://github.com/sp1ff/elfeed-score
Expand Down Expand Up @@ -44,7 +44,7 @@
(require 'elfeed-score-scoring)
(require 'elfeed-score-maint)

(defconst elfeed-score-version "1.2.6")
(defconst elfeed-score-version "1.2.7")

(defgroup elfeed-score nil
"Gnus-style scoring for Elfeed entries."
Expand Down
Loading

0 comments on commit cc1a05a

Please sign in to comment.