GNU bug report logs - #23237
Strange behavior of `package` in automated install in init script

Previous Next

Package: emacs;

Reported by: Alex Coventry <alx <at> empirical.com>

Date: Thu, 7 Apr 2016 15:28:02 UTC

Severity: normal

Tags: notabug

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23237 in the body.
You can then email your comments to 23237 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#23237; Package emacs. (Thu, 07 Apr 2016 15:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Coventry <alx <at> empirical.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 07 Apr 2016 15:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alex Coventry <alx <at> empirical.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Strange behavior of `package` in automated install in init script
Date: Thu, 7 Apr 2016 02:00:53 -0400
[Message part 1 (text/plain, inline)]
This is a report of two bugs in a fresh install of emacs on the
ubuntu:14.04 docker image and the following elisp in install-package.el

  (require 'package)
  (add-to-list
   'package-archives
   '("melpa" . "http://melpa.org/packages/")
   t)
  (package-initialize)
  (package-refresh-contents)
  (message (format "package contents: %s" package-archive-contents))
  (package-install "evil")

The first bug is that both of the shell commands result in "not enough
arguments for format string".  Something is strange about the value of
package-archive-contents at that time.

  root <at> cecce30d6adf:/emacs# emacs -l install-package.el
  root <at> cecce30d6adf:/emacs# emacs -batch --eval '(setq user-init-file
"~/.emacs")' -l install-package.el

However, the (format) command works just fine when invoked interactively
after the install-package.el command has failed.

The second (original) bug is that both shell commands result in the
complaint `Package `evil-' is unavailable` if you comment out the (message)
sexp.

I would like to be able to use `package-install` in an automated way like
this in order to build docker containers for emacs.

The following docker file built the container I was testing in, and will be
available at alxempirical/emacs-git-master as soon as it's pushed.  (It's
on the order of a gig, though.)

Best regards,
Alex

FROM ubuntu:14.04
RUN apt-get update && apt-get upgrade -y
RUN apt-get build-dep -y emacs
RUN apt-get install -y git ncurses-dev autoconf automake
RUN git clone git://git.savannah.gnu.org/emacs.git
WORKDIR emacs
RUN ./autogen.sh
RUN ./autogen.sh git
RUN apt-get install -y texinfo
RUN ./configure
RUN make install
COPY install-package.el /


In GNU Emacs 25.1.50.1 (x86_64-unknown-linux-gnu)
 of 2016-04-07 built on f0726407848b
Repository revision: 1f6b0bc1512de08fd542df0234476788038c8c82
System Description: Ubuntu 14.04.4 LTS

Configured features:
SOUND NOTIFY

Important settings:
  locale-coding-system: nil

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Importing package-keyring.gpg...done
Contacting host: elpa.gnu.org:80 [2 times]
Contacting host: melpa.org:80
Package refresh done [2 times]
Saving file /root/.emacs...
Wrote /root/.emacs [2 times]
package-compute-transaction: Package ‘evil-’ is unavailable
Quit
Type C-x 1 to delete the help window.

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail regexp-opt eieio-opt speedbar
sb-image ezimage image dframe find-func thingatpt help-fns cus-edit
cus-start cus-load wid-edit mm-archive message dired dired-loaddefs
format-spec rfc822 mml mml-sec epa derived gnus-util rmail tool-bar
rmail-loaddefs mailabbrev gmm-utils mailheader mm-decode mm-bodies
mm-encode mail-utils network-stream starttls url-http tls gnutls
mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw
nsm puny seq url-cache url-auth url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf url-util mailcap epg
term/xterm xterm time-date finder-inf package epg-config url-handlers
url-parse auth-source cl-seq eieio byte-opt bytecomp byte-compile
cl-extra help-mode easymenu cconv eieio-core cl-macs gv eieio-loaddefs
cl-loaddefs pcase cl-lib password-cache url-vars disp-table mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select mouse jit-lock font-lock syntax
facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote inotify multi-tty
make-network-process emacs)

Memory information:
((conses 16 180731 17858)
 (symbols 48 26964 2)
 (miscs 40 34 147)
 (strings 32 43773 19901)
 (string-bytes 1 1131962)
 (vectors 16 24838)
 (vector-slots 8 1238099 198624)
 (floats 8 237 346)
 (intervals 56 213 126)
 (buffers 976 12)
 (heap 1024 21727 2658))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23237; Package emacs. (Thu, 07 Apr 2016 15:55:01 GMT) Full text and rfc822 format available.

Message #8 received at 23237 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Alex Coventry <alx <at> empirical.com>
Cc: 23237 <at> debbugs.gnu.org
Subject: Re: bug#23237: Strange behavior of `package` in automated install in
 init script
Date: Thu, 07 Apr 2016 17:54:38 +0200
Alex Coventry <alx <at> empirical.com> writes:

>   (message (format "package contents: %s" package-archive-contents))

This should better be

  (message "package contents: %s" package-archive-contents)

>   (package-install "evil")

According to the doc of `package-install', package names are symbols, so
I think you should better do

  (package-install 'evil)


Michael.




Added tag(s) notabug. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 08 Apr 2016 15:26:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 23237 <at> debbugs.gnu.org and Alex Coventry <alx <at> empirical.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 08 Apr 2016 15:26:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23237; Package emacs. (Fri, 08 Apr 2016 19:20:01 GMT) Full text and rfc822 format available.

Message #15 received at 23237 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Alex Coventry <alx <at> empirical.com>
Cc: 23237 <at> debbugs.gnu.org
Subject: Re: bug#23237: Strange behavior of `package` in automated install in
 init script
Date: Fri, 08 Apr 2016 21:19:34 +0200
Alex Coventry <alx <at> empirical.com> writes:

> Thanks, Michael.  Those changes fixed the problem.

Great.  Glenn has already closed the bug - thanks.

A hint: Please always Cc the original bug address (like I did in this
message) so that others can follow the conversation (you had answered
only to my private address).


Regards,

Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 07 May 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 48 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.