Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 71743 - ar does not generate valid return code on error
Summary: ar does not generate valid return code on error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-19 03:08 UTC by Martin Pohlack
Modified: 2005-01-11 16:14 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 Martin Pohlack 2004-11-19 03:08:47 UTC
I use ar like this:
 ar crs librt_mon_client.a test.o

When test.o does not exists it should exit with an error code (as it does on debian stable and unstable).

It does not! ar just returns 0, independently of the file's existance.

Reproducible: Always
Steps to Reproduce:
1. ar crs librt_mon_client.a test.o
2. echo $?


Actual Results:  
0



Expected Results:  
1 (or != 0)

ar --version

GNU ar 2.14.90.0.8 20040114
Copyright 2003 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.


emerge info

Portage 2.0.51-r3 (default-linux/x86/2004.2, gcc-3.3.4, glibc-2.3.4.20040808-r1,
2.6.7 i686)
=================================================================
System uname: 2.6.7 i686 Intel(R) Pentium(R) M processor 1600MHz
Gentoo Base System version 1.4.16
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
Headers:  sys-kernel/linux-headers-2.4.21-r1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -pipe -march=pentium3 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi//var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -pipe -march=pentium3 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="ftp://ibiblio.org/pub/Linux/distributions/gentoo/
ftp://ftp.tu-clausthal.de/pub/linux/gentoo/
ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo
ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/
ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo
ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X aalib alsa apm avi berkdb bitmap-fonts cdr crypt cups dga dvd encode esd
f77 fam flac foomaticdb fortran gdbm gif gimp gimpprint gnome gphoto2 gpm gtk
gtk2 imagemagick imlib intel8x0 java jpeg junit kde libg++ libwww mad mikmod mmx
mmx2motif mozcalendar mozilla mpeg ncurses nls oggvorbis opengl oss pam pdflib
perl plotutils png ppds python qt quicktime radeon readline samba sdl slang
spell sse ssl svga tcltk tcpd tetex tiff truetype usb x86 xemacs xinerama xml
xml2 xmms xv zlib video_cards_radeon"
Comment 1 SpanKY gentoo-dev 2004-11-19 23:07:24 UTC
root@vapier 0 gdb # ar crs librt_mon_client.a test.o
ar: test.o: No such file or directory
root@vapier 0 gdb # echo $?
1

seems to be fixed in newer binutils

solar: shall we finally put binutils-2.15.90.0.1.1-r3 into x86 stable ?
Comment 2 solar (RETIRED) gentoo-dev 2004-11-20 00:31:58 UTC
Please yes lets put it in stable.
Comment 3 SpanKY gentoo-dev 2004-11-22 18:50:04 UTC
it's in stable now
Comment 4 Martin Pohlack 2004-11-25 02:10:54 UTC
I checked for the bug with ar version:

  GNU ar 2.15.90.0.1.1 20040303

and the bug still exists!

Debian ar versions:
  2.15
and
  GNU ar 2.13.90.0.16 20021126 Debian GNU/Linux

do not have this bug.
Comment 5 SpanKY gentoo-dev 2004-12-05 19:51:00 UTC
ok, this is def not fixed in 2.15.90.0.1.1 but is in 2.15.92.0.2
Comment 6 SpanKY gentoo-dev 2005-01-11 16:14:16 UTC
binutils-2.15.92.0.2-r1 is now stable