Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 84455 Details for
Bug 129515
[PATCH] etc-update and dispatch-conf ignore any files that are under symlinked dirs
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
dispatch-conf-better-symlink.patch
dispatch-conf-better-symlink.patch (text/plain), 6.47 KB, created by
Patrick McLean
on 2006-04-11 10:58:52 UTC
(
hide
)
Description:
dispatch-conf-better-symlink.patch
Filename:
MIME Type:
Creator:
Patrick McLean
Created:
2006-04-11 10:58:52 UTC
Size:
6.47 KB
patch
obsolete
>--- /diskless/current/usr/sbin/dispatch-conf 2006-04-10 15:44:59.000000000 -0400 >+++ /diskless/beta/usr/sbin/dispatch-conf 2006-04-11 13:52:55.000000000 -0400 >@@ -19,7 +19,7 @@ > > import portage, dispatch_conf > >-FIND_EXTANT_CONFIGS = "find -L %s/ -iname '._cfg????_*' -exec readlink -q -f '{}' ';' | uniq | sed -e 's://:/:g'" >+FIND_EXTANT_CONFIGS = "find -L %s/ -iname '._cfg????_*' | sed -e 's://:/:g'" > DIFF_CONTENTS = 'diff -Nu %s %s' > DIFF_CVS_INTERP = 'diff -Nu %s %s | grep "^[+-][^+-]" | grep -v "# .Header:.*"' > DIFF_WSCOMMENTS = 'diff -Nu %s %s | grep "^[+-][^+-]" | grep -v "^[-+]#" | grep -v "^[-+][:space:]*$"' >@@ -100,7 +100,7 @@ > # > > def f (conf): >- mrgconf = re.sub(r'\._cfg', '._mrg', conf['new']) >+ mrgconf = re.sub(r'\._cfg', '._mrg', os.path.realpath(conf['new'])) > archive = os.path.join(self.options['archive-dir'], conf['current'].lstrip('/')) > if self.options['use-rcs'] == 'yes': > mrgfail = dispatch_conf.rcs_archive(archive, conf['current'], conf['new'], mrgconf) >@@ -113,15 +113,15 @@ > if os.path.exists(mrgconf): > if mrgfail or len(commands.getoutput(DIFF_CONTENTS % (conf['new'], mrgconf))) == 0: > os.unlink(mrgconf) >- newconf = conf['new'] >+ newconf = os.path.realpath(conf['new']) > else: > newconf = mrgconf > else: >- newconf = conf['new'] >+ newconf = os.path.realpath(conf['new']) > >- same_file = len(commands.getoutput (DIFF_CONTENTS % (conf ['current'], newconf))) == 0 >- same_cvs = len(commands.getoutput (DIFF_CVS_INTERP % (conf ['current'], newconf))) == 0 >- same_wsc = len(commands.getoutput (DIFF_WSCOMMENTS % (conf ['current'], newconf))) == 0 >+ same_file = len(commands.getoutput (DIFF_CONTENTS % (os.path.realpath(conf ['current']), newconf))) == 0 >+ same_cvs = len(commands.getoutput (DIFF_CVS_INTERP % (os.path.realpath(conf ['current']), newconf))) == 0 >+ same_wsc = len(commands.getoutput (DIFF_WSCOMMENTS % (os.path.realpath(conf ['current']), newconf))) == 0 > > # Do options permit? > same_cvs = same_cvs and self.options['replace-cvs'] == 'yes' >@@ -129,16 +129,16 @@ > unmodified = unmodified and self.options['replace-unmodified'] == 'yes' > > if same_file: >- os.unlink (conf ['new']) >- self.post_process(conf['current']) >+ os.unlink (os.path.realpath(conf ['new'])) >+ self.post_process(os.path.realpath(conf['current'])) > if os.path.exists(mrgconf): > os.unlink(mrgconf) > return False > elif unmodified or same_cvs or same_wsc or conf ['dir'] in portage.settings ['CONFIG_PROTECT_MASK'].split (): >- self.replace(newconf, conf['current']) >+ self.replace(newconf, os.path.realpath(conf['current'])) > self.post_process(conf['current']) > if newconf == mrgconf: >- os.unlink(conf['new']) >+ os.unlink(os.path.realpath(conf['new'])) > elif os.path.exists(mrgconf): > os.unlink(mrgconf) > return False >@@ -154,7 +154,11 @@ > for conf in confs: > count = count + 1 > >- newconf = conf['new'] >+ newconf = os.path.realpath(conf['new']) >+ >+ if not os.path.exists(newconf): >+ break >+ > mrgconf = re.sub(r'\._cfg', '._mrg', newconf) > if os.path.exists(mrgconf): > newconf = mrgconf >@@ -162,10 +166,10 @@ > > while 1: > if show_new_diff: >- os.system((self.options['diff']) % (conf['new'], mrgconf)) >+ os.system((self.options['diff']) % (os.path.realpath(conf['new']), mrgconf)) > show_new_diff = 0 > else: >- os.system((self.options['diff']) % (conf['current'], newconf)) >+ os.system((self.options['diff']) % (os.path.realpath(conf['current']), newconf)) > > print > print '>> (%i of %i) -- %s' % (count, len(confs), conf ['current']) >@@ -180,14 +184,14 @@ > continue > elif c == 't': > if newconf == mrgconf: >- newconf = conf['new'] >+ newconf = os.path.realpath(conf['new']) > elif os.path.exists(mrgconf): > newconf = mrgconf > continue > elif c == 'n': > break > elif c == 'm': >- merged = SCRATCH_DIR+"/"+os.path.basename(conf['current']) >+ merged = SCRATCH_DIR+"/"+os.path.basename(os.path.realpath(conf['current'])) > print > ret = os.system (self.options['merge'] % (merged, conf ['current'], newconf)) > if ret: >@@ -195,7 +199,7 @@ > continue > shutil.copyfile(merged, mrgconf) > os.remove(merged) >- mystat = os.lstat(conf['new']) >+ mystat = os.lstat(os.path.realpath(conf['new'])) > os.chmod(mrgconf, mystat[ST_MODE]) > os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID]) > newconf = mrgconf >@@ -214,10 +218,10 @@ > os.unlink(mrgconf) > break > elif c == 'u': >- self.replace(newconf, conf ['current']) >+ self.replace(newconf, os.path.realpath(conf ['current'])) > self.post_process(conf['current']) > if newconf == mrgconf: >- os.unlink(conf['new']) >+ os.unlink(os.path.realpath(conf['new'])) > elif os.path.exists(mrgconf): > os.unlink(mrgconf) > break >@@ -263,7 +267,7 @@ > dir = re.match (r'^(.+)/', nconf).group (1) > > if h.has_key (conf): >- mrgconf = re.sub(r'\._cfg', '._mrg', h[conf]['new']) >+ mrgconf = os.path.realpath(re.sub(r'\._cfg', '._mrg', h[conf]['new'])) > if os.path.exists(mrgconf): > os.unlink(mrgconf) > os.unlink(h[conf]['new'])
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 129515
:
84382
|
84383
|
84455
|
85717