From: Bastian Beischer <bastian.beischer@rwth-aachen.de>
To: Seb <spluque@gmail.com>
Cc: Help-Gnu-Emacs <help-gnu-emacs@gnu.org>
Subject: Re: upgrading packages via script
Date: Wed, 27 Sep 2017 16:21:36 +0200 [thread overview]
Message-ID: <CAK9AuB94ch7HEEyOHiiM2kBZE+MAPU6uofkmu7eCGQwpnUwvAA@mail.gmail.com> (raw)
In-Reply-To: <87poadcxx2.fsf@gmail.com>
Hi Seb,
On Tue, Sep 26, 2017 at 4:55 PM, Seb <spluque@gmail.com> wrote:
>
> Hello,
>
> I'm trying to set up a script to upgrade packages using a cron job,
> rather than interactively, as the latter has become a burden. I'm using
> Emacs 25.2.2 from Debian testing, and something is working inherently
> different in the script compared to the interactive session. At any
> given time, the interactive session may display a number of packages
> that can be upgraded, whereas the script fails to find any, even though
> both are run with the same `package-archives' setting.
>
> This is the script I wrote:
>
> ╭───── [ upgrade_packages.el ]
> │ (setq package-archives
> │ (quote
> │ (("gnu" . "http://elpa.gnu.org/packages/")
> │ ("melpa" . "http://melpa.org/packages/")
> │ ("marmalade" . "https://marmalade-repo.org/packages/")
> │ ("org" . "http://orgmode.org/elpa/"))))
> │ (package-initialize)
> │ (list-packages)
> │ (package-menu-mark-upgrades)
> │ (package-menu-execute t)
> ╰─────
>
> and this is how I run it:
>
> ---<--------------------cut here---------------start------------------->---
> $ emacs -q --script upgrade_packages.el
> Loading 00debian-vars...
> Loading /etc/emacs/site-start.d/20apel.el (source)...
> Loading /etc/emacs/site-start.d/50asymptote.el (source)...
> Loading /etc/emacs/site-start.d/50auctex.el (source)...
> Loading /usr/share/emacs/site-lisp/auctex.el (source)...
> Loading /usr/share/emacs/site-lisp/preview-latex.el (source)...
> Loading /etc/emacs/site-start.d/50autoconf.el (source)...
> Loading /etc/emacs/site-start.d/50bbdb3.el (source)...
> Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
> Loading /etc/emacs/site-start.d/50devscripts-el.el (source)...
> Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
> Loading debian-ispell...
> Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
> Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
> Loading /etc/emacs/site-start.d/50dictionary-el.el (source)...
> Loading dictionary-init...
> Loading /etc/emacs/site-start.d/50dpkg-dev-el.el (source)...
> Loading /etc/emacs/site-start.d/50el-get.el (source)...
> Loading /etc/emacs/site-start.d/50emacs-goodies-el.el (source)...
> Loading /etc/emacs/site-start.d/50festival.el (source)...
> Loading /etc/emacs/site-start.d/50flim.el (source)...
> Loading /etc/emacs/site-start.d/50gnugo.el (source)...
> Loading /etc/emacs/site-start.d/50mailutils-mh.el (source)...
> Loading /etc/emacs/site-start.d/50mh-e.el (source)...
> Loading /etc/emacs/site-start.d/50mu4e.el (source)...
> Loading /etc/emacs/site-start.d/50psvn.el (source)...
> Loading /etc/emacs/site-start.d/50pylint.el (source)...
> Loading /etc/emacs/site-start.d/50python-docutils.el (source)...
> Loading /etc/emacs/site-start.d/50texlive-lang-english.el (source)...
> Loading /etc/emacs/site-start.d/50w3m-el-snapshot.el (source)...
> Loading /etc/emacs/site-start.d/51debian-el.el (source)...
> Loading /etc/emacs/site-start.d/51semi.el (source)...
> Loading /etc/emacs/site-start.d/65wl.el (source)...
> Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
> Waiting for refresh to finish...
> No operations specified
> ---<--------------------cut here---------------end--------------------->---
>
> Remove the -q option doesn't make a difference. If I do the same in an
> interactive session, there are a number of packages available for
> upgrade. Any idea why the script fails to work?
You may want to check out the package 'package-utils' which brings the
'package-utils-upgrade-all' function. I'm running this batch script to
do the job:
#!/bin/bash
emacs -q -u $USER -batch -f package-utils-upgrade-all
Cheers
Bastian
>
>
> --
> Seb
>
>
next prev parent reply other threads:[~2017-09-27 14:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-26 14:55 upgrading packages via script Seb
2017-09-27 13:21 ` Michael Heerdegen
2017-09-27 15:33 ` Seb
2017-09-27 22:39 ` Seb
2017-09-27 14:21 ` Bastian Beischer [this message]
2017-09-27 15:31 ` Sebastian P. Luque
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK9AuB94ch7HEEyOHiiM2kBZE+MAPU6uofkmu7eCGQwpnUwvAA@mail.gmail.com \
--to=bastian.beischer@rwth-aachen.de \
--cc=help-gnu-emacs@gnu.org \
--cc=spluque@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).