Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#16282 closed defect (fixed)

emacs 22.2: bad use of chown in destroot stage

Reported by: vinc17@… Owned by: darren.bane@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc:
Port:

Description

I get the following errors:

--->  Staging emacs into destroot
[...]
for dir in /opt/local/var/macports/build/_Users_vinc17_software_dports_editors_emacs/work/emacs-22.2/etc /opt/local/var/macports/build/_Users_vinc17_software_dports_editors_emacs/work/emacs-22.2/lisp ; do \
  dest=$1 ; shift ; \
  [ -d ${dir} ] \
  && [ `(cd ${dir} && /bin/pwd)` != `(cd ${dest} && /bin/pwd)` ] \
  && (echo "Copying ${dir} to ${dest}..." ; \
      (cd ${dir}; tar -chf - . ) \
        | (cd ${dest}; umask 022; \
                   tar -xvf - && cat > /dev/null) || exit 1; \
      find ${dest} -exec chown ${LOGNAME:-$USERNAME} {} ';' ;\
      for subdir in `find ${dest} -type d ! -name RCS ! -name CVS -print` ; do \
        chmod a+rx ${subdir} ; \
        rm -rf ${subdir}/RCS ; \
        rm -rf ${subdir}/CVS ; \
        rm -f  ${subdir}/.cvsignore ; \
        rm -f  ${subdir}/.arch-inventory ; \
        rm -f  ${subdir}/\#* ; \
        rm -f  ${subdir}/.\#* ; \
        rm -f  ${subdir}/*~ ; \
        rm -f  ${subdir}/*.orig ; \
        rm -f  ${subdir}/[mM]akefile* ; \
        rm -f  ${subdir}/ChangeLog* ; \
        rm -f  ${subdir}/dired.todo ; \
      done) ; \
done
Copying /opt/local/var/macports/build/_Users_vinc17_software_dports_editors_emacs/work/emacs-22.2/etc to /opt/local/var/macports/build/_Users_vinc17_software_dports_editors_emacs/work/destroot/opt/local/share/emacs/22.2/etc...
./
./BABYL
./calccard.ps
./calccard.tex
[...]
./yow.lines
usage: chown [-fhv] [-R [-H | -L | -P]] owner[:group] file ...
       chown [-fhv] [-R [-H | -L | -P]] :group file ...
usage: chown [-fhv] [-R [-H | -L | -P]] owner[:group] file ...
       chown [-fhv] [-R [-H | -L | -P]] :group file ...
[...]

Here "sudo env | grep NAME" gives:

LOGNAME=root
USERNAME=vinc17

I suppose that the problem is that MacPorts undefines both LOGNAME and USERNAME.

Attachments (3)

patch-Portfile.diff (595 bytes) - added by darren.bane@… 16 years ago.
Patch against editors/emacs/Portfile
patch-Makefile.in.diff (1.3 KB) - added by darren.bane@… 16 years ago.
New patch, to go in editors/emacs/files
patch-leim-Makefile.in.diff (331 bytes) - added by darren.bane@… 16 years ago.
New patch, to go in editors/emacs/files

Download all attachments as: .zip

Change History (9)

comment:1 Changed 16 years ago by vinc17@…

Owner: changed from macports-tickets@… to darren.bane@…

Forgot to assign to maintainer...

comment:2 in reply to:  description Changed 16 years ago by vinc17@…

Replying to vinc17@macports.org:

I suppose that the problem is that MacPorts undefines both LOGNAME and USERNAME.

Indeed, if I insert

echo "chown '$${LOGNAME:-$$USERNAME}' ..." ; \

before the "find $${dest} -exec chown", I get:

chown '' ...

I think that a fix would be to remove all these unnecessary chown's. Or MacPorts base should be fixed to keep LOGNAME set to a valid value (I wonder if unsetting it is allowed by POSIX).

comment:3 Changed 16 years ago by raimue (Rainer Müller)

Can someone explain why emacs wants to change the owner at all? Would it be a problem if it is owned by root?

Changed 16 years ago by darren.bane@…

Attachment: patch-Portfile.diff added

Patch against editors/emacs/Portfile

Changed 16 years ago by darren.bane@…

Attachment: patch-Makefile.in.diff added

New patch, to go in editors/emacs/files

Changed 16 years ago by darren.bane@…

Attachment: patch-leim-Makefile.in.diff added

New patch, to go in editors/emacs/files

comment:4 Changed 16 years ago by darren.bane@…

I agree that the chowns are unnecessary, and have uploaded patches to remove them. Can someone with commit privs do the honours please?

Also, the other patches in editors/emacs/files are no longer used and can be removed.

comment:5 Changed 16 years ago by febeling@…

Resolution: fixed
Status: newclosed

I did so in r39221 and close the ticket.

comment:6 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.