diff --git a/i18n/cl_builder_ru.mo b/i18n/cl_builder_ru.mo index 9d6b44b..23573fa 100644 Binary files a/i18n/cl_builder_ru.mo and b/i18n/cl_builder_ru.mo differ diff --git a/pym/cl_builder.py b/pym/cl_builder.py index f0bf9c5..b777c53 100644 --- a/pym/cl_builder.py +++ b/pym/cl_builder.py @@ -434,6 +434,12 @@ class cl_builder(color_print): self.printMessageForTest(_("Creating installed package list")) self.printByResult(self.createPackageList(sourceDirectory, isoFile[:-4]+".list")) + self.printMessageForTest(_("Creating mask list")) + self.printByResult(self.createMaskList(sourceDirectory, + isoFile[:-4]+".mask")) + self.printMessageForTest(_("Creating unmask list")) + self.printByResult(self.createUnmaskList(sourceDirectory, + isoFile[:-4]+".unmask")) self.printMessageForTest(_("Creating DIGESTS file")) self.printByResult(self.createDigest(isoFile,isoFile+".DIGESTS")) @@ -650,6 +656,38 @@ class cl_builder(color_print): return False return True + def createMaskList(self,chrootdir,filename): + """Create package mask list by chrootdir""" + pkgdir = path.join(chrootdir,'var/db/pkg') + reVerSplit = re.compile(r"^(.*?)-(([^-]+?)(?:-(r\d+))?)$",re.S) + if not path.exists(chrootdir): + return False + try: + packageList = sorted(reduce(lambda x,y:x+map(lambda x:path.join(y,x), + os.listdir(path.join(pkgdir,y))), os.listdir(pkgdir),[])) + open(filename,'w').writelines( + map(lambda x:"%s\n"%x, + map(lambda x:x.groups()[0], + filter(lambda x:x, + map(reVerSplit.search, + packageList))))) + except (IOError,OSError),e: + return False + return True + + def createUnmaskList(self,chrootdir,filename): + """Create package unmask list by chrootdir""" + pkgdir = path.join(chrootdir,'var/db/pkg') + if not path.exists(chrootdir): + return False + try: + packageList = sorted(reduce(lambda x,y:x+map(lambda x:path.join(y,x), + os.listdir(path.join(pkgdir,y))), os.listdir(pkgdir),[])) + open(filename,'w').writelines(map(lambda x:"=%s\n"%x,packageList)) + except (IOError,OSError),e: + return False + return True + def createDigest(self,filename,digestfile): """Create file with digest""" template = """# %(alg)s HASH\n%(digest)s %(filename)s\n"""