From df9c4f628bb7c99560d1fe41e383182113931247 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 6 Aug 2011 14:16:57 +0200 Subject: [PATCH] Remove pakfire-repo command. --- Makefile | 3 +- pakfire/cli.py | 107 +++++++++---------------------------------- po/POTFILES.in | 1 + po/pakfire.pot | 66 +++++++++++++++----------- scripts/pakfire | 1 - scripts/pakfire-repo | 1 - setup.py | 1 - 7 files changed, 65 insertions(+), 115 deletions(-) delete mode 120000 scripts/pakfire-repo diff --git a/Makefile b/Makefile index 953957623..131b88438 100644 --- a/Makefile +++ b/Makefile @@ -30,4 +30,5 @@ check: .PHONY: po po: - find pakfire src -name "*.py" -or -name "*.c" | grep -v "__version__.py" | sort > po/POTFILES.in + find pakfire src scripts -name "*.py" -or -name "*.c" -or -name "pakfire" -and -type f | \ + grep -v "__version__.py" | sort > po/POTFILES.in diff --git a/pakfire/cli.py b/pakfire/cli.py index 9ca21311f..8a7333b77 100644 --- a/pakfire/cli.py +++ b/pakfire/cli.py @@ -426,91 +426,6 @@ class CliBuilder(Cli): print pkg.dump(long=True) -class CliRepo(Cli): - def __init__(self): - self.parser = argparse.ArgumentParser( - description = _("Pakfire repo command line interface."), - ) - - self.parse_common_arguments() - - # Add sub-commands. - self.sub_commands = self.parser.add_subparsers() - - self.parse_command_repo() - - # Finally parse all arguments from the command line and save them. - self.args = self.parser.parse_args() - - self.action2func = { - "repo_create" : self.handle_repo_create, - } - - @property - def pakfire_args(self): - ret = { "mode" : "repo" } - - return ret - - def parse_command_repo(self): - sub_repo = self.sub_commands.add_parser("repo", - help=_("Repository management commands.")) - - sub_repo_commands = sub_repo.add_subparsers() - - self.parse_command_repo_create(sub_repo_commands) - - def parse_command_repo_create(self, sub_commands): - sub_create = sub_commands.add_parser("create", - help=_("Create a new repository index.")) - sub_create.add_argument("path", nargs=1, help=_("Path to the packages.")) - sub_create.add_argument("inputs", nargs="+", help=_("Path to input packages.")) - sub_create.add_argument("action", action="store_const", const="repo_create") - - def handle_repo_create(self): - path = self.args.path[0] - - pakfire.repo_create(path, self.args.inputs, **self.pakfire_args) - - -class CliMaster(Cli): - def __init__(self): - self.parser = argparse.ArgumentParser( - description = _("Pakfire master command line interface."), - ) - - self.parse_common_arguments() - - # Add sub-commands. - self.sub_commands = self.parser.add_subparsers() - - self.parse_command_update() - - # Finally parse all arguments from the command line and save them. - self.args = self.parser.parse_args() - - self.master = server.master.Master() - - self.action2func = { - "update" : self.handle_update, - } - - @property - def pakfire_args(self): - ret = { "mode" : "master" } - - return ret - - def parse_command_update(self): - # Implement the "update" command. - sub_update = self.sub_commands.add_parser("update", - help=_("Update the sources.")) - sub_update.add_argument("action", action="store_const", const="update") - - def handle_update(self): - self.master.update_sources() - - class CliServer(Cli): def __init__(self): self.parser = argparse.ArgumentParser( @@ -525,6 +440,7 @@ class CliServer(Cli): self.parse_command_build() self.parse_command_keepalive() self.parse_command_repoupdate() + self.parse_command_repo() # Finally parse all arguments from the command line and save them. self.args = self.parser.parse_args() @@ -535,6 +451,7 @@ class CliServer(Cli): "build" : self.handle_build, "keepalive" : self.handle_keepalive, "repoupdate" : self.handle_repoupdate, + "repo_create": self.handle_repo_create, } @property @@ -563,6 +480,21 @@ class CliServer(Cli): sub_repoupdate.add_argument("action", action="store_const", const="repoupdate") + def parse_command_repo(self): + sub_repo = self.sub_commands.add_parser("repo", + help=_("Repository management commands.")) + + sub_repo_commands = sub_repo.add_subparsers() + + self.parse_command_repo_create(sub_repo_commands) + + def parse_command_repo_create(self, sub_commands): + sub_create = sub_commands.add_parser("create", + help=_("Create a new repository index.")) + sub_create.add_argument("path", nargs=1, help=_("Path to the packages.")) + sub_create.add_argument("inputs", nargs="+", help=_("Path to input packages.")) + sub_create.add_argument("action", action="store_const", const="repo_create") + def handle_keepalive(self): self.server.update_info() @@ -571,3 +503,8 @@ class CliServer(Cli): def handle_repoupdate(self): self.server.update_repositories() + + def handle_repo_create(self): + path = self.args.path[0] + + pakfire.repo_create(path, self.args.inputs, **self.pakfire_args) diff --git a/po/POTFILES.in b/po/POTFILES.in index f4f160671..2bb1fe4f3 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -36,6 +36,7 @@ pakfire/satsolver.py pakfire/server.py pakfire/transaction.py pakfire/util.py +scripts/pakfire src/_pakfiremodule.c src/pool.c src/problem.c diff --git a/po/pakfire.pot b/po/pakfire.pot index 8e94911e0..bc0aa6744 100644 --- a/po/pakfire.pot +++ b/po/pakfire.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-08-05 19:13+0200\n" +"POT-Creation-Date: 2011-08-06 14:14+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -237,47 +237,35 @@ msgid "Give name(s) of a package(s)." msgstr "" #: ../pakfire/cli.py:432 -msgid "Pakfire repo command line interface." -msgstr "" - -#: ../pakfire/cli.py:457 -msgid "Repository management commands." -msgstr "" - -#: ../pakfire/cli.py:465 -msgid "Create a new repository index." +msgid "Pakfire server command line interface." msgstr "" #: ../pakfire/cli.py:466 -msgid "Path to the packages." +msgid "Request a build job from the server." msgstr "" -#: ../pakfire/cli.py:467 -msgid "Path to input packages." +#: ../pakfire/cli.py:472 +msgid "Send a keepalive to the server." msgstr "" #: ../pakfire/cli.py:479 -msgid "Pakfire master command line interface." -msgstr "" - -#: ../pakfire/cli.py:507 -msgid "Update the sources." +msgid "Update all repositories." msgstr "" -#: ../pakfire/cli.py:517 -msgid "Pakfire server command line interface." +#: ../pakfire/cli.py:485 +msgid "Repository management commands." msgstr "" -#: ../pakfire/cli.py:549 -msgid "Request a build job from the server." +#: ../pakfire/cli.py:493 +msgid "Create a new repository index." msgstr "" -#: ../pakfire/cli.py:555 -msgid "Send a keepalive to the server." +#: ../pakfire/cli.py:494 +msgid "Path to the packages." msgstr "" -#: ../pakfire/cli.py:562 -msgid "Update all repositories." +#: ../pakfire/cli.py:495 +msgid "Path to input packages." msgstr "" #: ../pakfire/errors.py:8 @@ -466,6 +454,32 @@ msgstr "" msgid "%s [y/N]" msgstr "" +#: ../scripts/pakfire:23 +msgid "" +"There has been an error when trying to import one or more of the modules, " +"that are required to run Pakfire." +msgstr "" + +#: ../scripts/pakfire:25 +msgid "Please your installation of Pakfire." +msgstr "" + +#: ../scripts/pakfire:27 +msgid "The error that lead to this:" +msgstr "" + +#: ../scripts/pakfire:64 +msgid "An error has occured when running Pakfire." +msgstr "" + +#: ../scripts/pakfire:67 +msgid "Error message:" +msgstr "" + +#: ../scripts/pakfire:71 +msgid "Further description:" +msgstr "" + #: ../src/problem.c:140 #, c-format msgid "%s does not belong to a distupgrade repository" diff --git a/scripts/pakfire b/scripts/pakfire index e9431b969..dd7fabc41 100755 --- a/scripts/pakfire +++ b/scripts/pakfire @@ -35,7 +35,6 @@ basename2cls = { "pakfire" : Cli, "pakfire-build" : CliBuilder, "pakfire-server" : CliServer, - "pakfire-repo" : CliRepo, } # Get the basename of the program diff --git a/scripts/pakfire-repo b/scripts/pakfire-repo deleted file mode 120000 index 83bb50a42..000000000 --- a/scripts/pakfire-repo +++ /dev/null @@ -1 +0,0 @@ -pakfire \ No newline at end of file diff --git a/setup.py b/setup.py index 6d28e1700..7e8028769 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,6 @@ setup( scripts = [ "scripts/pakfire", "scripts/pakfire-build", - "scripts/pakfire-repo", "scripts/pakfire-server", ], ext_modules = [ -- 2.39.5