Lines 6144-6151
class dblink:
Link Here
|
6144 |
mydirs=[] |
6144 |
mydirs=[] |
6145 |
mysyms=[] |
6145 |
mysyms=[] |
6146 |
modprotect="/lib/modules/" |
6146 |
modprotect="/lib/modules/" |
6147 |
for obj in mykeys: |
6147 |
for objkey in mykeys: |
6148 |
obj=os.path.normpath(obj) |
6148 |
obj=os.path.normpath(objkey) |
6149 |
if obj[:2]=="//": |
6149 |
if obj[:2]=="//": |
6150 |
obj=obj[1:] |
6150 |
obj=obj[1:] |
6151 |
if not os.path.exists(obj): |
6151 |
if not os.path.exists(obj): |
Lines 6153-6159
class dblink:
Link Here
|
6153 |
#we skip this if we're dealing with a symlink |
6153 |
#we skip this if we're dealing with a symlink |
6154 |
#because os.path.exists() will operate on the |
6154 |
#because os.path.exists() will operate on the |
6155 |
#link target rather than the link itself. |
6155 |
#link target rather than the link itself. |
6156 |
print "--- !found "+str(pkgfiles[obj][0]), obj |
6156 |
print "--- !found "+str(pkgfiles[objkey][0]), obj |
6157 |
continue |
6157 |
continue |
6158 |
# next line includes a tweak to protect modules from being unmerged, |
6158 |
# next line includes a tweak to protect modules from being unmerged, |
6159 |
# but we don't protect modules from being overwritten if they are |
6159 |
# but we don't protect modules from being overwritten if they are |
Lines 6161-6186
class dblink:
Link Here
|
6161 |
# functionality for /lib/modules. For portage-ng both capabilities |
6161 |
# functionality for /lib/modules. For portage-ng both capabilities |
6162 |
# should be able to be independently specified. |
6162 |
# should be able to be independently specified. |
6163 |
if self.isprotected(obj) or ((len(obj) > len(modprotect)) and (obj[0:len(modprotect)]==modprotect)): |
6163 |
if self.isprotected(obj) or ((len(obj) > len(modprotect)) and (obj[0:len(modprotect)]==modprotect)): |
6164 |
print "--- cfgpro "+str(pkgfiles[obj][0]), obj |
6164 |
print "--- cfgpro "+str(pkgfiles[objkey][0]), obj |
6165 |
continue |
6165 |
continue |
6166 |
|
6166 |
|
6167 |
lstatobj=os.lstat(obj) |
6167 |
lstatobj=os.lstat(obj) |
6168 |
lmtime=str(lstatobj[stat.ST_MTIME]) |
6168 |
lmtime=str(lstatobj[stat.ST_MTIME]) |
6169 |
if (pkgfiles[obj][0] not in ("dir","fif","dev","sym")) and (lmtime != pkgfiles[obj][1]): |
6169 |
if (pkgfiles[objkey][0] not in ("dir","fif","dev","sym")) and (lmtime != pkgfiles[objkey][1]): |
6170 |
print "--- !mtime", pkgfiles[obj][0], obj |
6170 |
print "--- !mtime", pkgfiles[objkey][0], obj |
6171 |
continue |
6171 |
continue |
6172 |
|
6172 |
|
6173 |
if pkgfiles[obj][0]=="dir": |
6173 |
if pkgfiles[objkey][0]=="dir": |
6174 |
if not os.path.isdir(obj): |
6174 |
if not os.path.isdir(obj): |
6175 |
print "--- !dir ","dir", obj |
6175 |
print "--- !dir ","dir", obj |
6176 |
continue |
6176 |
continue |
6177 |
mydirs.append(obj) |
6177 |
mydirs.append(obj) |
6178 |
elif pkgfiles[obj][0]=="sym": |
6178 |
elif pkgfiles[objkey][0]=="sym": |
6179 |
if not os.path.islink(obj): |
6179 |
if not os.path.islink(obj): |
6180 |
print "--- !sym ","sym", obj |
6180 |
print "--- !sym ","sym", obj |
6181 |
continue |
6181 |
continue |
6182 |
mysyms.append(obj) |
6182 |
mysyms.append(obj) |
6183 |
elif pkgfiles[obj][0]=="obj": |
6183 |
elif pkgfiles[objkey][0]=="obj": |
6184 |
if not os.path.isfile(obj): |
6184 |
if not os.path.isfile(obj): |
6185 |
print "--- !obj ","obj", obj |
6185 |
print "--- !obj ","obj", obj |
6186 |
continue |
6186 |
continue |
Lines 6188-6194
class dblink:
Link Here
|
6188 |
|
6188 |
|
6189 |
# string.lower is needed because db entries used to be in upper-case. The |
6189 |
# string.lower is needed because db entries used to be in upper-case. The |
6190 |
# string.lower allows for backwards compatibility. |
6190 |
# string.lower allows for backwards compatibility. |
6191 |
if mymd5 != string.lower(pkgfiles[obj][2]): |
6191 |
if mymd5 != string.lower(pkgfiles[objkey][2]): |
6192 |
print "--- !md5 ","obj", obj |
6192 |
print "--- !md5 ","obj", obj |
6193 |
continue |
6193 |
continue |
6194 |
try: |
6194 |
try: |
Lines 6196-6202
class dblink:
Link Here
|
6196 |
except (OSError,IOError),e: |
6196 |
except (OSError,IOError),e: |
6197 |
pass |
6197 |
pass |
6198 |
print "<<< ","obj",obj |
6198 |
print "<<< ","obj",obj |
6199 |
elif pkgfiles[obj][0]=="fif": |
6199 |
elif pkgfiles[objkey][0]=="fif": |
6200 |
if not stat.S_ISFIFO(lstatobj[stat.ST_MODE]): |
6200 |
if not stat.S_ISFIFO(lstatobj[stat.ST_MODE]): |
6201 |
print "--- !fif ","fif", obj |
6201 |
print "--- !fif ","fif", obj |
6202 |
continue |
6202 |
continue |
Lines 6205-6211
class dblink:
Link Here
|
6205 |
except (OSError,IOError),e: |
6205 |
except (OSError,IOError),e: |
6206 |
pass |
6206 |
pass |
6207 |
print "<<< ","fif",obj |
6207 |
print "<<< ","fif",obj |
6208 |
elif pkgfiles[obj][0]=="dev": |
6208 |
elif pkgfiles[objkey][0]=="dev": |
6209 |
print "--- ","dev",obj |
6209 |
print "--- ","dev",obj |
6210 |
|
6210 |
|
6211 |
#Now, we need to remove symlinks and directories. We'll repeatedly |
6211 |
#Now, we need to remove symlinks and directories. We'll repeatedly |