def main(): args = sys.argv[1:] if len(args) not in (1, 2): usage() base_packages = Packages.fromfile(args[0]) try: packages = Packages.fromfile(args[1]) except: packages = Packages() for package in packages - base_packages: print package
def main(): args = sys.argv[1:] if len(args) not in (1, 2): usage() base_packages = Packages.fromfile(args[0]) try: packages = Packages.fromfile(args[1]) except: packages = Packages() for package in (packages - base_packages): print package
def _write_new_packages(self, dest, base_packages): base_packages = Packages.fromfile(base_packages) current_packages = Packages() new_packages = list(current_packages - base_packages) new_packages.sort() if new_packages: self._log("Save list of new packages:\n") self._log(" cat > %s << EOF " % dest) self._log(" " + " ".join(new_packages)) self._log(" EOF\n") fh = file(dest, "w") for package in new_packages: print >> fh, package fh.close()
def rollback_new_packages(self): if not exists(self.paths.newpkgs): return rollback_packages = Packages.fromfile(self.paths.newpkgs) current_packages = Packages() purge_packages = current_packages & rollback_packages if purge_packages: os.system("DEBIAN_FRONTEND=noninteractive dpkg --purge " + " ".join(purge_packages))
def _write_new_packages(dest, base_packages): base_packages = Packages.fromfile(base_packages) current_packages = Packages() fh = file(dest, "w") new_packages = list(current_packages - base_packages) new_packages.sort() for package in new_packages: print >> fh, package fh.close()