Kaydet (Commit) 7745debc authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Revert "fixes"

This reverts commit 9c9b6073.
Pull request açmadan bu tip kırıcı commitleri atmayınız.
üst 9c9b6073
......@@ -45,8 +45,8 @@ all repositories.
def options(self):
group = optparse.OptionGroup(self.parser, _("list-available options"))
group.add_option("-n", "--name-only", action="store_true",
default=False, help=_("Write only names."))
group.add_option("-l", "--long", action="store_true",
default=False, help=_("Show in long format"))
group.add_option("-c", "--component", action="store",
default=None, help=_("List available packages under given component"))
group.add_option("-U", "--uninstalled", action="store_true",
......@@ -91,16 +91,15 @@ all repositories.
if ctx.config.get_option('uninstalled') and p in installed_list:
continue
pkgname=""
package = self.packagedb.get_package(p, repo)
if p in installed_list:
pkgname = util.colorize(p, 'green')
package.name = util.colorize(package.name, 'green')
else:
pkgname = util.colorize(p, 'brightwhite')
package.name = util.colorize(package.name, 'brightwhite')
if self.options.name_only:
ctx.ui.info(str(pkgname))
if self.options.long:
ctx.ui.info(str(package) + '\n')
else:
package = self.packagedb.get_package(p, repo)
pkgname += ' ' * max(0, maxlen - len(p))
ctx.ui.info('{0} - {1} '.format(pkgname, str(package.summary)))
package.name += ' ' * max(0, maxlen - len(p))
ctx.ui.info('{0} - {1} '.format(package.name, str(package.summary)))
......@@ -49,8 +49,6 @@ Usage: list-installed
"by the given host."))
group.add_option("-l", "--long", action="store_true",
default=False, help=_("Show in long format"))
group.add_option("-n", "--name-only", action="store_true",
default=False, help=_("Write only names."))
group.add_option("-c", "--component", action="store",
default=None, help=_("List installed packages under given component."))
group.add_option("-i", "--install-info", action="store_true",
......@@ -81,28 +79,16 @@ Usage: list-installed
if self.options.install_info:
ctx.ui.info(_('Package Name |St| Version| Rel.| Distro| Date'))
sys.stdout.write('===========================================================================\n')
if self.options.long:
for pkg in installed:
package = self.installdb.get_package(pkg)
inst_info = self.installdb.get_info(pkg)
for pkg in installed:
package = self.installdb.get_package(pkg)
inst_info = self.installdb.get_info(pkg)
if self.options.long:
ctx.ui.info(str(package))
ctx.ui.info(str(inst_info))
elif self.options.install_info:
for pkg in installed:
inst_info = self.installdb.get_info(pkg)
ctx.ui.info('%-20s ' % pkg, color='white', noln=True)
elif self.options.install_info:
ctx.ui.info('%-20s ' % package.name, color='white', noln=True)
ctx.ui.info('|%s' % inst_info.one_liner())
elif self.options.name_only:
for pkg in installed:
ctx.ui.info(pkg, color='white')
else:
for pkg in installed:
pkgname=pkg
package = self.installdb.get_package(pkg)
pkgname += ' ' * (maxlen - len(package.name))
ctx.ui.info('{} '.format(pkgname), color='white', noln=True)
else:
package.name += ' ' * (maxlen - len(package.name))
ctx.ui.info('{} '.format(package.name), color='white', noln=True)
ctx.ui.info('- {}'.format(str(package.summary)))
......@@ -37,8 +37,6 @@ class runsysconf(command.PackageOp, metaclass=command.autocommand):
def options(self):
group = optparse.OptionGroup(self.parser, _("sysconf options"))
group.add_option("-f","--force", action="store_true",
default=False, help=_("Run force sysconf"))
def run(self):
sc.proceed(self.options.force)
sc.proceed(self.options.force_sysconf)
......@@ -20,7 +20,6 @@ import sys
import gettext
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext
sysconfdir="/var/lib/inary/sysconf"
def getmtime(path):
"""Get file or directory modify time"""
if not os.path.exists(path):
......@@ -30,9 +29,9 @@ def getmtime(path):
def getltime(name):
"""Get last modify time from database"""
location = sysconfdir+"/{}".format(name)
if not os.path.exists(sysconfdir):
os.mkdir(sysconfdir)
location = "/var/lib/triggers/{}".format(name)
if not os.path.exists("/var/lib/triggers"):
os.mkdir("/var/lib/triggers")
if not os.path.exists(location):
setltime(name, 0)
return int(open(location, "r").readline().replace("\n", ""))
......@@ -40,7 +39,7 @@ def getltime(name):
def setltime(name, value):
"""Set last modify time to database"""
location = sysconfdir+"/{}".format(name)
location = "/var/lib/triggers/{}".format(name)
open(location, "w").write(str(value))
......@@ -68,7 +67,7 @@ def t_r(name, path, command):
def proceed(force=False):
sys.stdout.write(_("Process triggering for sysconf.\n"))
if force:
os.system("rm -rf {}".format(sysconfdir))
os.system("rm -rf {}".format("/var/lib/triggers"))
t("fonts", "/usr/share/fonts", "fc-cache -f")
t("glib-schema", "/usr/share/glib-2.0/schemas/", "glib-compile-schemas /usr/share/glib-2.0/schemas/")
t_r("icon", "/usr/share/icons", "gtk-update-icon-cache -t -f /usr/share/icons/")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment