Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 84955 - emacs-21.4.ebuild has a wrong "mv" command in src_install()
Summary: emacs-21.4.ebuild has a wrong "mv" command in src_install()
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Emacs project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-12 03:11 UTC by Gang Chan
Modified: 2006-05-16 08:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gang Chan 2005-03-12 03:11:01 UTC
src_install() {
        einstall || die
        for i in ${D}/usr/bin/* ; do
                mv ${i} ${i}.emacs-${SLOT} || die "mv ${i} failed"
        done
        mv ${D}/usr/bin/emacs{-${PV},}.emacs-${SLOT} || die "mv emacs failed"

        einfo "Fixing info documentation..."

this line:
mv ${D}/usr/bin/emacs{-${PV},}.emacs-${SLOT} || die "mv emacs failed"
will always failed. Commenting this line will solve the problem.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Mamoru KOMACHI (RETIRED) gentoo-dev 2005-03-13 04:53:33 UTC
It doesn't fail on my machine. Could you provide the output of `emerge --info`
and `equery list`? (equery is in app-portage/gentoolkit)
Comment 2 Gang Chan 2005-03-14 03:59:37 UTC
This is my "emerge --info"
-----------------------------------------------------------------------------
Portage 2.0.51-r3 (default-linux/x86/2004.0, gcc-3.4.3, glibc-2.3.4.20040808-r0, 2.6.11goncha-onepiece i686)
=================================================================
System uname: 2.6.11goncha-onepiece i686 Intel(R) Celeron(R) CPU 1.70GHz
Gentoo Base System version 1.5.1
Autoconf: sys-devel/autoconf-2.59-r6,sys-devel/autoconf-2.13
Automake: sys-devel/automake-1.8.5-r2,sys-devel/automake-1.5,sys-devel/automake-1.4_p6,sys-devel/automake-1.6.3,sys-devel/automake-1.7.9,sys-devel/automake-1.9.3
Binutils: sys-devel/binutils-2.15.91.0.1-r1
Headers:  sys-kernel/linux26-headers-2.6.8.1-r2
Libtools: sys-devel/libtool-1.5.10-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://gentoo.gg3.net ftp://linux.ntcu.net/dists/gentoo http://mirror.gentoo.gr.jp http://linux.thai.net/pub/mirrors/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aalib alsa apm arts avi berkdb bitmap-fonts cdr crypt cups curl emboss encode esd f77 fam font-server foomaticdb fortran gdbm gif gnome gpm gtk gtk2 imlib jpeg kde libg++ libwww mad mikmod motif mp3 mpeg ncurses nls oggvorbis opengl oss pam pdflib perl plotutils png python qt quicktime readline ruby sdl slang snmp spell ssl svga tcpd tetex tiff truetype truetype-fonts type1-fonts xml xml2 xmms xv zlib"
-----------------------------------------------------------------------------

Then, "equery list emacs"
-----------------------------------------------------------------------------
Searching for package 'emacs' in all categories among:
 * installed packages
[I--] [  ] app-editors/emacs-21.4 (21)
-----------------------------------------------------------------------------

I think the real problem is "src_install { ... }" in ebuild file, 
    mv ${D}/usr/bin/emacs{-${PV},}.emacs-${SLOT} || die "mv emacs failed"
this "mv" only with one argument, it certainly fails.
Comment 3 Mamoru KOMACHI (RETIRED) gentoo-dev 2005-03-14 06:59:21 UTC
Sorry, not `equery list emacs` but `equery files emacs`
(just to show files installed by app-editors/emacs).

 mv ${D}/usr/bin/emacs{-${PV},}.emacs-${SLOT} || die "mv emacs failed"

should be expanded to

mv ${D}/usr/bin/emacs-21.4.emacs-21 ${D}/usr/bin/emacs.emacs-21 || die "mv emacs failed"

So it fails if there is not ${D}/usr/bin/emacs-21.4.emacs-21.
See the Brace Expansion section in bash manual page.
Comment 4 Gang Chan 2005-03-15 03:44:11 UTC
Sorry for my pool knowledge of BASH ;)

I have these brace expansion commnad:

$ PV=21.4
$ echo emacs{-${PV},}
emacs{-21.4,}
$ echo emacs{-$PV,}
emacs-21.4 emacs
$ echo emacs{"-${PV}",}
emacs-21.4 emacs
$ echo emacs{-"${PV}",}
emacs-21.4 emacs

``echo emacs{-${PV},}" cannot work in my BASH environment. The versio of BASH I installed is

app-shells/bash-3.0-r5

GNU bash, version 3.00.0(1)-release (i686-pc-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.

This problem is also talked at http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00056.html. It's a bug! I should upgrade my current BASH.

Thank you for your help :)
Comment 5 Sergio Roa 2005-04-30 08:13:58 UTC
I also had the same problem and solved it by installing version 3.0-r9 of bash. I had previously version 3.0-r4.
Comment 6 Matthew Kennedy (RETIRED) gentoo-dev 2006-05-16 08:50:44 UTC
Currently bash-3.0-r12.ebuild is stable for all archs, and bash-3.1_p16.ebuild is stable for almost all archs, so I dont think we will see this bug again.  Please reopen if I'm wrong.
Comment 7 Matthew Kennedy (RETIRED) gentoo-dev 2006-05-16 08:51:14 UTC
resolving fixed