Lines 471-477
Link Here
|
471 |
and not msgtype.lower() in mysettings["PORTAGE_ELOG_CLASSES"].split(): |
471 |
and not msgtype.lower() in mysettings["PORTAGE_ELOG_CLASSES"].split(): |
472 |
continue |
472 |
continue |
473 |
if msgfunction not in portage_const.EBUILD_PHASES: |
473 |
if msgfunction not in portage_const.EBUILD_PHASES: |
474 |
print "!!! can't process invalid log file: %s" % f |
474 |
writemsg("!!! can't process invalid log file: %s" % f) |
475 |
continue |
475 |
continue |
476 |
if not msgfunction in mylogentries: |
476 |
if not msgfunction in mylogentries: |
477 |
mylogentries[msgfunction] = [] |
477 |
mylogentries[msgfunction] = [] |
Lines 503-512
Link Here
|
503 |
m = getattr(logmodule, "mod_"+s) |
503 |
m = getattr(logmodule, "mod_"+s) |
504 |
m.process(mysettings, cpv, mylogentries, fulllog) |
504 |
m.process(mysettings, cpv, mylogentries, fulllog) |
505 |
except (ImportError, AttributeError), e: |
505 |
except (ImportError, AttributeError), e: |
506 |
print "!!! Error while importing logging modules while loading \"mod_%s\":" % s |
506 |
writemsg("!!! Error while importing logging modules while loading \"mod_%s\":" % s) |
507 |
print e |
507 |
writemsg(e) |
508 |
except portage_exception.PortageException, e: |
508 |
except portage_exception.PortageException, e: |
509 |
print e |
509 |
writemsg(e) |
510 |
|
510 |
|
511 |
#parse /etc/env.d and generate /etc/profile.env |
511 |
#parse /etc/env.d and generate /etc/profile.env |
512 |
|
512 |
|
Lines 1854-1859
Link Here
|
1854 |
if droppriv and not uid and portage_gid and portage_uid: |
1854 |
if droppriv and not uid and portage_gid and portage_uid: |
1855 |
keywords.update({"uid":portage_uid,"gid":portage_gid,"groups":[portage_gid],"umask":002}) |
1855 |
keywords.update({"uid":portage_uid,"gid":portage_gid,"groups":[portage_gid],"umask":002}) |
1856 |
|
1856 |
|
|
|
1857 |
if settings["PORTAGE_QUIET"]: |
1858 |
print brown(" [ " + mystring + " ] ") |
1859 |
mystring = mystring + " > /dev/null" |
1860 |
|
1857 |
if not free: |
1861 |
if not free: |
1858 |
free=((droppriv and "usersandbox" not in features) or \ |
1862 |
free=((droppriv and "usersandbox" not in features) or \ |
1859 |
(not droppriv and "sandbox" not in features and "usersandbox" not in features)) |
1863 |
(not droppriv and "sandbox" not in features and "usersandbox" not in features)) |
Lines 1887-1893
Link Here
|
1887 |
if ("mirror" in features) and ("lmirror" not in features): |
1891 |
if ("mirror" in features) and ("lmirror" not in features): |
1888 |
# lmirror should allow you to bypass mirror restrictions. |
1892 |
# lmirror should allow you to bypass mirror restrictions. |
1889 |
# XXX: This is not a good thing, and is temporary at best. |
1893 |
# XXX: This is not a good thing, and is temporary at best. |
1890 |
print ">>> \"mirror\" mode desired and \"mirror\" restriction found; skipping fetch." |
1894 |
writemsg(">>> \"mirror\" mode desired and \"mirror\" restriction found; skipping fetch.") |
1891 |
return 1 |
1895 |
return 1 |
1892 |
|
1896 |
|
1893 |
thirdpartymirrors = mysettings.thirdpartymirrors() |
1897 |
thirdpartymirrors = mysettings.thirdpartymirrors() |
Lines 1973-1983
Link Here
|
1973 |
noiselevel=-1) |
1977 |
noiselevel=-1) |
1974 |
gotit=0 |
1978 |
gotit=0 |
1975 |
if not gotit: |
1979 |
if not gotit: |
1976 |
print |
1980 |
writemsg("\n") |
1977 |
print "!!!",mysettings["CATEGORY"]+"/"+mysettings["PF"],"has fetch restriction turned on." |
1981 |
writemsg("!!!",mysettings["CATEGORY"]+"/"+mysettings["PF"],"has fetch restriction turned on.\n") |
1978 |
print "!!! This probably means that this ebuild's files must be downloaded" |
1982 |
writemsg("!!! This probably means that this ebuild's files must be downloaded\n") |
1979 |
print "!!! manually. See the comments in the ebuild for more information." |
1983 |
writemsg("!!! manually. See the comments in the ebuild for more information.\n") |
1980 |
print |
1984 |
writemsg("\n") |
1981 |
spawn(EBUILD_SH_BINARY+" nofetch",mysettings) |
1985 |
spawn(EBUILD_SH_BINARY+" nofetch",mysettings) |
1982 |
return 0 |
1986 |
return 0 |
1983 |
return 1 |
1987 |
return 1 |
Lines 2076-2082
Link Here
|
2076 |
|
2080 |
|
2077 |
if not os.access(mysettings["DISTDIR"]+"/",os.W_OK): |
2081 |
if not os.access(mysettings["DISTDIR"]+"/",os.W_OK): |
2078 |
if not fetch_to_ro: |
2082 |
if not fetch_to_ro: |
2079 |
print "!!! No write access to %s" % mysettings["DISTDIR"]+"/" |
2083 |
writemsg("!!! No write access to %s" % mysettings["DISTDIR"]+"/") |
2080 |
can_fetch=False |
2084 |
can_fetch=False |
2081 |
else: |
2085 |
else: |
2082 |
if use_locks and locks_in_subdir: |
2086 |
if use_locks and locks_in_subdir: |
Lines 2131-2137
Link Here
|
2131 |
# Verify checksums at each fetch for fetchonly. |
2135 |
# Verify checksums at each fetch for fetchonly. |
2132 |
verified_ok,reason = portage_checksum.verify_all(mysettings["DISTDIR"]+"/"+myfile, mydigests[myfile]) |
2136 |
verified_ok,reason = portage_checksum.verify_all(mysettings["DISTDIR"]+"/"+myfile, mydigests[myfile]) |
2133 |
if not verified_ok: |
2137 |
if not verified_ok: |
2134 |
print reason |
2138 |
writemsg(reason+"\n") |
2135 |
writemsg("!!! Previously fetched file: "+str(myfile)+"\n", noiselevel=-1) |
2139 |
writemsg("!!! Previously fetched file: "+str(myfile)+"\n", noiselevel=-1) |
2136 |
writemsg("!!! Reason: "+reason[0]+"\n", noiselevel=-1) |
2140 |
writemsg("!!! Reason: "+reason[0]+"\n", noiselevel=-1) |
2137 |
writemsg("!!! Got: %s\n!!! Expected: %s\n" % \ |
2141 |
writemsg("!!! Got: %s\n!!! Expected: %s\n" % \ |
Lines 2256-2262
Link Here
|
2256 |
# from another mirror... |
2260 |
# from another mirror... |
2257 |
verified_ok,reason = portage_checksum.verify_all(mysettings["DISTDIR"]+"/"+myfile, mydigests[myfile]) |
2261 |
verified_ok,reason = portage_checksum.verify_all(mysettings["DISTDIR"]+"/"+myfile, mydigests[myfile]) |
2258 |
if not verified_ok: |
2262 |
if not verified_ok: |
2259 |
print reason |
2263 |
writemsg(reason+"\n") |
2260 |
writemsg("!!! Fetched file: "+str(myfile)+" VERIFY FAILED!\n", |
2264 |
writemsg("!!! Fetched file: "+str(myfile)+" VERIFY FAILED!\n", |
2261 |
noiselevel=-1) |
2265 |
noiselevel=-1) |
2262 |
writemsg("!!! Reason: "+reason[0]+"\n", |
2266 |
writemsg("!!! Reason: "+reason[0]+"\n", |
Lines 2922-2928
Link Here
|
2922 |
else: |
2926 |
else: |
2923 |
os.unlink(edpath) |
2927 |
os.unlink(edpath) |
2924 |
except OSError: |
2928 |
except OSError: |
2925 |
print "!!! Failed reseting ebuild distdir path, " + edpath |
2929 |
writemsg("!!! Failed reseting ebuild distdir path, "+edpath+"\n") |
2926 |
raise |
2930 |
raise |
2927 |
os.mkdir(edpath) |
2931 |
os.mkdir(edpath) |
2928 |
apply_secpass_permissions(edpath, gid=portage_gid, mode=0775) |
2932 |
apply_secpass_permissions(edpath, gid=portage_gid, mode=0775) |
Lines 2930-2936
Link Here
|
2930 |
for file in aalist: |
2934 |
for file in aalist: |
2931 |
os.symlink(os.path.join(orig_distdir, file), os.path.join(edpath, file)) |
2935 |
os.symlink(os.path.join(orig_distdir, file), os.path.join(edpath, file)) |
2932 |
except OSError: |
2936 |
except OSError: |
2933 |
print "!!! Failed symlinking in '%s' to ebuild distdir" % file |
2937 |
writemsg("!!! Failed symlinking in '%s' to ebuild distdir" % file) |
|
|
2938 |
writemsg("\n") |
2934 |
raise |
2939 |
raise |
2935 |
|
2940 |
|
2936 |
#initial dep checks complete; time to process main commands |
2941 |
#initial dep checks complete; time to process main commands |
Lines 2973-2979
Link Here
|
2973 |
elif mydo=="qmerge": |
2978 |
elif mydo=="qmerge": |
2974 |
#check to ensure install was run. this *only* pops up when users forget it and are using ebuild |
2979 |
#check to ensure install was run. this *only* pops up when users forget it and are using ebuild |
2975 |
if not os.path.exists(mysettings["PORTAGE_BUILDDIR"]+"/.installed"): |
2980 |
if not os.path.exists(mysettings["PORTAGE_BUILDDIR"]+"/.installed"): |
2976 |
print "!!! mydo=qmerge, but install phase hasn't been ran" |
2981 |
writemsg("!!! mydo=qmerge, but install phase hasn't been ran \n") |
2977 |
sys.exit(1) |
2982 |
sys.exit(1) |
2978 |
# qmerge is a special phase that implies noclean. |
2983 |
# qmerge is a special phase that implies noclean. |
2979 |
if "noclean" not in mysettings.features: |
2984 |
if "noclean" not in mysettings.features: |
Lines 2993-2999
Link Here
|
2993 |
myebuild=mysettings["EBUILD"], mytree=tree, mydbapi=mydbapi, |
2998 |
myebuild=mysettings["EBUILD"], mytree=tree, mydbapi=mydbapi, |
2994 |
vartree=vartree, prev_mtimes=prev_mtimes) |
2999 |
vartree=vartree, prev_mtimes=prev_mtimes) |
2995 |
else: |
3000 |
else: |
2996 |
print "!!! Unknown mydo:",mydo |
3001 |
writemsg("!!! Unknown mydo:"+mydo+"\n") |
2997 |
sys.exit(1) |
3002 |
sys.exit(1) |
2998 |
|
3003 |
|
2999 |
# Make sure that DISTDIR is restored to it's normal value before we return! |
3004 |
# Make sure that DISTDIR is restored to it's normal value before we return! |
Lines 3029-3036
Link Here
|
3029 |
except SystemExit, e: |
3034 |
except SystemExit, e: |
3030 |
raise |
3035 |
raise |
3031 |
except Exception, e: |
3036 |
except Exception, e: |
3032 |
print "!!! Stating source file failed... movefile()" |
3037 |
writemsg("!!! Stating source file failed... movefile()\n") |
3033 |
print "!!!",e |
3038 |
writemsg("!!!"+e+"\n") |
3034 |
return None |
3039 |
return None |
3035 |
|
3040 |
|
3036 |
destexists=1 |
3041 |
destexists=1 |
Lines 3099-3107
Link Here
|
3099 |
except SystemExit, e: |
3104 |
except SystemExit, e: |
3100 |
raise |
3105 |
raise |
3101 |
except Exception, e: |
3106 |
except Exception, e: |
3102 |
print "!!! failed to properly create symlink:" |
3107 |
writemsg("!!! failed to properly create symlink:\n") |
3103 |
print "!!!",dest,"->",target |
3108 |
writemsg("!!!"+dest+"->"+target+"\n") |
3104 |
print "!!!",e |
3109 |
writemsg("!!!"+e+"\n") |
3105 |
return None |
3110 |
return None |
3106 |
|
3111 |
|
3107 |
renamefailed=1 |
3112 |
renamefailed=1 |
Lines 3117-3124
Link Here
|
3117 |
except Exception, e: |
3122 |
except Exception, e: |
3118 |
if e[0]!=errno.EXDEV: |
3123 |
if e[0]!=errno.EXDEV: |
3119 |
# Some random error. |
3124 |
# Some random error. |
3120 |
print "!!! Failed to move",src,"to",dest |
3125 |
writemsg("!!! Failed to move"+src+"to"+dest+"\n") |
3121 |
print "!!!",e |
3126 |
writemsg("!!!"+e+"\n") |
3122 |
return None |
3127 |
return None |
3123 |
# Invalid cross-device-link 'bind' mounted or actually Cross-Device |
3128 |
# Invalid cross-device-link 'bind' mounted or actually Cross-Device |
3124 |
if renamefailed: |
3129 |
if renamefailed: |
Lines 3135-3142
Link Here
|
3135 |
except SystemExit, e: |
3140 |
except SystemExit, e: |
3136 |
raise |
3141 |
raise |
3137 |
except Exception, e: |
3142 |
except Exception, e: |
3138 |
print '!!! copy',src,'->',dest,'failed.' |
3143 |
writemsg('!!! copy'+src+'->'+dest+"failed.\n") |
3139 |
print "!!!",e |
3144 |
writemsg("!!!"+e+"\n") |
3140 |
return None |
3145 |
return None |
3141 |
else: |
3146 |
else: |
3142 |
#we don't yet handle special, so we need to fall back to /bin/mv |
3147 |
#we don't yet handle special, so we need to fall back to /bin/mv |
Lines 3145-3153
Link Here
|
3145 |
else: |
3150 |
else: |
3146 |
a=commands.getstatusoutput(MOVE_BINARY+" -f "+"'"+src+"' '"+dest+"'") |
3151 |
a=commands.getstatusoutput(MOVE_BINARY+" -f "+"'"+src+"' '"+dest+"'") |
3147 |
if a[0]!=0: |
3152 |
if a[0]!=0: |
3148 |
print "!!! Failed to move special file:" |
3153 |
writemsg("!!! Failed to move special file:\n") |
3149 |
print "!!! '"+src+"' to '"+dest+"'" |
3154 |
writemsg("!!! '"+src+"' to '"+dest+"'\n") |
3150 |
print "!!!",a |
3155 |
writemsg("!!!"+a+"\n") |
3151 |
return None # failure |
3156 |
return None # failure |
3152 |
try: |
3157 |
try: |
3153 |
if didcopy: |
3158 |
if didcopy: |
Lines 3160-3168
Link Here
|
3160 |
except SystemExit, e: |
3165 |
except SystemExit, e: |
3161 |
raise |
3166 |
raise |
3162 |
except Exception, e: |
3167 |
except Exception, e: |
3163 |
print "!!! Failed to chown/chmod/unlink in movefile()" |
3168 |
writemsg("!!! Failed to chown/chmod/unlink in movefile()\n") |
3164 |
print "!!!",dest |
3169 |
writemsg("!!!"+dest+"\n") |
3165 |
print "!!!",e |
3170 |
writemsg("!!!"+e+"\n") |
3166 |
return None |
3171 |
return None |
3167 |
|
3172 |
|
3168 |
if newmtime: |
3173 |
if newmtime: |
Lines 4383-4396
Link Here
|
4383 |
try: |
4388 |
try: |
4384 |
counter=long(cfile.readline()) |
4389 |
counter=long(cfile.readline()) |
4385 |
except ValueError: |
4390 |
except ValueError: |
4386 |
print "portage: COUNTER for",mycpv,"was corrupted; resetting to value of 0" |
4391 |
writemsg("portage: COUNTER for"+mycpv+"was corrupted; resetting to value of 0\n") |
4387 |
counter=long(0) |
4392 |
counter=long(0) |
4388 |
corrupted=1 |
4393 |
corrupted=1 |
4389 |
cfile.close() |
4394 |
cfile.close() |
4390 |
elif os.path.exists(cdir): |
4395 |
elif os.path.exists(cdir): |
4391 |
mys = pkgsplit(mycpv) |
4396 |
mys = pkgsplit(mycpv) |
4392 |
myl = self.match(mys[0],use_cache=0) |
4397 |
myl = self.match(mys[0],use_cache=0) |
4393 |
print mys,myl |
4398 |
writemsg(mys+myl+"\n") |
4394 |
if len(myl) == 1: |
4399 |
if len(myl) == 1: |
4395 |
try: |
4400 |
try: |
4396 |
# Only one package... Counter doesn't matter. |
4401 |
# Only one package... Counter doesn't matter. |
Lines 4670-4680
Link Here
|
4670 |
except SystemExit, e: |
4675 |
except SystemExit, e: |
4671 |
raise |
4676 |
raise |
4672 |
except Exception, e: |
4677 |
except Exception, e: |
4673 |
print |
4678 |
writemsg("\nCheck "+self.root+VDB_PATH+"/"+mycpv+"/PROVIDE and USE.\n") |
4674 |
print "Check " + self.root+VDB_PATH+"/"+mycpv+"/PROVIDE and USE." |
4679 |
writemsg("Possibly Invalid: " + str(mylines) + "\n") |
4675 |
print "Possibly Invalid: " + str(mylines) |
4680 |
writemsg("Exception: "+str(e)+"\n\n") |
4676 |
print "Exception: "+str(e) |
|
|
4677 |
print |
4678 |
return [] |
4681 |
return [] |
4679 |
|
4682 |
|
4680 |
def get_all_provides(self): |
4683 |
def get_all_provides(self): |
Lines 5118-5124
Link Here
|
5118 |
try: |
5121 |
try: |
5119 |
myuris = self.aux_get(mypkg, ["SRC_URI"], mytree=mytree)[0] |
5122 |
myuris = self.aux_get(mypkg, ["SRC_URI"], mytree=mytree)[0] |
5120 |
except (IOError,KeyError): |
5123 |
except (IOError,KeyError): |
5121 |
print red("getfetchlist():")+" aux_get() error reading "+mypkg+"; aborting." |
5124 |
writemsg(red("getfetchlist():")+" aux_get() error reading "+mypkg+"; aborting.\n") |
5122 |
sys.exit(1) |
5125 |
sys.exit(1) |
5123 |
|
5126 |
|
5124 |
if useflags is None: |
5127 |
if useflags is None: |
Lines 5142-5148
Link Here
|
5142 |
mf = Manifest(pkgdir, self.mysettings["DISTDIR"]) |
5145 |
mf = Manifest(pkgdir, self.mysettings["DISTDIR"]) |
5143 |
checksums = mf.getDigests() |
5146 |
checksums = mf.getDigests() |
5144 |
if not checksums: |
5147 |
if not checksums: |
5145 |
if debug: print "[empty/missing/bad digest]: "+mypkg |
5148 |
if debug: writemsg("[empty/missing/bad digest]: "+mypkg+"\n") |
5146 |
return None |
5149 |
return None |
5147 |
filesdict={} |
5150 |
filesdict={} |
5148 |
if useflags is None: |
5151 |
if useflags is None: |
Lines 5307-5313
Link Here
|
5307 |
#match *all* visible *and* masked packages |
5310 |
#match *all* visible *and* masked packages |
5308 |
myval=match_from_list(mydep,self.cp_list(mykey)) |
5311 |
myval=match_from_list(mydep,self.cp_list(mykey)) |
5309 |
else: |
5312 |
else: |
5310 |
print "ERROR: xmatch doesn't handle",level,"query!" |
5313 |
writemsg("ERROR: xmatch doesn't handle"+level+"query!\n") |
5311 |
raise KeyError |
5314 |
raise KeyError |
5312 |
if self.frozen and (level not in ["match-list","bestmatch-list"]): |
5315 |
if self.frozen and (level not in ["match-list","bestmatch-list"]): |
5313 |
self.xcache[level][mydep]=myval |
5316 |
self.xcache[level][mydep]=myval |
Lines 5328-5334
Link Here
|
5328 |
cpv=catpkgsplit(mykey) |
5331 |
cpv=catpkgsplit(mykey) |
5329 |
if not cpv: |
5332 |
if not cpv: |
5330 |
#invalid cat/pkg-v |
5333 |
#invalid cat/pkg-v |
5331 |
print "visible(): invalid cat/pkg-v:",mykey |
5334 |
writemsg("visible(): invalid cat/pkg-v:"+mykey+"\n") |
5332 |
return [] |
5335 |
return [] |
5333 |
mycp=cpv[0]+"/"+cpv[1] |
5336 |
mycp=cpv[0]+"/"+cpv[1] |
5334 |
maskdict=self.mysettings.pmaskdict |
5337 |
maskdict=self.mysettings.pmaskdict |
Lines 5338-5344
Link Here
|
5338 |
mymatches=self.xmatch("match-all",x) |
5341 |
mymatches=self.xmatch("match-all",x) |
5339 |
if mymatches is None: |
5342 |
if mymatches is None: |
5340 |
#error in package.mask file; print warning and continue: |
5343 |
#error in package.mask file; print warning and continue: |
5341 |
print "visible(): package.mask entry \""+x+"\" is invalid, ignoring..." |
5344 |
writemsg("visible(): package.mask entry \""+x+"\" is invalid, ignoring...\n") |
5342 |
continue |
5345 |
continue |
5343 |
for y in mymatches: |
5346 |
for y in mymatches: |
5344 |
unmask=0 |
5347 |
unmask=0 |
Lines 5363-5369
Link Here
|
5363 |
mymatches=self.xmatch("match-list",x,mylist=newlist) |
5366 |
mymatches=self.xmatch("match-list",x,mylist=newlist) |
5364 |
if mymatches is None: |
5367 |
if mymatches is None: |
5365 |
#error in packages file; print warning and continue: |
5368 |
#error in packages file; print warning and continue: |
5366 |
print "emerge: visible(): profile packages entry \""+x+"\" is invalid, ignoring..." |
5369 |
writemsg("emerge: visible(): profile packages entry \""+x+"\" is invalid, ignoring...\n") |
5367 |
continue |
5370 |
continue |
5368 |
pos=0 |
5371 |
pos=0 |
5369 |
while pos<len(newlist): |
5372 |
while pos<len(newlist): |
Lines 5690-5696
Link Here
|
5690 |
def gettbz2(self,pkgname): |
5693 |
def gettbz2(self,pkgname): |
5691 |
"fetches the package from a remote site, if necessary." |
5694 |
"fetches the package from a remote site, if necessary." |
5692 |
global settings |
5695 |
global settings |
5693 |
print "Fetching '"+str(pkgname)+"'" |
5696 |
writemsg_stdout("Fetching '"+str(pkgname)+"'\n") |
5694 |
mysplit = string.split(pkgname,"/") |
5697 |
mysplit = string.split(pkgname,"/") |
5695 |
tbz2name = mysplit[1]+".tbz2" |
5698 |
tbz2name = mysplit[1]+".tbz2" |
5696 |
if not self.isremote(pkgname): |
5699 |
if not self.isremote(pkgname): |
Lines 5788-5799
Link Here
|
5788 |
os.unlink(self.dbdir+"/"+x) |
5791 |
os.unlink(self.dbdir+"/"+x) |
5789 |
os.rmdir(self.dbdir) |
5792 |
os.rmdir(self.dbdir) |
5790 |
except OSError, e: |
5793 |
except OSError, e: |
5791 |
print "!!! Unable to remove db entry for this package." |
5794 |
writemsg("!!! Unable to remove db entry for this package.\n") |
5792 |
print "!!! It is possible that a directory is in this one. Portage will still" |
5795 |
writemsg("!!! It is possible that a directory is in this one. Portage will still\n") |
5793 |
print "!!! register this package as installed as long as this directory exists." |
5796 |
writemsg("!!! register this package as installed as long as this directory exists.\n") |
5794 |
print "!!! You may delete this directory with 'rm -Rf "+self.dbdir+"'" |
5797 |
writemsg("!!! You may delete this directory with 'rm -Rf "+self.dbdir+"'\n") |
5795 |
print "!!! "+str(e) |
5798 |
writemsg("!!! "+str(e)+"\n\n") |
5796 |
print |
|
|
5797 |
sys.exit(1) |
5799 |
sys.exit(1) |
5798 |
|
5800 |
|
5799 |
def clearcontents(self): |
5801 |
def clearcontents(self): |
Lines 5848-5854
Link Here
|
5848 |
else: |
5850 |
else: |
5849 |
return None |
5851 |
return None |
5850 |
except (KeyError,IndexError): |
5852 |
except (KeyError,IndexError): |
5851 |
print "portage: CONTENTS line",pos,"corrupt!" |
5853 |
writemsg("portage: CONTENTS line"+pos+"corrupt!\n") |
5852 |
pos += 1 |
5854 |
pos += 1 |
5853 |
self.contentscache=pkgfiles |
5855 |
self.contentscache=pkgfiles |
5854 |
return pkgfiles |
5856 |
return pkgfiles |
Lines 5892-5898
Link Here
|
5892 |
self.settings.load_infodir(self.dbdir) |
5894 |
self.settings.load_infodir(self.dbdir) |
5893 |
|
5895 |
|
5894 |
if not pkgfiles: |
5896 |
if not pkgfiles: |
5895 |
print "No package files given... Grabbing a set." |
5897 |
writemsg_stdout("No package files given... Grabbing a set.\n") |
5896 |
pkgfiles=self.getcontents() |
5898 |
pkgfiles=self.getcontents() |
5897 |
|
5899 |
|
5898 |
# Now, don't assume that the name of the ebuild is the same as the |
5900 |
# Now, don't assume that the name of the ebuild is the same as the |
Lines 6144-6150
Link Here
|
6144 |
if myslot == self.vartree.dbapi.aux_get("/".join((self.cat, v)), ["SLOT"])[0]: |
6146 |
if myslot == self.vartree.dbapi.aux_get("/".join((self.cat, v)), ["SLOT"])[0]: |
6145 |
mypkglist.append(dblink(self.cat,v,destroot,self.settings)) |
6147 |
mypkglist.append(dblink(self.cat,v,destroot,self.settings)) |
6146 |
|
6148 |
|
6147 |
print green("*")+" checking "+str(len(myfilelist))+" files for package collisions" |
6149 |
writemsg_stdout(green("*")+" checking "+str(len(myfilelist))+" files for package collisions\n") |
6148 |
for f in myfilelist: |
6150 |
for f in myfilelist: |
6149 |
nocheck = False |
6151 |
nocheck = False |
6150 |
# listdir isn't intelligent enough to exclude symlinked dirs, |
6152 |
# listdir isn't intelligent enough to exclude symlinked dirs, |
Lines 6157-6163
Link Here
|
6157 |
continue |
6159 |
continue |
6158 |
i=i+1 |
6160 |
i=i+1 |
6159 |
if i % 1000 == 0: |
6161 |
if i % 1000 == 0: |
6160 |
print str(i)+" files checked ..." |
6162 |
writemsg_stdout(str(i)+" files checked ...\n") |
6161 |
if f[0] != "/": |
6163 |
if f[0] != "/": |
6162 |
f="/"+f |
6164 |
f="/"+f |
6163 |
isowned = False |
6165 |
isowned = False |
Lines 6166-6182
Link Here
|
6166 |
isowned = True |
6168 |
isowned = True |
6167 |
break |
6169 |
break |
6168 |
if not isowned: |
6170 |
if not isowned: |
6169 |
print "existing file "+f+" is not owned by this package" |
6171 |
writemsg("existing file "+f+" is not owned by this package\n") |
6170 |
stopmerge=True |
6172 |
stopmerge=True |
6171 |
print green("*")+" spent "+str(time.time()-starttime)+" seconds checking for file collisions" |
6173 |
writemsg(green("*")+" spent "+str(time.time()-starttime)+" seconds checking for file collisions\n") |
6172 |
if stopmerge: |
6174 |
if stopmerge: |
6173 |
print red("*")+" This package is blocked because it wants to overwrite" |
6175 |
writemsg(red("*")+" This package is blocked because it wants to overwrite\n") |
6174 |
print red("*")+" files belonging to other packages (see messages above)." |
6176 |
writemsg(red("*")+" files belonging to other packages (see messages above).\n") |
6175 |
print red("*")+" If you have no clue what this is all about report it " |
6177 |
writemsg(red("*")+" If you have no clue what this is all about report it \n") |
6176 |
print red("*")+" as a bug for this package on http://bugs.gentoo.org" |
6178 |
writemsg(red("*")+" as a bug for this package on http://bugs.gentoo.org\n\n") |
6177 |
print |
6179 |
writemsg(red("package "+self.cat+"/"+self.pkg+" NOT merged\n\n")) |
6178 |
print red("package "+self.cat+"/"+self.pkg+" NOT merged") |
|
|
6179 |
print |
6180 |
# Why is the package already merged here db-wise? Shouldn't be the case |
6180 |
# Why is the package already merged here db-wise? Shouldn't be the case |
6181 |
# only unmerge if it ia new package and has no contents |
6181 |
# only unmerge if it ia new package and has no contents |
6182 |
if not self.getcontents(): |
6182 |
if not self.getcontents(): |
Lines 6434-6444
Link Here
|
6434 |
# unlinking no longer necessary; "movefile" will overwrite symlinks atomically and correctly |
6434 |
# unlinking no longer necessary; "movefile" will overwrite symlinks atomically and correctly |
6435 |
mymtime=movefile(mysrc,mydest,newmtime=thismtime,sstat=mystat, mysettings=self.settings) |
6435 |
mymtime=movefile(mysrc,mydest,newmtime=thismtime,sstat=mystat, mysettings=self.settings) |
6436 |
if mymtime!=None: |
6436 |
if mymtime!=None: |
6437 |
print ">>>",mydest,"->",myto |
6437 |
writemsg_stdout(">>>"+mydest+"->"+myto) |
6438 |
outfile.write("sym "+myrealdest+" -> "+myto+" "+str(mymtime)+"\n") |
6438 |
outfile.write("sym "+myrealdest+" -> "+myto+" "+str(mymtime)+"\n") |
6439 |
else: |
6439 |
else: |
6440 |
print "!!! Failed to move file." |
6440 |
writemsg("!!! Failed to move file.\n") |
6441 |
print "!!!",mydest,"->",myto |
6441 |
writemsg("!!!"+mydest+"->"+myto+"\n") |
6442 |
sys.exit(1) |
6442 |
sys.exit(1) |
6443 |
elif stat.S_ISDIR(mymode): |
6443 |
elif stat.S_ISDIR(mymode): |
6444 |
# we are merging a directory |
6444 |
# we are merging a directory |
Lines 6470-6476
Link Here
|
6470 |
# a non-directory and non-symlink-to-directory. Won't work for us. Move out of the way. |
6470 |
# a non-directory and non-symlink-to-directory. Won't work for us. Move out of the way. |
6471 |
if movefile(mydest,mydest+".backup", mysettings=self.settings) is None: |
6471 |
if movefile(mydest,mydest+".backup", mysettings=self.settings) is None: |
6472 |
sys.exit(1) |
6472 |
sys.exit(1) |
6473 |
print "bak",mydest,mydest+".backup" |
6473 |
writemsg("bak"+mydest+mydest+".backup\n") |
6474 |
#now create our directory |
6474 |
#now create our directory |
6475 |
if self.settings.selinux_enabled(): |
6475 |
if self.settings.selinux_enabled(): |
6476 |
sid = selinux.get_sid(mysrc) |
6476 |
sid = selinux.get_sid(mysrc) |
Lines 6524-6530
Link Here
|
6524 |
if cfgfiledict.has_key(myrealdest): |
6524 |
if cfgfiledict.has_key(myrealdest): |
6525 |
if destmd5 in cfgfiledict[myrealdest]: |
6525 |
if destmd5 in cfgfiledict[myrealdest]: |
6526 |
#cycle |
6526 |
#cycle |
6527 |
print "cycle" |
6527 |
writemsg_stdout("cycle\n") |
6528 |
del cfgfiledict[myrealdest] |
6528 |
del cfgfiledict[myrealdest] |
6529 |
cycled=1 |
6529 |
cycled=1 |
6530 |
if mymd5==destmd5: |
6530 |
if mymd5==destmd5: |
Lines 6722-6735
Link Here
|
6722 |
if vartree is None: |
6722 |
if vartree is None: |
6723 |
vartree = db[myroot]["vartree"] |
6723 |
vartree = db[myroot]["vartree"] |
6724 |
if mytbz2[-5:]!=".tbz2": |
6724 |
if mytbz2[-5:]!=".tbz2": |
6725 |
print "!!! Not a .tbz2 file" |
6725 |
writemsg("!!! Not a .tbz2 file") |
6726 |
return None |
6726 |
return None |
6727 |
mypkg=os.path.basename(mytbz2)[:-5] |
6727 |
mypkg=os.path.basename(mytbz2)[:-5] |
6728 |
xptbz2=xpak.tbz2(mytbz2) |
6728 |
xptbz2=xpak.tbz2(mytbz2) |
6729 |
pkginfo={} |
6729 |
pkginfo={} |
6730 |
mycat=xptbz2.getfile("CATEGORY") |
6730 |
mycat=xptbz2.getfile("CATEGORY") |
6731 |
if not mycat: |
6731 |
if not mycat: |
6732 |
print "!!! CATEGORY info missing from info chunk, aborting..." |
6732 |
writemsg("!!! CATEGORY info missing from info chunk, aborting...") |
6733 |
return None |
6733 |
return None |
6734 |
mycat=mycat.strip() |
6734 |
mycat=mycat.strip() |
6735 |
mycatpkg=mycat+"/"+mypkg |
6735 |
mycatpkg=mycat+"/"+mypkg |
Lines 6756-6762
Link Here
|
6756 |
writemsg_stdout(">>> Extracting %s\n" % mypkg) |
6756 |
writemsg_stdout(">>> Extracting %s\n" % mypkg) |
6757 |
notok=spawn("bzip2 -dqc -- '"+mytbz2+"' | tar xpf -",mysettings,free=1) |
6757 |
notok=spawn("bzip2 -dqc -- '"+mytbz2+"' | tar xpf -",mysettings,free=1) |
6758 |
if notok: |
6758 |
if notok: |
6759 |
print "!!! Error Extracting",mytbz2 |
6759 |
writemsg("!!! Error Extracting "+mytbz2) |
6760 |
cleanup_pkgmerge(mypkg,origdir) |
6760 |
cleanup_pkgmerge(mypkg,origdir) |
6761 |
return None |
6761 |
return None |
6762 |
|
6762 |
|
Lines 6985-6992
Link Here
|
6985 |
# Update progress above is indicated by characters written to stdout so |
6985 |
# Update progress above is indicated by characters written to stdout so |
6986 |
# we print a couple new lines here to separate the progress output from |
6986 |
# we print a couple new lines here to separate the progress output from |
6987 |
# what follows. |
6987 |
# what follows. |
6988 |
print |
6988 |
writemsg_stdout("\n\n") |
6989 |
print |
|
|
6990 |
|
6989 |
|
6991 |
#make sure our internal databases are consistent; recreate our virts and vartree |
6990 |
#make sure our internal databases are consistent; recreate our virts and vartree |
6992 |
do_vartree(mysettings, trees=trees) |
6991 |
do_vartree(mysettings, trees=trees) |