Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 86920 Details for
Bug 133591
portage_file.py clean-ups
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Said patch
portage_file.py.patch (text/plain), 2.38 KB, created by
Albert Hopkins (RETIRED)
on 2006-05-17 05:57:37 UTC
(
hide
)
Description:
Said patch
Filename:
MIME Type:
Creator:
Albert Hopkins (RETIRED)
Created:
2006-05-17 05:57:37 UTC
Size:
2.38 KB
patch
obsolete
>--- portage_file.py 2006-05-15 01:24:17.000000000 -0500 >+++ /home/marduk/portage_file.py 2006-05-17 07:41:36.000000000 -0500 >@@ -1,15 +1,20 @@ >-# portage_data.py -- Calculated/Discovered Data Values >-# Copyright 1998-2004 Gentoo Foundation >+# portage_file.py -- Portage file handling utilities >+# Copyright 1998-2006 Gentoo Foundation > # Distributed under the terms of the GNU General Public License v2 > # $Id: /var/cvsroot/gentoo-src/portage/pym/portage_file.py,v 1.3.2.1 2005/01/16 02:35:33 carpaski Exp $ > >+""" >+Portage file handling utilities >+""" > > import os > import portage_data > import portage_exception >+import portage_util > from portage_localization import _ > > def normpath(mypath): >+ """Normalize mypath""" > newpath = os.path.normpath(mypath) > if len(newpath) > 1: > if newpath[:2] == "//": >@@ -18,18 +23,21 @@ > > > def makedirs(path, perms=0755, uid=None, gid=None, must_chown=False): >+ """ >+ Create directory tree with provided owner, group, and file permissions >+ """ > old_umask = os.umask(0) > if(uid is None): > uid = portage_data.portage_uid > if(gid is None): > gid = portage_data.portage_gid > if not path: >- raise portage_exception.InvalidParameter, _("Invalid path: type: '%(type)s' value: '%(path)s'") % {"path": path, "type": type(path)} >- if(perm > 1535) or (perm == 0): >- raise portage_exception.InvalidParameter, _("Invalid permissions passed. Value is octal and no higher than 02777.") >+ raise portage_exception.IncorrectParameter, _("Invalid path: type: '%(type)s' value: '%(path)s'") % {"path": path, "type": type(path)} >+ if(perms > 1535) or (perms == 0): >+ raise portage_exception.IncorrectParameter, _("Invalid permissions passed. Value is octal and no higher than 02777.") > > mypath = normpath(path) >- dirs = string.split(path, "/") >+ dirs = path.split('/') > > mypath = "" > if dirs and dirs[0] == "": >@@ -38,16 +46,16 @@ > for x in dirs: > mypath += x+"/" > if not os.path.exists(mypath): >- os.mkdir(mypath, perm) >+ os.mkdir(mypath, perms) > try: > os.chown(mypath, uid, gid) >- except SystemExit, e: >+ except SystemExit: > raise > except: > if must_chown: > os.umask(old_umask) > raise >- portage_util.writemsg(_("Failed to chown: %(path)s to %(uid)s:%(gid)s\n") % {"path":mypath,"uid":uid,"gid":gid}) >+ portage_util.writemsg(_("Failed to chown: %(path)s to %(uid)s:%(gid)s\n") % {"path":mypath, "uid":uid, "gid":gid}) > > os.umask(old_umask) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 133591
: 86920