Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 283292 - "sudo repoman manifest" results in traceback
Summary: "sudo repoman manifest" results in traceback
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 210077 288499
  Show dependency tree
 
Reported: 2009-08-31 04:09 UTC by Raffaello D. Di Napoli
Modified: 2009-10-11 01:03 UTC (History)
0 users

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


Attachments
patch for repoman (fix-repoman.patch,656 bytes, patch)
2009-08-31 06:33 UTC, Jonathan Callen (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raffaello D. Di Napoli 2009-08-31 04:09:30 UTC
Looks like repoman won’t work when invoked directly using sudo.

$ sudo repoman manifest
Traceback (most recent call last):
  File "/usr/bin/repoman", line 440, in <module>
    portdir, portdir_overlay, mydir = utilities.FindPortdir(repoman_settings)
  File "//usr/lib/portage/pym/repoman/utilities.py", line 357, in FindPortdir
    s = os.stat(p)
OSError: [Errno 2] No such file or directory: ''
$ sudo bash
# repoman manifest
>>> Creating Manifest for /usr/local/portage/sys-apps/hwinfo
# exit
exit
$ 

Not much else to say. As you can see from the pasted output, invoking from a root shell works, as expected.

Reproducible: Always

Steps to Reproduce:
1. sudo repoman manifest
Actual Results:  
Traceback.

Expected Results:  
Creation of missing ebuild manifests.

Note that "ebuild <ebuild path> manifest" works properly both when invoked from a root shell and when invoked with sudo.


emerge --info
Portage 2.1.6.13 (default/linux/x86/2008.0, gcc-4.3.2, glibc-2.9_p20081201-r2, 2.6.30-gentoo-r4 i686)
=================================================================
System uname: Linux-2.6.30-gentoo-r4-i686-Intel-R-_Core-TM-2_Duo_CPU_T5550_@_1.83GHz-with-gentoo-1.12.11.1
Timestamp of tree: Tue, 25 Aug 2009 21:45:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 2.1.8-r1
dev-lang/python:     2.6.2-r1
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=core2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O3 -march=core2 -pipe"
DISTDIR="/store/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo                 ftp://ftp.unina.it/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="it"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X aalib acl acpi alsa bash-completion berkdb branding bzip2 cairo cdda cddb cdr cli cracklib crypt cxx dbus dga dri dvd dvdr encode exif fbcon ffmpeg fontconfig ftp fuse gd gdbm gif gimp gnome gnome-keyring gnutls gpm gstreamer gtk hal hddtemp iconv ieee1394 isdnlog java javascript jpeg jpeg2k lame lcms lm_sensors lzma matroska mime mmap mmx mng mp3 mp4 mpeg mudflap nautilus ncurses nfs nls nptl nptlonly nsplugin offensive ogg opengl openmp pam pch pcmcia pcre pdf perl png posix pppd python readline reflection samba sdl session sharedmem smp sockets spell spl sse sse2 sse3 ssl svg sysfs syslog sysvipc taglib tcpd threads tiff truetype unicode usb v4l v4l2 vorbis wifi x86 xattr xorg xpm xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" USERLAND="GNU" VIDEO_CARDS="intel"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jonathan Callen (RETIRED) gentoo-dev 2009-08-31 06:33:01 UTC
Created attachment 202767 [details, diff]
patch for repoman

It appears that this is caused by having an empty or unset PWD environment variable. This patch fixes that issue, by allowing repoman to ignore an empty or unset PWD.
Comment 2 Zac Medico gentoo-dev 2009-08-31 07:57:07 UTC
(In reply to comment #1)
> Created an attachment (id=202767) [edit]
> patch for repoman

Thanks, that's in svn r14174.
Comment 3 Raffaello D. Di Napoli 2009-09-03 17:37:59 UTC
Sorry for the delay, I now found a few minutes to try the suggested patch.

$ sudo repoman manifest
[CRITICAL] Repoman is unable to determine PORTDIR or PORTDIR_OVERLAY from the current working directory
$ sudo bash
# repoman manifest
[CRITICAL] Repoman is unable to determine PORTDIR or PORTDIR_OVERLAY from the current working directory
# exit
exit
$ 

So now it’s just not working, no matter if I’m root or not.

I also don’t understand the PWD issue. If I run `echo $PWD` I do get the right working directory, so I guess we’re not talking about the same PWD. Ah, except sudo clears the environment, right. Okay, got it now.
Comment 4 Zac Medico gentoo-dev 2009-09-20 00:23:11 UTC
This is fixed in 2.2_rc41.
Comment 5 Zac Medico gentoo-dev 2009-10-11 01:03:28 UTC
This is fixed in 2.1.7.