Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 318237

Summary: kde4-functions.eclass: stat usage requires GNU stat
Product: Gentoo Linux Reporter: Alexis Ballier <aballier>
Component: Current packagesAssignee: Gentoo KDE team <kde>
Status: RESOLVED FIXED    
Severity: normal CC: bsd+disabled, esigra, nigoro.dev
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: FreeBSD   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 313999    
Attachments: patch for kde4-functions.eclass

Description Alexis Ballier gentoo-dev 2010-05-03 04:48:33 UTC
on BSD I get warnings such that:

stat: illegal option -- -
usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]
 * QA Notice:
 * Package kfile is breaking /usr/share/config permissions.
 * Please report this issue to gentoo bugzilla.
 * Permissions will get adjusted automatically now.
stat: illegal option -- -
usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]
 * QA Notice:
 * Package kfile is breaking /usr/share/kde4 permissions.
 * Please report this issue to gentoo bugzilla.
 * Permissions will get adjusted automatically now.

at the end of emerge of every single kde4 package. Would it be possible to disable this check if USERLAND!=GNU or use userland_GNU isnt set?
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2010-06-14 21:02:15 UTC
OK, this is the code snippet:

------
if [[ $(stat --format=%a "${y}/${x}") != 755 ]]; then
  ewarn "QA Notice:"
  ewarn "Package ${PN} is breaking ${y}/${x} permissions."
  ewarn "Please report this issue to gentoo bugzilla."
  einfo "Permissions will get adjusted automatically now."
  find "${y}/${x}" -type d -print0 | xargs -0 chmod 755
fi
------

Under linux, the short equivalent of "--format" is "-c". But, judging from
your error message, that option does not exist with BSD stat. 

"%a" means "Access rights in octal". Could you please check what exactly is
the BSD equivalent? Maybe "-f %a" ?

Comment 2 Andreas K. Hüttel archtester gentoo-dev 2010-06-22 19:32:54 UTC
We could need some help from the bsd guys here...
Comment 3 Andreas K. Hüttel archtester gentoo-dev 2011-03-31 19:38:29 UTC
Is it possible to install gnu stat on bsd (as gstat?), and what's the ebuild name then (for adding a dependency)?
Comment 4 Yuta SATOH 2011-04-13 12:06:03 UTC
Created attachment 269801 [details, diff]
patch for kde4-functions.eclass

This problem reproduced my environment. 
I applied this patch and solved.

KDE team,
BTW, Gentoo/FreeBSD has the problem that the source cannot extract. 
When having free time to you, could you check Bug 363471 ?
thanks in advance.
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2011-04-13 22:13:42 UTC
Thanks a lot! I added the patch to the overlay eclass for testing, and will move it to the main tree later.
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2011-04-21 22:33:28 UTC
Moved to main tree, thanks!