# Create a new repository that holds all packages we passed on
# the commandline.
- repo = repository.RepositoryDir(self, repo_name, repo_desc, ".")
+ repo = repository.RepositoryDir(self, repo_name, repo_desc,
+ os.path.join(LOCAL_TMP_PATH, "repo_%s" % util.random_string()))
- # Add all packages to the repository index.
- for file in files:
- repo.collect_packages(file)
+ # Register the repository.
+ self.repos.add_repo(repo)
- # Break if no packages were added at all.
- if not len(repo):
- logging.critical("There are no packages to install.")
- return
+ try:
+ # Add all packages to the repository index.
+ for file in files:
+ repo.collect_packages(file)
- # Create a new request that installs all solvables from the
- # repository.
- request = self.create_request()
- for solv in [p.solvable for p in repo]:
- request.install(solv)
+ # Break if no packages were added at all.
+ if not len(repo):
+ logging.critical(_("There are no packages to install."))
+ return
- solver = self.create_solver()
- t = solver.solve(request)
+ # Create a new request that installs all solvables from the
+ # repository.
+ request = self.create_request()
+ for solv in [p.solvable for p in repo]:
+ request.install(solv)
- # If solving was not possible, we exit here.
- if not t:
- return
+ solver = self.create_solver()
+ t = solver.solve(request)
- # Ask the user if this is okay.
- if not t.cli_yesno():
- return
+ # If solving was not possible, we exit here.
+ if not t:
+ return
- # If okay, run the transcation.
- t.run()
+ # Ask the user if this is okay.
+ if not t.cli_yesno():
+ return
+
+ # If okay, run the transcation.
+ t.run()
+
+ finally:
+ # Remove the temporary copy of the repository we have created earlier.
+ repo.remove()
def update(self, pkgs):
request = self.create_request()
path = None
if self.repo.local:
- path = os.path.join(self.repo.path, self.arch, self.filename)
- return binary.BinaryPackage(self.pakfire, self.repo, path)
+ # Search for a file in the local repository. It can be either in
+ # the root directory of the repository or in a subdirectory that
+ # is named by the architecture.
+ for i in ("", self.arch,):
+ path = os.path.join(self.repo.path, i, self.filename)
+
+ if os.path.exists(path):
+ return binary.BinaryPackage(self.pakfire, self.repo, path)
else:
filename = "packages/%s" % self.filename
"""
return 10
+ @property
+ def local(self):
+ # Yes, this is local.
+ return True
+
def collect_packages(self, *args, **kwargs):
"""
Proxy function to add packages to the index.
from constants import *
from i18n import _
-PKG_DUMP_FORMAT = " %-21s %-8s %-21s %-19s %5s "
+PKG_DUMP_FORMAT = " %-21s %-8s %-21s %-18s %6s "
# Import all actions directly.
from actions import *
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-07-31 13:37+0200\n"
+"POT-Creation-Date: 2011-07-31 15:12+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "Downgrading"
msgstr ""
+#: ../pakfire/base.py:177
+msgid "There are no packages to install."
+msgstr ""
+
#: ../pakfire/builder.py:259
#, python-format
msgid "Extracting: %s (source)"
msgid "Loading installed packages"
msgstr ""
-#: ../pakfire/satsolver.py:110
+#: ../pakfire/satsolver.py:113
msgid "The solver returned one problem:"
msgstr ""
#. Ask the user if he or she want to modify the request. If not, just exit.
-#: ../pakfire/satsolver.py:126
+#: ../pakfire/satsolver.py:129
msgid "Do you want to manually alter the request?"
msgstr ""
-#: ../pakfire/satsolver.py:129
+#: ../pakfire/satsolver.py:132
msgid "You can now try to satisfy the solver by modifying your request."
msgstr ""
-#: ../pakfire/satsolver.py:134
+#: ../pakfire/satsolver.py:137
msgid "Which problem to you want to resolve?"
msgstr ""
-#: ../pakfire/satsolver.py:136
+#: ../pakfire/satsolver.py:139
msgid "Press enter to try to re-solve the request."
msgstr ""
-#: ../pakfire/satsolver.py:167
+#: ../pakfire/satsolver.py:170
#, python-format
msgid " Solution: %s"
msgstr ""
-#: ../pakfire/satsolver.py:176
+#: ../pakfire/satsolver.py:179
msgid " Solutions:"
msgstr ""