* [gentoo-commits] proj/portage:master commit in: pym/portage/util/, bin/
@ 2014-10-27 9:41 Zac Medico
0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2014-10-27 9:41 UTC (permalink / raw
To: gentoo-commits
commit: ae355c93fd2760970c92cd4e9d2daa68f216adfa
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 25 00:59:39 2014 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 27 09:39:26 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ae355c93
CONFIG_PROTECT: handle non-existent files
This fixes the ConfigProtect class, etc-update, and dispatch-conf to
account for non-existent files (rather than directories) that are
listed directly in CONFIG_PROTECT. It has been valid to list files
directly in CONFIG_PROTECT since bug #14321. However, the support for
non-existent files added for bug #523684 did not include support for
non-existent files listed directly in CONFIG_PROTECT.
Fixes: 5f7b4865ecaf ("dblink.mergeme: implement bug #523684")
X-Gentoo-Bug: 523684
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=523684
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>
---
bin/dispatch-conf | 10 ++++++----
bin/etc-update | 5 ++++-
pym/portage/util/__init__.py | 6 ++++--
3 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index fb0a8af..6d2ae94 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -116,13 +116,15 @@ class dispatch:
for path in config_paths:
path = portage.normalize_path(
os.path.join(config_root, path.lstrip(os.sep)))
- try:
- mymode = os.stat(path).st_mode
- except OSError:
+
+ # Protect files that don't exist (bug #523684). If the
+ # parent directory doesn't exist, we can safely skip it.
+ if not os.path.isdir(os.path.dirname(path)):
continue
+
basename = "*"
find_opts = "-name '.*' -type d -prune -o"
- if not stat.S_ISDIR(mymode):
+ if not os.path.isdir(path):
path, basename = os.path.split(path)
find_opts = "-maxdepth 1"
diff --git a/bin/etc-update b/bin/etc-update
index 1a99231..7ac6f0b 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -74,7 +74,10 @@ scan() {
path="${EROOT%/}${path}"
if [[ ! -d ${path} ]] ; then
- [[ ! -f ${path} ]] && continue
+ # Protect files that don't exist (bug #523684). If the
+ # parent directory doesn't exist, we can safely skip it.
+ path=${path%/}
+ [[ -d ${path%/*} ]] || continue
local my_basename="${path##*/}"
path="${path%/*}"
find_opts=( -maxdepth 1 -name "._cfg????_${my_basename}" )
diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py
index 4105c19..fe79942 100644
--- a/pym/portage/util/__init__.py
+++ b/pym/portage/util/__init__.py
@@ -1572,12 +1572,14 @@ class ConfigProtect(object):
for x in self.protect_list:
ppath = normalize_path(
os.path.join(self.myroot, x.lstrip(os.path.sep)))
+ # Protect files that don't exist (bug #523684). If the
+ # parent directory doesn't exist, we can safely skip it.
+ if os.path.isdir(os.path.dirname(ppath)):
+ self.protect.append(ppath)
try:
if stat.S_ISDIR(os.stat(ppath).st_mode):
self._dirs.add(ppath)
- self.protect.append(ppath)
except OSError:
- # If it doesn't exist, there's no need to protect it.
pass
self.protectmask = []
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/util/, bin/
@ 2014-11-03 23:26 Zac Medico
0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2014-11-03 23:26 UTC (permalink / raw
To: gentoo-commits
commit: a899fee4b565d31c65ad8e458a2acf65f77fcb03
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 3 21:17:19 2014 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov 3 21:17:19 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a899fee4
Remove redundant PORTAGE_XATTR_EXCLUDE defaults (527636)
In install.py and movefile.py there were some redundant default
PORTAGE_XATTR_EXCLUDE settings. The default settings in make.globals
should be sufficient. Therefore, remove the redundant settings so that
we don't have to maintain them.
Fixes: 2fcdb5f36fac ("Add btrfs.* to default PORTAGE_XATTR_EXCLUDE (527636)")
X-Gentoo-Bug: 527636
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=527636
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
Acked-by: Anthony G. Basile <blueness <AT> gentoo.org>
---
bin/install.py | 2 +-
pym/portage/util/movefile.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/install.py b/bin/install.py
index 3c5e0de..5bbe97b 100755
--- a/bin/install.py
+++ b/bin/install.py
@@ -171,7 +171,7 @@ def copy_xattrs(opts, files):
source, target = files, opts.target_directory
target_is_directory = True
- exclude = os.environ.get("PORTAGE_XATTR_EXCLUDE", "security.* system.nfs4_acl")
+ exclude = os.environ.get("PORTAGE_XATTR_EXCLUDE", "")
try:
if target_is_directory:
diff --git a/pym/portage/util/movefile.py b/pym/portage/util/movefile.py
index 452e77f..d00f624 100644
--- a/pym/portage/util/movefile.py
+++ b/pym/portage/util/movefile.py
@@ -328,7 +328,7 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None,
if xattr_enabled:
try:
_copyxattr(src_bytes, dest_tmp_bytes,
- exclude=mysettings.get("PORTAGE_XATTR_EXCLUDE", "security.* system.nfs4_acl"))
+ exclude=mysettings.get("PORTAGE_XATTR_EXCLUDE", ""))
except SystemExit:
raise
except:
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-03 23:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-03 23:26 [gentoo-commits] proj/portage:master commit in: pym/portage/util/, bin/ Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2014-10-27 9:41 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox