if mydo=="fetch" and listonly:
return 0
- if "digest" in features:
- #generate digest if it doesn't exist.
- if mydo=="digest":
- return (not digestgen(aalist, mysettings, overwrite=1, myportdb=mydbapi))
- else:
+ try:
+ if mydo == "manifest":
+ return not digestgen(aalist, mysettings, overwrite=1,
+ manifestonly=1, myportdb=mydbapi)
+ elif mydo == "digest":
+ return not digestgen(aalist, mysettings, overwrite=1,
+ myportdb=mydbapi)
+ elif "digest" in mysettings.features:
digestgen(aalist, mysettings, overwrite=0, myportdb=mydbapi)
- elif mydo=="digest":
- #since we are calling "digest" directly, recreate the digest even if it already exists
- return (not digestgen(aalist, mysettings, overwrite=1, myportdb=mydbapi))
- if mydo=="manifest":
- return (not digestgen(aalist,mysettings,overwrite=1,manifestonly=1, myportdb=mydbapi))
+ except portage_exception.PermissionDenied, e:
+ writemsg("!!! %s\n" % str(e))
+ if mydo in ("digest", "manifest"):
+ return 1
# See above comment about fetching only when needed
if not digestcheck(checkme, mysettings, ("strict" in features),
def write(self, sign=False, force=False):
""" Write Manifest instance to disk, optionally signing it """
- if self.compat:
- self._writeDigests()
- myentries = list(self._createManifestEntries())
- update_manifest = True
- if not force:
- try:
- f = open(self.getFullname(), "r")
- oldentries = list(self._parseManifestLines(f))
- f.close()
- if len(oldentries) == len(myentries):
- update_manifest = False
- for i in xrange(len(oldentries)):
- if oldentries[i] != myentries[i]:
- update_manifest = True
- break
- except (IOError, OSError), e:
- if e.errno == errno.ENOENT:
- pass
- else:
- raise
- if update_manifest:
- fd = open(self.getFullname(), "w")
- for myentry in myentries:
- fd.write("%s\n" % str(myentry))
- fd.close()
- if sign:
- self.sign()
-
+ try:
+ if self.compat:
+ self._writeDigests()
+ myentries = list(self._createManifestEntries())
+ update_manifest = True
+ if not force:
+ try:
+ f = open(self.getFullname(), "r")
+ oldentries = list(self._parseManifestLines(f))
+ f.close()
+ if len(oldentries) == len(myentries):
+ update_manifest = False
+ for i in xrange(len(oldentries)):
+ if oldentries[i] != myentries[i]:
+ update_manifest = True
+ break
+ except (IOError, OSError), e:
+ if e.errno == errno.ENOENT:
+ pass
+ else:
+ raise
+ if update_manifest:
+ fd = open(self.getFullname(), "w")
+ for myentry in myentries:
+ fd.write("%s\n" % str(myentry))
+ fd.close()
+ if sign:
+ self.sign()
+ except (IOError, OSError), e:
+ if e.errno == errno.EACCES:
+ raise PermissionDenied(str(e))
+ raise
+
def sign(self):
""" Sign the Manifest """
raise NotImplementedError()