* fix: safety switch warning message for build deps was inaccurate

* calc_build_no: skip corrupt package files and warn, we are robust
* msg fixes / gettext
* remove cruft
* update po
This commit is contained in:
Eray Özkural
2005-11-22 17:32:10 +00:00
parent 011de9b6da
commit 9bea97c100
4 changed files with 152 additions and 118 deletions
+27 -29
View File
@@ -44,16 +44,6 @@ class Error(pisi.Error):
pass
class SourceFetcher(object):
def fetch(self, url, appendDest=""):
from fetcher import fetch_url
ctx.ui.info(_("Fetching %s") % url.get_uri())
dest = join(self.dest, appendDest)
fetch_url(self.url, dest)
# Helper Functions
def get_file_type(path, pinfoList):
"""Return the file type of a path according to the given PathInfo
@@ -289,7 +279,7 @@ class Builder:
%(ctx.config.archives_dir(), self.spec.source.archive.name))
def unpack_source_archive(self):
ctx.ui.info(_("Unpacking archive..."))
ctx.ui.info(_("Unpacking archive..."), noln = True)
self.sourceArchive.unpack()
ctx.ui.info(_(" unpacked (%s)") % self.pkg_work_dir())
self.set_state("unpack")
@@ -363,17 +353,21 @@ class Builder:
def check_build_dependencies(self):
"""fail if dependencies not satisfied"""
build_deps = set(self.spec.source.buildDependencies)
build_deps = self.spec.source.buildDependencies
if not ctx.get_option('bypass_safety'):
if ctx.componentdb.has_component('system.devel'):
build_deps_names = set([x.package for x in build_deps])
devel_deps_names = set(ctx.componentdb.get_component('system.devel').packages)
extra_names = devel_deps_names - build_deps_names
ctx.ui.warning(_('Safety switch: following extra packages in system.devel will be installed: ') +
util.strlist(extra_names))
extra_deps = [dependency.Dependency(package = x) for x in extra_names]
build_deps = build_deps.union(extra_deps)
extra_names = filter(lambda x: not ctx.installdb.is_installed(x), extra_names)
if extra_names:
ctx.ui.warning(_('Safety switch: following extra packages in system.devel will be installed: ') +
util.strlist(extra_names))
extra_deps = [dependency.Dependency(package = x) for x in extra_names]
build_deps.extend(extra_deps)
else:
ctx.ui.warning(_('Safety switch: system.devel is already installed'))
else:
ctx.ui.warning(_('Safety switch: the component system.devel cannot be found'))
@@ -507,19 +501,23 @@ class Builder:
# find previous build in output dir and packages dir
found = []
def locate_package_names(files):
for fn in files:
fn = fn.decode('utf-8')
if util.is_package_name(fn, package_name):
old_package_fn = util.join_path(root, fn)
ctx.ui.info('(found old version %s)' % old_package_fn)
old_pkg = Package(old_package_fn, 'r')
old_pkg.read(util.join_path(ctx.config.tmp_dir(), 'oldpkg'))
if str(old_pkg.metadata.package.name) != package_name:
ctx.ui.warning('Skipping %s with wrong pkg name ' %
old_package_fn)
continue
old_build = old_pkg.metadata.package.build
found.append( (old_package_fn, old_build) )
for fn in files:
fn = fn.decode('utf-8')
if util.is_package_name(fn, package_name):
old_package_fn = util.join_path(root, fn)
try:
old_pkg = Package(old_package_fn, 'r')
old_pkg.read(util.join_path(ctx.config.tmp_dir(), 'oldpkg'))
ctx.ui.info(_('(found old version %s)') % old_package_fn)
if str(old_pkg.metadata.package.name) != package_name:
ctx.ui.warning(_('Skipping %s with wrong pkg name ') %
old_package_fn)
continue
old_build = old_pkg.metadata.package.build
found.append( (old_package_fn, old_build) )
except:
ctx.ui.warning('Package file %s may be corrupt. Skipping.' % old_package_fn)
continue
for root, dirs, files in os.walk(ctx.config.options.output_dir):
dirs = [] # don't recurse
+1 -1
View File
@@ -346,7 +346,7 @@ fetch all necessary files and build the package for you.
return
self.init(database = True)
ctx.ui.info('Output directory: %s\n' % ctx.config.options.output_dir)
ctx.ui.info(_('Output directory: %s') % ctx.config.options.output_dir)
for arg in self.args:
pisi.api.build(arg, self.authInfo)
self.finalize()
+60 -44
View File
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2005-11-22 18:15+EET\n"
"POT-Creation-Date: 2005-11-22 19:33+EET\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"
@@ -399,164 +399,172 @@ msgstr ""
msgid "OK."
msgstr ""
#: pisi/build.py:52 pisi/file.py:53 pisi/file.py:69
msgid "Fetching %s"
msgstr ""
#: pisi/build.py:94
#: pisi/build.py:84
msgid "Path %s belongs in multiple packages"
msgstr ""
#: pisi/build.py:168
#: pisi/build.py:158
msgid "Building PISI source package: %s"
msgstr ""
#: pisi/build.py:208
#: pisi/build.py:198
msgid "IceCream detected. Make sure your daemon is up and running..."
msgstr ""
#: pisi/build.py:212
#: pisi/build.py:202
msgid "CCache detected..."
msgstr ""
#: pisi/build.py:267
#: pisi/build.py:257
msgid "PartOf tag not defined, looking for component"
msgstr ""
#: pisi/build.py:277
#: pisi/build.py:267
msgid "Cannot find component.xml in upper directory"
msgstr ""
#: pisi/build.py:281
#: pisi/build.py:271
msgid "Source is part of %s component"
msgstr ""
#: pisi/build.py:286
#: pisi/build.py:276
msgid "Fetching source from: %s"
msgstr ""
#: pisi/build.py:288
#: pisi/build.py:278
msgid "Source archive is stored: %s/%s"
msgstr ""
#: pisi/build.py:292
#: pisi/build.py:282
msgid "Unpacking archive..."
msgstr ""
#: pisi/build.py:294
#: pisi/build.py:284
msgid " unpacked (%s)"
msgstr ""
#: pisi/build.py:299
#: pisi/build.py:289
msgid "Setting up source..."
msgstr ""
#: pisi/build.py:304
#: pisi/build.py:294
msgid "Building source..."
msgstr ""
#: pisi/build.py:309
#: pisi/build.py:299
msgid "Installing..."
msgstr ""
#: pisi/build.py:327
#: pisi/build.py:317
msgid "Unable to read Action Script (%s): %s"
msgstr ""
#: pisi/build.py:329
#: pisi/build.py:319
msgid "SyntaxError in Action Script (%s): %s"
msgstr ""
#: pisi/build.py:359
#: pisi/build.py:349
msgid "unable to call function from actions: %s"
msgstr ""
#: pisi/build.py:373
#: pisi/build.py:365
msgid "Safety switch: following extra packages in system.devel will be installed: "
msgstr ""
#: pisi/build.py:378
#: pisi/build.py:370
msgid "Safety switch: system.devel is already installed"
msgstr ""
#: pisi/build.py:372
msgid "Safety switch: the component system.devel cannot be found"
msgstr ""
#: pisi/build.py:387
#: pisi/build.py:381
msgid "Unsatisfied Build Dependencies:"
msgstr ""
#: pisi/build.py:392
#: pisi/build.py:386
msgid "Do you want to install the unsatisfied build dependencies"
msgstr ""
#: pisi/build.py:393
#: pisi/build.py:387
msgid "Installing build dependencies."
msgstr ""
#: pisi/build.py:396
#: pisi/build.py:390
msgid "Cannot build package due to unsatisfied build dependencies"
msgstr ""
#: pisi/build.py:398
#: pisi/build.py:392
msgid "Ignoring build dependencies."
msgstr ""
#: pisi/build.py:408
#: pisi/build.py:402
msgid ""
"Patch file is missing: %s\n"
msgstr ""
#: pisi/build.py:421
#: pisi/build.py:415
msgid "* Applying patch: %s"
msgstr ""
#: pisi/build.py:426
#: pisi/build.py:420
msgid "Stripping files.."
msgstr ""
#: pisi/build.py:456
#: pisi/build.py:450
msgid "build number is not available."
msgstr ""
#: pisi/build.py:532
#: pisi/build.py:511
msgid "(found old version %s)"
msgstr ""
#: pisi/build.py:513
msgid "Skipping %s with wrong pkg name "
msgstr ""
#: pisi/build.py:530
msgid "(no previous build found, setting build no to 1.)"
msgstr ""
#: pisi/build.py:572
#: pisi/build.py:570
msgid "(old package lacks a build no, setting build no to 1.)"
msgstr ""
#: pisi/build.py:575
#: pisi/build.py:573
msgid "There are changes, incrementing build no to %d"
msgstr ""
#: pisi/build.py:578
#: pisi/build.py:576
msgid "There is no change from previous build %d"
msgstr ""
#: pisi/build.py:608
#: pisi/build.py:606
msgid "Copying additional file: '%s' to '%s' as '%s'"
msgstr ""
#: pisi/build.py:619
#: pisi/build.py:617
msgid "** Building package %s"
msgstr ""
#: pisi/build.py:621 pisi/build.py:624
#: pisi/build.py:619 pisi/build.py:622
msgid "Generating %s,"
msgstr ""
#: pisi/build.py:627
#: pisi/build.py:625
msgid "Creating PISI package %s."
msgstr ""
#: pisi/build.py:659
#: pisi/build.py:657
msgid "Done."
msgstr ""
#: pisi/build.py:662
#: pisi/build.py:660
msgid "Cleaning Build Directory..."
msgstr ""
#: pisi/build.py:665
#: pisi/build.py:663
msgid "Keeping Build Directory"
msgstr ""
@@ -748,6 +756,10 @@ msgstr ""
msgid "bypass errors from ActionsAPI"
msgstr ""
#: pisi/cli/commands.py:349
msgid "Output directory: %s"
msgstr ""
#: pisi/cli/commands.py:356
#, docstring
msgid "Abstract package operation command"
@@ -1222,6 +1234,10 @@ msgstr ""
msgid "uri must have type either URI or string"
msgstr ""
#: pisi/file.py:53 pisi/file.py:69
msgid "Fetching %s"
msgstr ""
#: pisi/file.py:66
msgid "File mode must be either File.read or File.write"
msgstr ""
+64 -44
View File
@@ -8,7 +8,7 @@
msgid ""
msgstr ""
"Project-Id-Version: tr\n"
"POT-Creation-Date: 2005-11-22 18:15+EET\n"
"POT-Creation-Date: 2005-11-22 19:33+EET\n"
"PO-Revision-Date: 2005-11-22 15:53+0200\n"
"Last-Translator: Eray Özkural <eray@uludag.org.tr>\n"
"Language-Team: Türkçe <tr@li.org>\n"
@@ -421,168 +421,179 @@ msgstr "Geçersiz %s"
msgid "OK."
msgstr "Tamam."
#: pisi/build.py:52 pisi/file.py:53 pisi/file.py:69
msgid "Fetching %s"
msgstr "%s'i indiriyor"
#: pisi/build.py:94
#: pisi/build.py:84
msgid "Path %s belongs in multiple packages"
msgstr "Yol %s birden çok pakete ait"
#: pisi/build.py:168
#: pisi/build.py:158
msgid "Building PISI source package: %s"
msgstr "PİSİ kaynak paketi %s inşa ediliyor"
#: pisi/build.py:208
#: pisi/build.py:198
msgid "IceCream detected. Make sure your daemon is up and running..."
msgstr ""
"IceCream bulundu. Lütfen artalan sürecinizin çalıştığından emin olunuz."
#: pisi/build.py:212
#: pisi/build.py:202
msgid "CCache detected..."
msgstr "CCache bulundu..."
#: pisi/build.py:267
#: pisi/build.py:257
msgid "PartOf tag not defined, looking for component"
msgstr "PartOf imi tanımlanmamış, bileşen araştırılyor"
#: pisi/build.py:277
#: pisi/build.py:267
msgid "Cannot find component.xml in upper directory"
msgstr "'component.xml' üst dizinde bulunamıyor"
#: pisi/build.py:281
#: pisi/build.py:271
msgid "Source is part of %s component"
msgstr "Kaynak %s bileşeninin parçası"
#: pisi/build.py:286
#: pisi/build.py:276
msgid "Fetching source from: %s"
msgstr "Kaynak indiriliyor: %s"
#: pisi/build.py:288
#: pisi/build.py:278
msgid "Source archive is stored: %s/%s"
msgstr "Kaynak arşivi saklandı: %s/%s"
#: pisi/build.py:292
#: pisi/build.py:282
msgid "Unpacking archive..."
msgstr "Arşiv açılıyor..."
#: pisi/build.py:294
#: pisi/build.py:284
msgid " unpacked (%s)"
msgstr " açıldı (%s)"
#: pisi/build.py:299
#: pisi/build.py:289
msgid "Setting up source..."
msgstr "Kaynak kuruluyor"
#: pisi/build.py:304
#: pisi/build.py:294
msgid "Building source..."
msgstr "Kaynak inşa ediliyor..."
#: pisi/build.py:309
#: pisi/build.py:299
msgid "Installing..."
msgstr "Yerleştiriliyor..."
#: pisi/build.py:327
#: pisi/build.py:317
msgid "Unable to read Action Script (%s): %s"
msgstr "Action betiği okunamıyor (%s): %s"
#: pisi/build.py:329
#: pisi/build.py:319
msgid "SyntaxError in Action Script (%s): %s"
msgstr "Action betiğinde sözdizimi hatası (%s): %s"
#: pisi/build.py:359
#: pisi/build.py:349
msgid "unable to call function from actions: %s"
msgstr "fonksiyon eylemlerden çağırılamıyor: %s"
#: pisi/build.py:373
#: pisi/build.py:365
msgid ""
"Safety switch: following extra packages in system.devel will be installed: "
msgstr ""
"Emniyet mandalı: taban geliştirme sistemi system.devel'den izleyen paketler "
"ek olarak yüklenecek:"
#: pisi/build.py:378
#: pisi/build.py:370
#, fuzzy
msgid "Safety switch: system.devel is already installed"
msgstr ""
"Emniyet mandalı: taban geliştirme sistemi system.devel'den izleyen paketler "
"ek olarak yüklenecek:"
#: pisi/build.py:372
msgid "Safety switch: the component system.devel cannot be found"
msgstr "Emniyet mandalı: geliştirme sistemi bileşeni system.devel bulunamadı"
#: pisi/build.py:387
#: pisi/build.py:381
msgid "Unsatisfied Build Dependencies:"
msgstr "Sağlanmamış inşa bağımlılıkları"
#: pisi/build.py:392
#: pisi/build.py:386
msgid "Do you want to install the unsatisfied build dependencies"
msgstr "Sağlanmamış inşa bağımlılıklarını kurmak istiyor musunuz? "
#: pisi/build.py:393
#: pisi/build.py:387
msgid "Installing build dependencies."
msgstr "İnşa bağımlılıklarını kuruyor. "
#: pisi/build.py:396
#: pisi/build.py:390
msgid "Cannot build package due to unsatisfied build dependencies"
msgstr "Sağlanmamış inşa bağımlılıkları yüzünden paket inşa edilemiyor"
#: pisi/build.py:398
#: pisi/build.py:392
msgid "Ignoring build dependencies."
msgstr "İnşa bağımlılıkları yoksayılıyor."
#: pisi/build.py:408
#: pisi/build.py:402
msgid "Patch file is missing: %s\n"
msgstr "Yama dosyası eksik: %s\n"
#: pisi/build.py:421
#: pisi/build.py:415
msgid "* Applying patch: %s"
msgstr "* Yama uygulanıyor: %s"
#: pisi/build.py:426
#: pisi/build.py:420
msgid "Stripping files.."
msgstr "Semboller temizleniyor..."
#: pisi/build.py:456
#: pisi/build.py:450
msgid "build number is not available."
msgstr "inşa sayısı (build number) bulunamadı"
#: pisi/build.py:532
#: pisi/build.py:511
msgid "(found old version %s)"
msgstr ""
#: pisi/build.py:513
msgid "Skipping %s with wrong pkg name "
msgstr ""
#: pisi/build.py:530
msgid "(no previous build found, setting build no to 1.)"
msgstr "(önceki bir inşa bulunamadı, inşa numarası 1 yapılıyor)"
#: pisi/build.py:572
#: pisi/build.py:570
msgid "(old package lacks a build no, setting build no to 1.)"
msgstr "(önceki paketin bir inşa numarası yok, inşa numarası 1 yapılıyor)"
#: pisi/build.py:575
#: pisi/build.py:573
msgid "There are changes, incrementing build no to %d"
msgstr "Değişiklikler var, inşa nosu bir arttırılarak %d yapıldı."
#: pisi/build.py:578
#: pisi/build.py:576
msgid "There is no change from previous build %d"
msgstr "Bir önceki %d nolu inşadan beri bir değişiklik yok."
#: pisi/build.py:608
#: pisi/build.py:606
msgid "Copying additional file: '%s' to '%s' as '%s'"
msgstr "Ek dosya kopyalanıyor: '%s' den '%s' e '%s' olarak"
#: pisi/build.py:619
#: pisi/build.py:617
msgid "** Building package %s"
msgstr "* Paket %s inşa ediliyor"
# pisi/build.py:503 :506
#: pisi/build.py:621 pisi/build.py:624
#: pisi/build.py:619 pisi/build.py:622
msgid "Generating %s,"
msgstr "%s yaratılıyor,"
#: pisi/build.py:627
#: pisi/build.py:625
msgid "Creating PISI package %s."
msgstr "PİSİ paketi %s yaratılıyor."
#: pisi/build.py:659
#: pisi/build.py:657
msgid "Done."
msgstr "Bitti."
#: pisi/build.py:662
#: pisi/build.py:660
msgid "Cleaning Build Directory..."
msgstr "İnşa dizini siliniyor..."
#: pisi/build.py:665
#: pisi/build.py:663
msgid "Keeping Build Directory"
msgstr "İnşa dizini bırakılıyor "
@@ -776,6 +787,11 @@ msgstr "üretilecek paketler için çıktı dizini"
msgid "bypass errors from ActionsAPI"
msgstr "ActionsAPI kaynaklı hataları es geç"
#: pisi/cli/commands.py:349
#, fuzzy
msgid "Output directory: %s"
msgstr "%s dizini yaratılamıyor."
#: pisi/cli/commands.py:356
msgid "Abstract package operation command"
msgstr ""
@@ -1361,6 +1377,10 @@ msgstr "ftp hatası"
msgid "uri must have type either URI or string"
msgstr "uri argümanı ya URI ya da string tipine sahip olmalı"
#: pisi/file.py:53 pisi/file.py:69
msgid "Fetching %s"
msgstr "%s'i indiriyor"
#: pisi/file.py:66
msgid "File mode must be either File.read or File.write"
msgstr "File modu ya File.read ya da File.write olmalı"