From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Bastian Beischer Newsgroups: gmane.emacs.help Subject: Re: upgrading packages via script Date: Wed, 27 Sep 2017 16:21:36 +0200 Message-ID: References: <87poadcxx2.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1506522155 26216 195.159.176.226 (27 Sep 2017 14:22:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 27 Sep 2017 14:22:35 +0000 (UTC) Cc: Help-Gnu-Emacs To: Seb Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 27 16:22:25 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxDED-00062b-SV for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Sep 2017 16:22:22 +0200 Original-Received: from localhost ([::1]:55039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxDEK-0001In-V8 for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Sep 2017 10:22:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxDDc-0001Dn-3U for help-gnu-emacs@gnu.org; Wed, 27 Sep 2017 10:21:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxDDX-0007Zg-N9 for help-gnu-emacs@gnu.org; Wed, 27 Sep 2017 10:21:44 -0400 Original-Received: from mail-yw0-x22d.google.com ([2607:f8b0:4002:c05::22d]:48803) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dxDDX-0007Wy-HZ for help-gnu-emacs@gnu.org; Wed, 27 Sep 2017 10:21:39 -0400 Original-Received: by mail-yw0-x22d.google.com with SMTP id u205so9403400ywa.5 for ; Wed, 27 Sep 2017 07:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=h4ThxRZd0UcID91noSWFy4ZYuEqsHm2PekT8DRZieXE=; b=PjaR8hyp57eLibU31hPo+3umNF/i265d8tJ9rjiSZIm+bGJDHfxMACNTEpAyLuKtc3 Y8wN30C0Tni45+f10nTFmnrtDTKi/ElGyYN9GFYx4+iy5BhHCbxh4aGaKqSoDRQJGM2D fmxJfyr/9RlKg/I/1d5bPtefyyE4dLFMosgT2uL3sYUnFc49sESWlTWm4wzfSm8H+zVi On1aT47RtE6FL30y3VPx9CC6t1PCDVrKs/Pw5pMaKy2AUZiKohklSK4AZMx72Ou/nZWN VCHNEM2Vn0z1iQyE+Yw09DgdwvGHuZlx+fYhMduPV08Vbpyge5JUTDpTGhA9WZtWyLb/ ZRJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=h4ThxRZd0UcID91noSWFy4ZYuEqsHm2PekT8DRZieXE=; b=F7pCIkhLXWpEJVyGIbE4InlI429PfrrWmBxHudI8gM0f9La5/3mL2AbsG0NqwKUhH8 +Bmkih7+BXMznaKTD97SPoFXtF5q96Vv5KNqaTwQYcUFLDeHUFZtNRc4HhFdNUlca+rE BnWehey/Gnnmuujdq3PdoAmm14CZ2yeWRNmdhjH6evAPBpS4ZQeyyqz0bcFS/ZoU8hyK UUjaJCBc3dbNJzLoBu1JhuW2EXjD2IJ8uKFPahsfwGrcDkPO/524vcmYn22Ee9097F6z YjbcrcNU05DFfLNlPuZ10jp0v6kj9so88QY3v0uosbKAySqtLyfGf+R+I6TJLrintdfI NYHg== X-Gm-Message-State: AHPjjUjfQA2oDurE4KOpYBTTpNSwb0V/h7PE+Hx8cVeEwWBAda4SJgBn +0QmcoxdYSwSQbayOxBzjPybgkTGlaieiThnGjk= X-Google-Smtp-Source: AOwi7QDR8Am10ePQv+LYLIj047VRT0orCxkTAF3fqXQB3eKGb9kuVleHbYG7CrsgZ4QdecdCzujExrO1fi2Hr2DjqvM= X-Received: by 10.13.208.69 with SMTP id s66mr1033931ywd.450.1506522097563; Wed, 27 Sep 2017 07:21:37 -0700 (PDT) Original-Received: by 10.129.99.6 with HTTP; Wed, 27 Sep 2017 07:21:36 -0700 (PDT) In-Reply-To: <87poadcxx2.fsf@gmail.com> X-Google-Sender-Auth: -aZ85OQ7jd5JyJV1xNs20DEoQAs X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4002:c05::22d X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:114439 Archived-At: Hi Seb, On Tue, Sep 26, 2017 at 4:55 PM, Seb 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: > > =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 [ upgrade_packages= .el ] > =E2=94=82 (setq package-archives > =E2=94=82 (quote > =E2=94=82 (("gnu" . "http://elpa.gnu.org/packages/") > =E2=94=82 ("melpa" . "http://melpa.org/packages/") > =E2=94=82 ("marmalade" . "https://marmalade-repo.org/packages/") > =E2=94=82 ("org" . "http://orgmode.org/elpa/")))) > =E2=94=82 (package-initialize) > =E2=94=82 (list-packages) > =E2=94=82 (package-menu-mark-upgrades) > =E2=94=82 (package-menu-execute t) > =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > > 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 =E2=80=98package-selected-packages=E2=80=99 temporarily since "em= acs -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 > >