Пример #1
0
    def __init__(self):
        DnfBase.__init__(self)
        if len(sys.argv) < 2:
            print("USAGE: dnf-updateinfo <packagename>")
            sys.exit(1)
        key = sys.argv[1]
        subj = dnf.subject.Subject(key)
        qa = subj.get_best_query(self.sack, with_provides=False)
        qa = qa.available()
        print("==== latest matching {} =====".format(key))
        for pkg in qa.latest():
            print("pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
            # Get advisories for this package only
            # hawkey.LT for versions Less than
            # hawkey.GT for versions Greater than
            advs = pkg.get_advisories(hawkey.EQ)
            if advs:
                adv = advs[0]
                fns = "\n".join(adv.filenames)
                print(ADV_INFO.format(adv, ADV_TYPES[adv.type], fns))
                if adv.references:
                    print("References :\n")
                    for ref in adv.references:
                        print(REF_INFO.format(ref))

            else:
                print("  No advisory found for this packages")
Пример #2
0
    def __init__(self):
        DnfBase.__init__(self)
        if len(sys.argv) < 2:
            print("USAGE: dnf-updateinfo <packagename>")
            sys.exit(1)
        key = sys.argv[1]
        subj = dnf.subject.Subject(key)
        qa = subj.get_best_query(self.sack, with_provides=False)
        qa = qa.available()
        print("==== latest matching {} =====".format(key))
        for pkg in qa.latest():
            print("pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
            # Get advisories for this package only
            # hawkey.LT for versions Less than
            # hawkey.GT for versions Greater than
            advs = pkg.get_advisories(hawkey.EQ)
            if advs:
                adv = advs[0]
                fns = "\n".join(adv.filenames)
                print(ADV_INFO.format(adv, ADV_TYPES[adv.type], fns))
                if adv.references:
                    print("References :\n")
                    for ref in adv.references:
                        print(REF_INFO.format(ref))

            else:
                print("  No advisory found for this packages")
Пример #3
0
 def __init__(self):
     DnfBase.__init__(self)
     print("======= packages with reponame = dnf-daemon-test ======")
     q = self.sack.query()  # get the sack query object
     print("Available in repositories: ")
     a = q.available()  # get all available package
     a = a.filter(reponame="dnf-daemon-test")  # filter packages with the name kernel
     for pkg in a:  # a only gets evaluated here
         print("  pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
Пример #4
0
 def __init__(self):
     DnfBase.__init__(self)
     fields = ["name","summary","description"]
     values = ['yum','plugin']
     pkgs = self.search(fields,values)
     print("%d packages found (match_all)" % len(pkgs))
     pkgs = self.search(fields,values, match_all=False)
     print("%d packages found" % len(pkgs))
     pkgs = self.search(fields,values, showdups=True)
     print("%d packages found (showdups)" % len(pkgs))
Пример #5
0
 def __init__(self):
     DnfBase.__init__(self)
     self.progress = Progress()
     print("=============== install btanks =====================")
     if os.getuid() != 0:
         print("You need to run this as root")
         return
     rc = self.install('btanks')
     print("# of packages added : %d" % rc)
     self.apply_transaction()
Пример #6
0
 def __init__(self):
     DnfBase.__init__(self)
     print("======= packages with reponame = dnf-daemon-test ======")
     q = self.sack.query()  # get the sack query object
     print("Available in repositories: ")
     a = q.available()  # get all available package
     a = a.filter(
         reponame='dnf-daemon-test')  # filter packages with the name kernel
     for pkg in a:  # a only gets evaluated here
         print("  pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
Пример #7
0
 def __init__(self):
     DnfBase.__init__(self)
     fields = ["name", "summary", "description"]
     values = ['yum', 'plugin']
     pkgs = self.search(fields, values)
     print("%d packages found (match_all)" % len(pkgs))
     pkgs = self.search(fields, values, match_all=False)
     print("%d packages found" % len(pkgs))
     pkgs = self.search(fields, values, showdups=True)
     print("%d packages found (showdups)" % len(pkgs))
Пример #8
0
 def __init__(self):
     DnfBase.__init__(self)
     name = 'yum'
     arch = 'noarch'
     ipkg, downgrades = self._get_downgrades(name, arch)
     if ipkg:
         print("Installed : %s " % str(ipkg))
         print("# of downgrades = %d" % (len(downgrades)))
         for pkg in downgrades:
             print(str(pkg))
Пример #9
0
 def __init__(self):
     DnfBase.__init__(self)
     name = 'yum'
     arch = 'noarch'
     ipkg, downgrades = self._get_downgrades(name, arch)
     if ipkg:
         print("Installed : %s " % str(ipkg))
         print("# of downgrades = %d" % (len(downgrades)))
         for pkg in downgrades:
             print(str(pkg))
Пример #10
0
 def __init__(self):
     DnfBase.__init__(self)
     self.progress = Progress()
     print("=============== install btanks =====================")
     if os.getuid() != 0:
         print("You need to run this as root")
         return
     rc = self.install('btanks')
     print("# of packages added : %d" % rc)
     self.apply_transaction()
Пример #11
0
 def __init__(self):
     DnfBase.__init__(self)
     if len(sys.argv) < 2:
         print("USAGE: dnf-updateinfo <packagename>")
         sys.exit(1)
     key = sys.argv[1]
     subj = dnf.subject.Subject(key)
     qa = subj.get_best_query(self.sack, with_provides=False)
     qa = qa.available()
     print("==== latest matching {} =====".format(key))
     for pkg in qa.latest():
         print("pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
         req_dict = self._get_requirements(pkg)
         self.show_req(req_dict)
Пример #12
0
 def __init__(self):
     DnfBase.__init__(self)
     if len(sys.argv) < 2:
         print("USAGE: dnf-updateinfo <packagename>")
         sys.exit(1)
     key = sys.argv[1]
     subj = dnf.subject.Subject(key)
     qa = subj.get_best_query(self.sack, with_provides=False)
     qa = qa.available()
     print("==== latest matching {} =====".format(key))
     for pkg in qa.run():
         print("pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
         files = pkg.files
         print("\n".join(files))
Пример #13
0
 def __init__(self):
     DnfBase.__init__(self)
     if len(sys.argv) < 2:
         print("USAGE: dnf-updateinfo <packagename>")
         sys.exit(1)
     key = sys.argv[1]
     subj = dnf.subject.Subject(key)
     qa = subj.get_best_query(self.sack, with_provides=False)
     qa = qa.available()
     print("==== latest matching {} =====".format(key))
     for pkg in qa.run():
         print("pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
         files = pkg.files
         print("\n".join(files))
Пример #14
0
 def __init__(self):
     DnfBase.__init__(self)
     key = sys.argv[1]
     subj = dnf.subject.Subject(key)
     qa = subj.get_best_query(self.sack, with_provides=False)
     qa = qa.available()
     print("==== all packages  matching {} =====".format(key))
     for pkg in qa:
         print("  pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
     print("==== latest matching {} =====".format(key))
     for pkg in qa.latest():
         print("  pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
     print("==== Installed matching {} =====".format(key))
     for pkg in qa.installed():
         print("  pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
Пример #15
0
 def __init__(self):
     DnfBase.__init__(self)
     key = sys.argv[1]
     subj = dnf.subject.Subject(key)
     qa = subj.get_best_query(self.sack, with_provides=False)
     qa = qa.available()
     print("==== all packages  matching {} =====".format(key))
     for pkg in qa:
         print("  pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
     print("==== latest matching {} =====".format(key))
     for pkg in qa.latest():
         print("  pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
     print("==== Installed matching {} =====".format(key))
     for pkg in qa.installed():
         print("  pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
Пример #16
0
 def __init__(self):
     DnfBase.__init__(self)
     self.progress = Progress()
     print("=============== install btanks =====================")
     if os.getuid() != 0:
         print("You need to run this as root")
         return
     rc = self.install('btanks')
     self.apply_transaction()
     self.fill_sack()  # refresh the sack
     # this is not public API
     # removing is not very useful, if we cant remove the deps
     self.goal_parameters.allow_uninstall = True
     rc = self.remove('btanks')
     print("# of packages added : %d" % rc)
     self.apply_transaction()
Пример #17
0
 def __init__(self):
     DnfBase.__init__(self)
     self.progress = Progress()
     print("=============== install btanks =====================")
     if os.getuid() != 0:
         print("You need to run this as root")
         return
     rc = self.install('btanks')
     self.apply_transaction()
     self.fill_sack() # refresh the sack
     # this is not public API
     # removing is not very useful, if we cant remove the deps
     self.goal_parameters.allow_uninstall = True
     rc = self.remove('btanks')
     print("# of packages added : %d" % rc)
     self.apply_transaction()
Пример #18
0
 def __init__(self):
     DnfBase.__init__(self, setup_sack=False)
     for repo in self.repos.all():
         if repo.id == 'dnf-daemon-test':
             repo.enable()
         else:
             repo.disable()
     self.setup_base()
     q = self.sack.query()  # get the sack query object
     print("Available in repositories: all")
     a = q.available()  # get all available package
     for pkg in a:  # a only gets evaluated here
         print("  pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
     print("Available in repositories: latest")
     a = q.available().latest()  # get all available package
     for pkg in a:  # a only gets evaluated here
         print("  pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
Пример #19
0
 def __init__(self):
     DnfBase.__init__(self, setup_sack=False)
     for repo in self.repos.all():
         if repo.id == 'dnf-daemon-test':
             repo.enable()
         else:
             repo.disable()
     self.setup_base()
     q = self.sack.query()         # get the sack query object
     print("Available in repositories: all")
     a = q.available()             # get all available package
     for pkg in a:                 # a only gets evaluated here
         print("  pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
     print("Available in repositories: latest")
     a = q.available().latest()             # get all available package
     for pkg in a:                 # a only gets evaluated here
         print("  pkg : %-40s repo :  %-20s" % (pkg, pkg.reponame))
Пример #20
0
 def __init__(self):
     DnfBase.__init__(self,setup_sack=False) # dont load the sack yet
     self.progress = MDProgress()
     # Find some repositories matching a filter
     print("Find *-source repos")
     for repo in self.find_repos("*-source"):
         print("  : %s" % repo.id)
     # Enable & disable some repositories
     self.enable_repos(['updates-testing'])
     self.disable_repos(['Dropbox'])
     self.repos.all().set_progress_bar(self.progress)
     print("Enabled repositories : ")
     for repo in self.repos.iter_enabled():
         print("  : %s" % repo.id)
     print("Setting up the package sack")
     self.fill_sack()
     print("show repo attributes")
     self.get_repo_attr('updates')
Пример #21
0
 def __init__(self):
     DnfBase.__init__(self, setup_sack=False)  # dont load the sack yet
     self.progress = MDProgress()
     # Find some repositories matching a filter
     print("Find *-source repos")
     for repo in self.find_repos("*-source"):
         print("  : %s" % repo.id)
     # Enable & disable some repositories
     self.enable_repos(['updates-testing'])
     self.disable_repos(['Dropbox'])
     self.repos.all().set_progress_bar(self.progress)
     print("Enabled repositories : ")
     for repo in self.repos.iter_enabled():
         print("  : %s" % repo.id)
     print("Setting up the package sack")
     self.fill_sack()
     print("show repo attributes")
     self.get_repo_attr('updates')
Пример #22
0
 def __init__(self):
     DnfBase.__init__(self)
     self.read_comps()
     grps = self.comps.groups
     for grp in grps:
         print("%-30s : %s" % (grp.id, grp.ui_name))
     i = 0
     for grp in grps:
         i += 1
         if i % 10 == 0:
             self.show_group_packages(grp)
     cats = self.comps.categories
     for cat in cats:
         print(cat.name)
         for obj in cat.group_ids: # groups_ids is not public api
             grp = self.comps.group_by_pattern(obj.name) # get the dnf group obj
             if grp:
                 print("    ", grp.name, grp.ui_name)
             else:
                 print ("     ******* Not Found : %s " % obj.name)
Пример #23
0
 def __init__(self):
     DnfBase.__init__(self)
     self.read_comps()
     grps = self.comps.groups
     for grp in grps:
         print("%-30s : %s" % (grp.id, grp.ui_name))
     i = 0
     for grp in grps:
         i += 1
         if i % 10 == 0:
             self.show_group_packages(grp)
     cats = self.comps.categories
     for cat in cats:
         print(cat.name)
         for obj in cat.group_ids:  # groups_ids is not public api
             grp = self.comps.group_by_pattern(
                 obj.name)  # get the dnf group obj
             if grp:
                 print("    ", grp.name, grp.ui_name)
             else:
                 print("     ******* Not Found : %s " % obj.name)