public inbox for gentoo-soc@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-soc] GSoC patch for DragonFlyBSD porting
@ 2010-04-05 14:47 Naohiro Aota
  2010-04-07  4:00 ` Zac Medico
  0 siblings, 1 reply; 2+ messages in thread
From: Naohiro Aota @ 2010-04-05 14:47 UTC (permalink / raw
  To: gentoo-soc

[-- Attachment #1: Type: text/plain, Size: 861 bytes --]

Hi all,

Here is a patch for Gentoo GSoC application.

When I was running Portage test (portage/pym/portage/tests/runTests) from
git HEAD[1] on DragonFlyBSD, I found mkdir('/') returns EPERM which
portage would not expect to get.This caused ensure_dir('/') to be failed,
so that one of the tests finished with a error. (I believe ensure_dir('/')
should not be failed in
any case ;-) )

This patch adds a workaround for this case. I've confirmed the patched
portage's "runTests" work well (give OK for all the tests) on Gentoo/Linux
(~amd64), Gentoo/FreeBSD 8.0, and DragonFlyBSD 2.4.1.

# I wonder if this SCM and repository is suited for the BSD Porting
# project[2].

[1] git://git.overlays.gentoo.org/proj/portage.git
[2]  
http://en.gentoo-wiki.com/wiki/Google_Summer_of_Code_2010_ideas#BSD_ports_of_Gentoo:_OpenBSD.2C_DragonFlyBSD.2C_etc.

Regards,
Naohiro

[-- Attachment #2: 0001-Add-workaround-for-mkdir-on-DragonFlyBSD.patch --]
[-- Type: application/octet-stream, Size: 1188 bytes --]

From 1e2aff8c8c9cd052d42616ee94b3bed41d3eda96 Mon Sep 17 00:00:00 2001
From: Naohiro Aota <naota@elisp.net>
Date: Mon, 5 Apr 2010 22:11:52 +0900
Subject: [PATCH] Add workaround for mkdir("/") on DragonFlyBSD.

---
 pym/portage/util/__init__.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py
index 5412043..67ff79b 100644
--- a/pym/portage/util/__init__.py
+++ b/pym/portage/util/__init__.py
@@ -1036,6 +1036,7 @@ def ensure_dirs(dir_path, *args, **kwargs):
 	"""Create a directory and call apply_permissions.
 	Returns True if a directory is created or the permissions needed to be
 	modified, and False otherwise."""
+	from portage.data import ostype
 
 	created_dir = False
 
@@ -1047,7 +1048,8 @@ def ensure_dirs(dir_path, *args, **kwargs):
 		if oe.errno in (errno.EEXIST, errno.EISDIR):
 			pass
 		elif oe.errno == errno.EPERM:
-			raise OperationNotPermitted(func_call)
+			if ostype == "DragonFly" and dir_path == "/": pass
+			else: raise OperationNotPermitted(func_call)
 		elif oe.errno == errno.EACCES:
 			raise PermissionDenied(func_call)
 		elif oe.errno == errno.EROFS:
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [gentoo-soc] GSoC patch for DragonFlyBSD porting
  2010-04-05 14:47 [gentoo-soc] GSoC patch for DragonFlyBSD porting Naohiro Aota
@ 2010-04-07  4:00 ` Zac Medico
  0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2010-04-07  4:00 UTC (permalink / raw
  To: gentoo-soc

On 04/05/2010 07:47 AM, Naohiro Aota wrote:
> Hi all,
> 
> Here is a patch for Gentoo GSoC application.
> 
> When I was running Portage test (portage/pym/portage/tests/runTests) from
> git HEAD[1] on DragonFlyBSD, I found mkdir('/') returns EPERM which
> portage would not expect to get.This caused ensure_dir('/') to be failed,
> so that one of the tests finished with a error. (I believe ensure_dir('/')
> should not be failed in
> any case ;-) )
> 
> This patch adds a workaround for this case. I've confirmed the patched
> portage's "runTests" work well (give OK for all the tests) on Gentoo/Linux
> (~amd64), Gentoo/FreeBSD 8.0, and DragonFlyBSD 2.4.1.
> 
> # I wonder if this SCM and repository is suited for the BSD Porting
> # project[2].
> 
> [1] git://git.overlays.gentoo.org/proj/portage.git

Yes, that's the right place. Thanks for your patch. I've committed a
fix using a slightly different approach:


http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ee0b00baf07f18c23a180da5efd78fe01335364b
-- 
Thanks,
Zac



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-07  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-05 14:47 [gentoo-soc] GSoC patch for DragonFlyBSD porting Naohiro Aota
2010-04-07  4:00 ` Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox