]> git.saurik.com Git - apt.git/commitdiff
Merge remote-tracking branch 'upstream/debian/sid' into feature/upgrade-with-new
authorMichael Vogt <mvo@debian.org>
Wed, 28 Aug 2013 10:46:49 +0000 (12:46 +0200)
committerMichael Vogt <mvo@debian.org>
Wed, 28 Aug 2013 10:46:49 +0000 (12:46 +0200)
15 files changed:
apt-pkg/contrib/fileutl.cc
apt-private/private-cmndline.cc
apt-private/private-install.cc
apt-private/private-install.h
apt-private/private-upgrade.cc
cmdline/apt-get.cc
debian/changelog
dselect/install
po/it.po
po/vi.po
test/integration/framework
test/integration/test-apt-cdrom
test/integration/test-hashsum-verification
test/integration/test-pdiff-usage
test/integration/test-releasefile-verification

index 47a91c294a28a9e413bf5d7533af83a36dae81f9..4806ae3f9bc29248dff48b3a000f37bd6a843435 100644 (file)
@@ -946,9 +946,6 @@ bool FileFd::Open(string FileName,unsigned int const Mode,APT::Configuration::Co
    if ((Mode & Atomic) == Atomic)
    {
       Flags |= Replace;
-      char *name = strdup((FileName + ".XXXXXX").c_str());
-      TemporaryFileName = string(mktemp(name));
-      free(name);
    }
    else if ((Mode & (Exclusive | Create)) == (Exclusive | Create))
    {
@@ -971,11 +968,24 @@ bool FileFd::Open(string FileName,unsigned int const Mode,APT::Configuration::Co
    if_FLAGGED_SET(Create, O_CREAT);
    if_FLAGGED_SET(Empty, O_TRUNC);
    if_FLAGGED_SET(Exclusive, O_EXCL);
-   else if_FLAGGED_SET(Atomic, O_EXCL);
    #undef if_FLAGGED_SET
 
-   if (TemporaryFileName.empty() == false)
-      iFd = open(TemporaryFileName.c_str(), fileflags, Perms);
+   if ((Mode & Atomic) == Atomic)
+   {
+      char *name = strdup((FileName + ".XXXXXX").c_str());
+
+      if((iFd = mkstemp(name)) == -1)
+      {
+          free(name);
+          return FileFdErrno("mkostemp", "Could not create temporary file for %s", FileName.c_str());
+      }
+
+      TemporaryFileName = string(name);
+      free(name);
+
+      if(Perms != 600 && fchmod(iFd, Perms) == -1)
+          return FileFdErrno("fchmod", "Could not change permissions for temporary file %s", TemporaryFileName.c_str());
+   }
    else
       iFd = open(FileName.c_str(), fileflags, Perms);
 
index b30eeffb74710bf37ccb561e786b192bf3e29b33..121d72ede4a17d536bcd89e912f8d66d097c990a 100644 (file)
@@ -114,7 +114,7 @@ bool addArgumentsAPTConfig(std::vector<CommandLine::Args> &Args, char const * co
 bool addArgumentsAPTGet(std::vector<CommandLine::Args> &Args, char const * const Cmd)/*{{{*/
 {
    if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade",
-           "deselect-upgrade", "autoremove"))
+           "dselect-upgrade", "autoremove"))
    {
       addArg(0, "dpkg-progress", "DpkgPM::Progress", 0);
       addArg('f', "fix-broken", "APT::Get::Fix-Broken", 0);
index d5052fcc0aeab7a43420b3cc0309fe4599d09d95..b03f131a441b089aad1182f23b51403952548d48 100644 (file)
@@ -577,31 +577,28 @@ bool DoAutomaticRemove(CacheFile &Cache)
 }
                                                                        /*}}}*/
 
+static const unsigned short MOD_REMOVE = 1;
+static const unsigned short MOD_INSTALL = 2;
 
+bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache)
+{
+   std::map<unsigned short, APT::VersionSet> verset;
+   return DoCacheManipulationFromCommandLine(CmdL, Cache, verset);
+}
 
-
-// DoInstall - Install packages from the command line                  /*{{{*/
-// ---------------------------------------------------------------------
-/* Install named packages */
-bool DoInstall(CommandLine &CmdL)
+bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache,
+                                        std::map<unsigned short, APT::VersionSet> &verset)
 {
-   CacheFile Cache;
-   if (Cache.OpenForInstall() == false || 
-       Cache.CheckDeps(CmdL.FileSize() != 1) == false)
-      return false;
-   
+
    // Enter the special broken fixing mode if the user specified arguments
    bool BrokenFix = false;
    if (Cache->BrokenCount() != 0)
       BrokenFix = true;
 
-   pkgProblemResolver* Fix = NULL;
+   SPtr<pkgProblemResolver> Fix;
    if (_config->FindB("APT::Get::CallResolver", true) == true)
       Fix = new pkgProblemResolver(Cache);
 
-   static const unsigned short MOD_REMOVE = 1;
-   static const unsigned short MOD_INSTALL = 2;
-
    unsigned short fallback = MOD_INSTALL;
    if (strcasecmp(CmdL.FileList[0],"remove") == 0)
       fallback = MOD_REMOVE;
@@ -622,14 +619,12 @@ bool DoInstall(CommandLine &CmdL)
    mods.push_back(APT::VersionSet::Modifier(MOD_REMOVE, "-",
                APT::VersionSet::Modifier::POSTFIX, APT::VersionSet::NEWEST));
    CacheSetHelperAPTGet helper(c0out);
-   std::map<unsigned short, APT::VersionSet> verset = APT::VersionSet::GroupedFromCommandLine(Cache,
+   verset = APT::VersionSet::GroupedFromCommandLine(Cache,
                CmdL.FileList + 1, mods, fallback, helper);
 
    if (_error->PendingError() == true)
    {
       helper.showVirtualPackageErrors(Cache);
-      if (Fix != NULL)
-        delete Fix;
       return false;
    }
 
@@ -663,8 +658,6 @@ bool DoInstall(CommandLine &CmdL)
 
       if (_error->PendingError() == true)
       {
-        if (Fix != NULL)
-           delete Fix;
         return false;
       }
 
@@ -675,8 +668,6 @@ bool DoInstall(CommandLine &CmdL)
       {
         c1out << _("You might want to run 'apt-get -f install' to correct these:") << std::endl;
         ShowBroken(c1out,Cache,false);
-        if (Fix != NULL)
-           delete Fix;
         return _error->Error(_("Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)."));
       }
 
@@ -684,7 +675,6 @@ bool DoInstall(CommandLine &CmdL)
       {
         // Call the scored problem resolver
         Fix->Resolve(true);
-        delete Fix;
       }
 
       // Now we check the state of the packages,
@@ -718,6 +708,34 @@ bool DoInstall(CommandLine &CmdL)
    if (!DoAutomaticRemove(Cache)) 
       return false;
 
+   // if nothing changed in the cache, but only the automark information
+   // we write the StateFile here, otherwise it will be written in 
+   // cache.commit()
+   if (InstallAction.AutoMarkChanged > 0 &&
+       Cache->DelCount() == 0 && Cache->InstCount() == 0 &&
+       Cache->BadCount() == 0 &&
+       _config->FindB("APT::Get::Simulate",false) == false)
+      Cache->writeStateFile(NULL);
+
+   return true;
+}
+
+
+// DoInstall - Install packages from the command line                  /*{{{*/
+// ---------------------------------------------------------------------
+/* Install named packages */
+bool DoInstall(CommandLine &CmdL)
+{
+   CacheFile Cache;
+   if (Cache.OpenForInstall() == false || 
+       Cache.CheckDeps(CmdL.FileSize() != 1) == false)
+      return false;
+
+   std::map<unsigned short, APT::VersionSet> verset;
+
+   if(!DoCacheManipulationFromCommandLine(CmdL, Cache, verset))
+      return false;
+
    /* Print out a list of packages that are going to be installed extra
       to what the user asked */
    if (Cache->InstCount() != verset[MOD_INSTALL].size())
@@ -833,15 +851,6 @@ bool DoInstall(CommandLine &CmdL)
 
    }
 
-   // if nothing changed in the cache, but only the automark information
-   // we write the StateFile here, otherwise it will be written in 
-   // cache.commit()
-   if (InstallAction.AutoMarkChanged > 0 &&
-       Cache->DelCount() == 0 && Cache->InstCount() == 0 &&
-       Cache->BadCount() == 0 &&
-       _config->FindB("APT::Get::Simulate",false) == false)
-      Cache->writeStateFile(NULL);
-
    // See if we need to prompt
    // FIXME: check if really the packages in the set are going to be installed
    if (Cache->InstCount() == verset[MOD_INSTALL].size() && Cache->DelCount() == 0)
index fcf4cbcedc1d44c949ebbe99465ec8df1384a667..439c89712b54306d307e2689d8a5ee706fd887f8 100644 (file)
@@ -14,6 +14,9 @@
 
 bool DoInstall(CommandLine &Cmd);
 
+bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache,
+                                        std::map<unsigned short, APT::VersionSet> &verset);
+bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache);
 
 bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
                         bool Safety = true);
index eb546e3e3dd6d45268081a2c519e5c1d96e100d0..09085c2dba5074289a6e9b8a07053f4889d532b3 100644 (file)
@@ -13,9 +13,6 @@
    packages */
 bool DoUpgradeNoNewPackages(CommandLine &CmdL)
 {
-   if (CmdL.FileSize() != 1)
-      return _error->Error(_("The upgrade command takes no arguments"));
-
    CacheFile Cache;
    if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
       return false;
@@ -26,6 +23,10 @@ bool DoUpgradeNoNewPackages(CommandLine &CmdL)
       ShowBroken(c1out,Cache,false);
       return _error->Error(_("Internal error, AllUpgrade broke stuff"));
    }
+
+   // parse additional cmdline pkg manipulation switches
+   if(!DoCacheManipulationFromCommandLine(CmdL, Cache))
+      return false;
    
    return InstallPackages(Cache,true);
 }
@@ -34,9 +35,6 @@ bool DoUpgradeNoNewPackages(CommandLine &CmdL)
 // DoSafeUpgrade - Upgrade all packages with install but not remove    /*{{{*/
 bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL)
 {
-   if (CmdL.FileSize() != 1)
-      return _error->Error(_("The upgrade command takes no arguments"));
-
    CacheFile Cache;
    if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
       return false;
@@ -47,6 +45,10 @@ bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL)
       ShowBroken(c1out,Cache,false);
       return _error->Error(_("Internal error, AllUpgrade broke stuff"));
    }
+
+   // parse additional cmdline pkg manipulation switches
+   if(!DoCacheManipulationFromCommandLine(CmdL, Cache))
+      return false;
    
    return InstallPackages(Cache,true);
 }
index 392eafe4fff01290433a161831394e6917b315ce..3a41b8c1fb9c81dd554abf9974d6a14d106a8478 100644 (file)
@@ -350,9 +350,6 @@ bool DoMarkAuto(CommandLine &CmdL)
 /* Intelligent upgrader that will install and remove packages at will */
 bool DoDistUpgrade(CommandLine &CmdL)
 {
-   if (CmdL.FileSize() != 1)
-      return _error->Error(_("The dist-upgrade command takes no arguments"));
-
    CacheFile Cache;
    if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
       return false;
@@ -365,6 +362,10 @@ bool DoDistUpgrade(CommandLine &CmdL)
       return false;
    }
    
+   // parse additional cmdline pkg manipulation switches
+   if(!DoCacheManipulationFromCommandLine(CmdL, Cache))
+      return false;
+
    c0out << _("Done") << endl;
    
    return InstallPackages(Cache,true);
index 5d37588507aa405d89a18469ef8778c118b8b3ea..3ae0d3182aa07c60dba7cbac5dcdab2f6f37cbb6 100644 (file)
@@ -1,18 +1,43 @@
-apt (0.9.11~exp3) UNRELEASEDexperimental; urgency=low
+apt (0.9.11.2) UNRELEASED; urgency=low
 
-  * fix incorrect bugnumber for the Pre-Install-Pkgs hook
+  [ Milo Casagrande ]
+  * Update Italian translation. Closes: #721030
+  
+  [ Trần Ngọc Quân ]
+  * Update Vietnamese translation. Closes: #720752
+  
+  [ Michael Vogt ]
+  * dselect/install:
+   - remove "-f" option for apt-get clean/auto-clean (closes: #720532)
+  * apt-private/private-cmndline.cc:
+    - fix typo in CmdMatches() selection for dselect-upgrade (closes: #720532)
+
+ -- Christian Perrier <bubulle@debian.org>  Sun, 25 Aug 2013 15:39:40 +0200
 
- -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 19 Aug 2013 15:53:47 +0200
+apt (0.9.11.1) unstable; urgency=low
 
-apt (0.9.11~exp2) experimental; urgency=low
+  [ Michael Vogt ]
+  * more coverity fixes:
+    - explicit init 
+    - always chdir("/") after chroot()
+    - ftparchive/override.cc: fix "skip empty lines" code, the pointer 
+      needs to get de-referenced first
+  * dselect/update: 
+    - remove "-f" option for apt-get update to fix breakage (closes: 720532)
+
+  [ Christopher Baines ]
+  * Add test for bug #507998
+
+  [ David Kalnischkies ]
+  * add a breaks libapt-inst for FileFd changes in 0.9.9 (Closes: 720449)
+  * add versions to manpages-it Replaces+Breaks
 
-  * add lintian override for no-shlibs-control-file so that
-    the internal libapt-private.so.0.0.0 can be shipped
-  * adjust apt.install.in to only install libapt-private.so.*
+  [ Ángel Guzmán Maeso ]
+  * apt-pkg:contrib Avoid compiler warning about sign-compare
 
- -- Michael Vogt <mvo@debian.org>  Mon, 19 Aug 2013 14:54:58 +0200
+ -- Michael Vogt <mvo@debian.org>  Sat, 24 Aug 2013 09:13:27 +0200
 
-apt (0.9.11~exp1) experimental; urgency=low
+apt (0.9.11) unstable; urgency=low
 
   [ Daniel Hartwig ]
   * Clarify units of Acquire::http::Dl-Limit (closes: #705445)
@@ -31,6 +56,9 @@ apt (0.9.11~exp1) experimental; urgency=low
     - install libapt-private* into the apt binary
     - add PACKAGE_MATCHER_ABI_COMPAT define so that this branch can be 
       merged without breaking ABI
+    - add lintian override for no-shlibs-control-file so that
+      the internal libapt-private.so.0.0.0 can be shipped
+    - adjust apt.install.in to only install libapt-private.so.*
 
   [ David Kalnischkies ]
   * ensure that pkgTagFile isn't writing past Buffer length (Closes: 719629)
@@ -40,7 +68,7 @@ apt (0.9.11~exp1) experimental; urgency=low
   [ Christian PERRIER ]
   * French translation update.
 
- -- Michael Vogt <mvo@debian.org>  Mon, 19 Aug 2013 13:25:45 +0200
+ -- Michael Vogt <mvo@debian.org>  Wed, 21 Aug 2013 17:51:09 +0200
 
 apt (0.9.10) unstable; urgency=low
 
index 3ef213550d3ed28653d6e1d20c77e279047c855a..7104ee280cd74399ded16413023f840fe583492d 100755 (executable)
@@ -5,7 +5,8 @@ TEXTDOMAIN="apt"
 
 # Get the configuration from /etc/apt/apt.conf
 CLEAN="prompt"
-OPTS="-f"
+OPTS=""
+DSELECT_UPGRADE_OPTS="-f"
 APTGET="/usr/bin/apt-get"
 DPKG="/usr/bin/dpkg"
 DPKG_OPTS="--admindir=$1"
@@ -47,12 +48,12 @@ yesno() {
 }
 
 if [ "$WAIT" = "true" ]; then
-   $APTGET $OPTS "$APT_OPT0" "$APT_OPT1" -d dselect-upgrade
+   $APTGET $DSELECT_UPGRADE_OPTS $OPTS "$APT_OPT0" "$APT_OPT1" -d dselect-upgrade
    echo $"Press enter to continue." && read RES
-   $APTGET $OPTS "$APT_OPT0" "$APT_OPT1" dselect-upgrade
+   $APTGET $DSELECT_UPGRADE_OPTS $OPTS "$APT_OPT0" "$APT_OPT1" dselect-upgrade
    RES=$?
 else
-   $APTGET $OPTS "$APT_OPT0" "$APT_OPT1" dselect-upgrade
+   $APTGET $DSELECT_UPGRADE_OPTS $OPTS "$APT_OPT0" "$APT_OPT1" dselect-upgrade
    RES=$?
 fi
 
index 1b9d6db3254c0789681d7170e73873d2a9bc89fe..abd5d6df275fd0e2caa483127a8f51b4c5a929cc 100644 (file)
--- a/po/it.po
+++ b/po/it.po
@@ -1,15 +1,15 @@
 # Italian translation of apt
-# Copyright (C) 2002-2010, 2011, 2012 The Free Software Foundation, Inc.
+# Copyright (C) 2002-2010, 2011, 2012, 2013 The Free Software Foundation, Inc.
 # This file is distributed under the same license as the apt package.
 # Samuele Giovanni Tonon <samu@debian.org>, 2002.
-# Milo Casagrande <milo@ubuntu.com>, 2009, 2010, 2011, 2012.
+# Milo Casagrande <milo@ubuntu.com>, 2009, 2010, 2011, 2012, 2013.
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: apt\n"
 "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n"
 "POT-Creation-Date: 2013-07-31 16:24+0200\n"
-"PO-Revision-Date: 2012-06-25 21:54+0200\n"
+"PO-Revision-Date: 2013-08-27 22:06+0200\n"
 "Last-Translator: Milo Casagrande <milo@ubuntu.com>\n"
 "Language-Team: Italian <tp@lists.linux.it>\n"
 "Language: it\n"
@@ -18,7 +18,7 @@ msgstr ""
 "Content-Transfer-Encoding: 8-bit\n"
 "Plural-Forms: nplurals=2; plural=(n!=1);\n"
 "X-Launchpad-Export-Date: 2012-06-25 19:48+0000\n"
-"X-Generator: Launchpad (build 15482)\n"
+"X-Generator: Gtranslator 2.91.6\n"
 
 #: cmdline/apt-cache.cc:158
 #, c-format
@@ -245,6 +245,12 @@ msgid ""
 "You may try the --cdrom option to set the CD-ROM mount point. See 'man apt-"
 "cdrom' for more information about the CD-ROM auto-detection and mount point."
 msgstr ""
+"Impossibile rilevare automaticamente un CD-ROM oppure è stato trovato con "
+"il\n"
+"punto di mount predefinito.\n"
+"È possibile provare l'opzione --cdrom per impostare il punto di mount del\n"
+"CD-ROM. Per maggiori informazioni sull'autorilevamento e sul punto di mount\n"
+"del CD-ROM, consultare \"man apt-cdrom\"."
 
 #: cmdline/apt-cdrom.cc:85
 msgid "Please provide a name for this Disc, such as 'Debian 5.0.3 Disk 1'"
@@ -1547,10 +1553,9 @@ msgid "Temporary failure resolving '%s'"
 msgstr "Risoluzione di \"%s\" temporaneamente non riuscita"
 
 #: methods/connect.cc:209
-#, fuzzy, c-format
+#, c-format
 msgid "System error resolving '%s:%s'"
-msgstr ""
-"Si è verificato qualcosa di anormale nella risoluzione di \"%s:%s\" (%i - %s)"
+msgstr "Errore di sistema nella risoluzione di \"%s:%s\""
 
 #: methods/connect.cc:211
 #, c-format
@@ -1587,6 +1592,8 @@ msgid ""
 "Clearsigned file isn't valid, got '%s' (does the network require "
 "authentication?)"
 msgstr ""
+"Il file con la firma in chiaro non è valido, ottenuto \"%s\" (la rete "
+"richiede autenticazione?)"
 
 #: methods/gpgv.cc:183
 msgid "Unknown error executing gpgv"
@@ -1710,9 +1717,9 @@ msgid "Can not read mirror file '%s'"
 msgstr "Impossibile leggere il file mirror \"%s\""
 
 #: methods/mirror.cc:315
-#, fuzzy, c-format
+#, c-format
 msgid "No entry found in mirror file '%s'"
-msgstr "Impossibile leggere il file mirror \"%s\""
+msgstr "Nessuna voce trovata nel file mirror \"%s\""
 
 #: methods/mirror.cc:445
 #, c-format
@@ -2508,13 +2515,13 @@ msgstr "%c%s... Fatto"
 
 #: apt-pkg/contrib/progress.cc:179
 msgid "..."
-msgstr ""
+msgstr "..."
 
 #. Print the spinner
 #: apt-pkg/contrib/progress.cc:195
-#, fuzzy, c-format
+#, c-format
 msgid "%c%s... %u%%"
-msgstr "%c%s... Fatto"
+msgstr "%c%s... %u%%"
 
 #: apt-pkg/contrib/cmndline.cc:80
 #, c-format
@@ -3610,147 +3617,3 @@ msgstr ""
 #: apt-pkg/deb/debsystem.cc:121
 msgid "Not locked"
 msgstr "Non bloccato"
-
-#~ msgid "File %s doesn't start with a clearsigned message"
-#~ msgstr "Il file %s non inizia con un messaggio di firma in chiaro"
-
-#~ msgid "Skipping nonexistent file %s"
-#~ msgstr "Saltato il file inesistente %s"
-
-#~ msgid "Failed to remove %s"
-#~ msgstr "Rimozione di %s non riuscita"
-
-#~ msgid "Unable to create %s"
-#~ msgstr "Impossibile creare %s"
-
-#~ msgid "Failed to stat %sinfo"
-#~ msgstr "Esecuzione di stat su %sinfo non riuscita"
-
-#~ msgid "The info and temp directories need to be on the same filesystem"
-#~ msgstr "Le directory temp e info devono essere sullo stesso file system"
-
-#~ msgid "Failed to change to the admin dir %sinfo"
-#~ msgstr "Cambio della directory admin %sinfo non riuscito"
-
-#~ msgid "Internal error getting a package name"
-#~ msgstr "Errore interno nel recuperare un nome di un pacchetto"
-
-#~ msgid "Reading file listing"
-#~ msgstr "Lettura elenco dei file"
-
-#~ msgid ""
-#~ "Failed to open the list file '%sinfo/%s'. If you cannot restore this file "
-#~ "then make it empty and immediately re-install the same version of the "
-#~ "package!"
-#~ msgstr ""
-#~ "Impossibile aprire il file dell'elenco \"%sinfo/%s\". Se non è possibile "
-#~ "ripristinarlo, crearne uno vuoto e reinstallare immediatamente la stessa "
-#~ "versione del pacchetto."
-
-#~ msgid "Failed reading the list file %sinfo/%s"
-#~ msgstr "Lettura del file dell'elenco %sinfo/%s non riuscita"
-
-#~ msgid "Internal error getting a node"
-#~ msgstr "Errore interno nel recuperare un nodo"
-
-#~ msgid "Failed to open the diversions file %sdiversions"
-#~ msgstr "Apertura del file di deviazione %sdiversions non riuscita"
-
-#~ msgid "The diversion file is corrupted"
-#~ msgstr "Il file di deviazione è danneggiato"
-
-#~ msgid "Invalid line in the diversion file: %s"
-#~ msgstr "Riga non valida nel file di diversion: %s"
-
-#~ msgid "Internal error adding a diversion"
-#~ msgstr "Errore interno nell'aggiungere una deviazioni"
-
-#~ msgid "The pkg cache must be initialized first"
-#~ msgstr "La cache dei pacchetti deve prima essere inizializzata"
-
-#~ msgid "Failed to find a Package: header, offset %lu"
-#~ msgstr "Impossibile trovare un Package: header, offset %lu"
-
-#~ msgid "Bad ConfFile section in the status file. Offset %lu"
-#~ msgstr "Sezione ConfFile nel file di stato non corretta. Offset %lu"
-
-#~ msgid "Error parsing MD5. Offset %lu"
-#~ msgstr "Errore nell'analisi MD5. Offset %lu"
-
-#~ msgid "Couldn't change to %s"
-#~ msgstr "Impossibile passare a %s"
-
-#~ msgid "Failed to locate a valid control file"
-#~ msgstr "Impossibile localizzare un file \"control\" valido"
-
-#~ msgid "Couldn't open pipe for %s"
-#~ msgstr "Impossibile aprire una pipe per %s"
-
-#~ msgid "Read error from %s process"
-#~ msgstr "Errore di lettura dal processo %s"
-
-#~ msgid "Got a single header line over %u chars"
-#~ msgstr "Ricevuta una singola riga header su %u caratteri"
-
-#~ msgid ""
-#~ "No apport report written because the error message indicates an issue on "
-#~ "the local system"
-#~ msgstr ""
-#~ "Non è stata scritta alcuna segnalazione di apport poiché il messaggio di "
-#~ "errore indica la presenza di un problema nel sistema locale"
-
-#~ msgid "Malformed override %s line %lu #1"
-#~ msgstr "Override non corretto: file %s riga %lu #1"
-
-#~ msgid "Malformed override %s line %lu #2"
-#~ msgstr "Override non corretto: file %s riga %lu #2"
-
-#~ msgid "Malformed override %s line %lu #3"
-#~ msgstr "Override non corretto: file %s riga %lu #3"
-
-#~ msgid "read, still have %lu to read but none left"
-#~ msgstr "lettura, c'erano ancora %lu da leggere ma non ne è rimasto alcuno"
-
-#~ msgid "write, still have %lu to write but couldn't"
-#~ msgstr "scrittura, c'erano ancora %lu da scrivere ma non è stato possibile"
-
-#~ msgid "Error occurred while processing %s (NewPackage)"
-#~ msgstr "Si è verificato un errore nell'elaborare %s (NewPackage)"
-
-#~ msgid "Error occurred while processing %s (UsePackage1)"
-#~ msgstr "Si è verificato un errore nell'elaborare %s (UsePackage1)"
-
-#~ msgid "Error occurred while processing %s (NewFileDesc1)"
-#~ msgstr "Si è verificato un errore nell'elaborare %s (NewFileDesc1)"
-
-#~ msgid "Error occurred while processing %s (UsePackage2)"
-#~ msgstr "Si è verificato un errore nell'elaborare %s (UsePackage2)"
-
-#~ msgid "Error occurred while processing %s (NewFileVer1)"
-#~ msgstr "Si è verificato un errore nell'elaborare %s (NewFileVer1)"
-
-#~ msgid "Error occurred while processing %s (UsePackage3)"
-#~ msgstr "Si è verificato un errore nell'elaborare %s (UsePackage3)"
-
-#~ msgid "Error occurred while processing %s (NewFileDesc2)"
-#~ msgstr "Si è verificato un errore nell'elaborare %s (NewFileDesc2)"
-
-#~ msgid "Error occurred while processing %s (FindPkg)"
-#~ msgstr "Si è verificato un errore nell'elaborare %s (FindPkg)"
-
-#~ msgid "Error occurred while processing %s (CollectFileProvides)"
-#~ msgstr "Si è verificato un errore nell'elaborare %s (CollectFileProvides)"
-
-#~ msgid "decompressor"
-#~ msgstr "de-compressore"
-
-#~ msgid "Error occurred while processing %s (NewVersion%d)"
-#~ msgstr "Si è verificato un errore nell'elaborare %s (NewVersion%d)"
-
-#~ msgid ""
-#~ "Could not perform immediate configuration on already unpacked '%s'. "
-#~ "Please see man 5 apt.conf under APT::Immediate-Configure for details."
-#~ msgstr ""
-#~ "Impossibile eseguire immediatamente la configurazione su \"%s\" già "
-#~ "estratto. Per maggiori informazioni, consultare \"man 5 apt.conf\" alla "
-#~ "sezione \"APT::Immediate-Configure\"."
index 997fc90d90233476640dbadaed4db966cd0e41ad..44b7fec721a5decb58e31af26c5e815f44941c21 100644 (file)
--- a/po/vi.po
+++ b/po/vi.po
@@ -5,10 +5,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: apt-0.9.9.4\n"
+"Project-Id-Version: apt-0.9.11\n"
 "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n"
 "POT-Creation-Date: 2013-07-31 16:24+0200\n"
-"PO-Revision-Date: 2013-08-03 08:52+0700\n"
+"PO-Revision-Date: 2013-08-25 14:13+0700\n"
 "Last-Translator: Trần Ngọc Quân <vnwildman@gmail.com>\n"
 "Language-Team: Vietnamese <translation-team-vi@lists.sourceforge.net>\n"
 "Language: vi\n"
@@ -24,7 +24,7 @@ msgstr ""
 #: cmdline/apt-cache.cc:158
 #, c-format
 msgid "Package %s version %s has an unmet dep:\n"
-msgstr "Gói %s phiên bản %s phụ thuộc vào phần mềm chưa có:\n"
+msgstr "Gói %s phiên bản %s chưa thỏa mãn quan hệ phụ thuộc:\n"
 
 #: cmdline/apt-cache.cc:286
 msgid "Total package names: "
@@ -112,7 +112,7 @@ msgstr "Bạn phải đưa ra ít nhất một mẫu tìm kiếm"
 #: cmdline/apt-cache.cc:1431
 msgid "This command is deprecated. Please use 'apt-mark showauto' instead."
 msgstr ""
-"Lệnh này đã bị loại bỏ. Xin hãy dùng lệnh 'apt-mark showauto' để thay thế."
+"Lệnh này đã lạc hậu. Xin hãy dùng lệnh 'apt-mark showauto' để thay thế."
 
 #: cmdline/apt-cache.cc:1526 apt-pkg/cacheset.cc:510
 #, c-format
@@ -219,7 +219,7 @@ msgstr ""
 "   stats - Hiện phần thống kê cơ bản\n"
 "   dump - Hiện toàn bộ tập tin dạng ngắn (đổ)\n"
 "   dumpavail - In ra một tập tin sẵn dùng ra thiết bị xuất chuẩn\n"
-"   unmet - Hiện các cách phụ thuộc chưa thỏa mãn\n"
+"   unmet - Hiện các gói chưa thỏa mãn quan hệ phụ thuộc\n"
 "   search - Tìm kiếm danh sách các gói dựa trên biểu thức chính quy\n"
 "   show - Hiển thị bản ghi có thể đọc cho những gói đó\n"
 "   depends - Hiện thông tin quan hệ phụ thuộc dạng thô cho gói\n"
@@ -336,7 +336,7 @@ msgstr "Lỗi biên dịch biểu thức chính quy - %s"
 
 #: cmdline/apt-get.cc:289
 msgid "The following packages have unmet dependencies:"
-msgstr "Những gói theo đây có phần phụ thuộc chưa có:"
+msgstr "Những gói theo đây chưa thỏa mãn quan hệ phụ thuộc:"
 
 #: cmdline/apt-get.cc:379
 #, c-format
@@ -443,7 +443,7 @@ msgstr "Ghi chú: đang chọn “%s” cho biểu thức chính quy “%s”\n"
 #: cmdline/apt-get.cc:686
 #, c-format
 msgid "Package %s is a virtual package provided by:\n"
-msgstr "Gói %s là gói ảo được cung cấp do:\n"
+msgstr "Gói %s là gói ảo được cung cấp bởi:\n"
 
 #: cmdline/apt-get.cc:697
 msgid " [Installed]"
@@ -560,9 +560,7 @@ msgstr "Bạn có thể chạy lệnh “apt-get -f install” để sửa nhữ
 
 #: cmdline/apt-get.cc:1072
 msgid "Unmet dependencies. Try using -f."
-msgstr ""
-"Còn có cách phụ thuộc vào phần mềm chưa có. Như thế thì bạn hãy cố dùng tùy "
-"chọn “-f”."
+msgstr "Chưa thỏa mãn quan hệ phụ thuộc. Hãy thử dùng tùy chọn “-f”."
 
 #: cmdline/apt-get.cc:1097
 msgid "WARNING: The following packages cannot be authenticated!"
@@ -574,7 +572,7 @@ msgstr "Cảnh báo xác thực bị đè.\n"
 
 #: cmdline/apt-get.cc:1108
 msgid "Install these packages without verification?"
-msgstr "Cài đặt những gói này mà không cần thẩm tra không?"
+msgstr "Cài đặt những gói này mà không cần thẩm tra?"
 
 #: cmdline/apt-get.cc:1110
 msgid "Some packages could not be authenticated"
@@ -582,7 +580,7 @@ msgstr "Một số gói không thể được xác thực"
 
 #: cmdline/apt-get.cc:1119 cmdline/apt-get.cc:1280
 msgid "There are problems and -y was used without --force-yes"
-msgstr "Gặp lỗi và đã dùng tùy chọn “-y” mà không có  “--force-yes”"
+msgstr " lỗi và đã dùng tùy chọn “-y” mà không có  “--force-yes”"
 
 #: cmdline/apt-get.cc:1160
 msgid "Internal error, InstallPackages was called with broken packages!"
@@ -620,7 +618,7 @@ msgstr "Cần phải lấy %sB từ kho chứa.\n"
 #: cmdline/apt-get.cc:1237
 #, c-format
 msgid "After this operation, %sB of additional disk space will be used.\n"
-msgstr "Sau thao tác này, %sB dung lượng đĩa thêm sẽ được dùng thêm.\n"
+msgstr "Sau thao tác này, %sB dung lượng đĩa sẽ bị chiếm dụng.\n"
 
 #. TRANSLATOR: The required space between number and unit is already included
 #. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
@@ -682,7 +680,7 @@ msgstr "Một số tập tin không tải về được"
 
 #: cmdline/apt-get.cc:1404 cmdline/apt-get.cc:2698
 msgid "Download complete and in download only mode"
-msgstr "Mới tải về xong và trong chế độ chỉ tải về"
+msgstr "Hoàn tất việc tải về và trong chế độ chỉ tải về"
 
 #: cmdline/apt-get.cc:1410
 msgid ""
@@ -805,8 +803,8 @@ msgid ""
 "Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a "
 "solution)."
 msgstr ""
-"Gói còn phụ thuộc vào phần mềm chưa có. Hãy cố chạy lệnh “apt-get -f "
-"install” mà không có gói nào (hoặc chỉ định cách thức giải quyết)."
+"Thưa thỏa mãn quan hệ phụ thuộc. Hãy thử chạy lệnh “apt-get -f install” mà "
+"không có gói nào (hoặc chỉ định cách thức giải quyết)."
 
 #: cmdline/apt-get.cc:2002
 msgid ""
@@ -816,9 +814,9 @@ msgid ""
 "or been moved out of Incoming."
 msgstr ""
 "Không thể cài đặt một số gói. Điều đó có nghĩa là bạn đã yêu cầu\n"
-"một trường hợp không thể, hoặc nếu bạn sử dụng bản phân phối\n"
+"một trường hợp không thể, hoặc nếu bạn đang sử dụng bản phân phối\n"
 "chưa ổn định cái mà yêu cầu các gói mà nó còn chưa được tạo ra\n"
-"hoặc di chuyển chúng ra khỏi phần Incoming (Đến)."
+"hay chưa được chuyển ra khỏi phần Incoming (Đến)."
 
 #: cmdline/apt-get.cc:2023
 msgid "Broken packages"
@@ -851,8 +849,8 @@ msgid ""
 "This command is deprecated. Please use 'apt-mark auto' and 'apt-mark manual' "
 "instead."
 msgstr ""
-"Lệnh này đã bị loại bỏ. Xin hãy dùng lệnh 'apt-mark auto' và 'apt-mark "
-"manual' để thay thế."
+"Lệnh này đã lỗi thời. Xin hãy dùng lệnh 'apt-mark auto' và 'apt-mark manual' "
+"để thay thế."
 
 #: cmdline/apt-get.cc:2213
 msgid "Calculating upgrade... "
@@ -899,7 +897,7 @@ msgid ""
 "NOTICE: '%s' packaging is maintained in the '%s' version control system at:\n"
 "%s\n"
 msgstr ""
-"GHI CHÚ: sự đóng gói “%s” được bảo trì trong hệ thống điều khiển phiên bản "
+"GHI CHÚ: việc đóng gói “%s” được bảo trì trong hệ thống quản lý mã nguồn "
 "“%s” tại:\n"
 "%s\n"
 
@@ -945,7 +943,7 @@ msgstr "Lấy mã nguồn %s\n"
 
 #: cmdline/apt-get.cc:2693
 msgid "Failed to fetch some archives."
-msgstr "Gặp lỗi lkhi lấy một số kho."
+msgstr "Gặp lỗi khi lấy một số kho."
 
 #: cmdline/apt-get.cc:2724
 #, c-format
@@ -1008,13 +1006,15 @@ msgstr ""
 msgid ""
 "%s dependency for %s cannot be satisfied because the package %s cannot be "
 "found"
-msgstr "cách phụ thuộc %s cho %s không thể được thỏa vì không tìm thấy gọi %s"
+msgstr ""
+"cách phụ thuộc %s cho %s không thể được thỏa mãn vì không tìm thấy gói %s"
 
 #: cmdline/apt-get.cc:3081
 #, c-format
 msgid "Failed to satisfy %s dependency for %s: Installed package %s is too new"
 msgstr ""
-"Việc cố thỏa cách phụ thuộc %s cho %s bị lỗi vì gói đã cài đặt %s là quá mới"
+"Việc cố thỏa mãn quan hệ phụ thuộc %s cho %s bị lỗi vì gói đã cài đặt %s là "
+"quá mới"
 
 #: cmdline/apt-get.cc:3120
 #, c-format
@@ -1111,22 +1111,23 @@ msgstr ""
 "remove:  gỡ bỏ\n"
 "source:  nguồn\n"
 "\n"
-"apt-get là một giao diện dòng lệnh đơn giản để tải về và cài đặt gói phần "
-"mềm.\n"
+"apt-get là một giao diện dòng lệnh đơn giản dùng để tải về và cài đặt gói "
+"phần mềm.\n"
 "Những lệnh được dùng thường nhất là update (cập nhật) và install (cài đặt).\n"
 "\n"
 "Lệnh:\n"
 "   update - Lấy danh sách gói mới (cập nhật cơ sở dữ liệu)\n"
-"   upgrade - Nâng cấp\n"
+"   upgrade - Nâng cấp lên phiên bản mới hơn\n"
 "   install - Cài đặt gói mới (gói có dạng libc6 không phải libc6.deb)\n"
 "   remove - Gỡ bỏ gói phần mềm\n"
 "   autoremove - Tự động gỡ bỏ tất cả các gói không dùng\n"
 "   purge - Gỡ bỏ và tẩy xóa gói\n"
 "   source - Tải về kho nguồn\n"
 "   build-dep - Định cấu hình quan hệ phụ thuộc khi xây dụng, cho gói nguồn\n"
-"   dist-upgrade - Nâng cấp bản phân phối hãy xem apt-get(8)\n"
+"   dist-upgrade - Nâng cấp hệ điều hành lên phiên bản mới hơn, hãy xem apt-"
+"get(8)\n"
 "   dselect-upgrade - Cho phép chọn dselect\n"
-"   clean - Xóa các tập tin kho đã tải về (dọn dẹp thư mục lưu)\n"
+"   clean - Xóa các tập tin kho đã tải về (dọn dẹp thư mục lưu trữ)\n"
 "   autoclean - Xóa các tập tin kho cũ đã tải về (tự động làm sạch)\n"
 "   check - Kiểm tra xem có quan hệ phụ thuộc bị sai không\n"
 "   changelog - Tải về và hiển thị các thay đổi cho gói đã cho\n"
@@ -1299,7 +1300,7 @@ msgid ""
 "cannot be used to add new CD-ROMs"
 msgstr ""
 "Hãy sử dụng lệnh “apt-cdrom” để làm cho APT chấp nhận đĩa CD này. Không thể "
-"sử dụng lệnh “apt-get update” (lấy cập nhật) để thêm đĩa CD mới."
+"sử dụng lệnh “apt-get update” (cập nhật cơ sở dữ liệu) để thêm đĩa CD mới."
 
 #: methods/cdrom.cc:222
 msgid "Wrong CD-ROM"
@@ -1564,8 +1565,8 @@ msgid ""
 "Clearsigned file isn't valid, got '%s' (does the network require "
 "authentication?)"
 msgstr ""
-"Tập tin Clearsigned không hợp lệ,  nhận được '%s' (mạng yêu cầu xác nhận "
-"phải không?)"
+"Tập tin Clearsigned không hợp lệ, nhận được '%s' (mạng yêu cầu xác nhận phải "
+"không?)"
 
 #: methods/gpgv.cc:183
 msgid "Unknown error executing gpgv"
@@ -1588,7 +1589,7 @@ msgstr "Các tập tin trống rỗng không phải là kho lưu hợp lệ"
 
 #: methods/http.cc:394
 msgid "Waiting for headers"
-msgstr "Đang đợi những phần đầu..."
+msgstr "Đang đợi phần đầu dữ liệu..."
 
 #: methods/http.cc:544
 msgid "Bad header line"
@@ -1601,7 +1602,7 @@ msgstr "Máy phục vụ HTTP đã gửi một dòng đầu trả lời không h
 #: methods/http.cc:606
 msgid "The HTTP server sent an invalid Content-Length header"
 msgstr ""
-"Máy phục vụ HTTP đã gửi một dòng đầu Content-Length (độ dài nội dng) không "
+"Máy phục vụ HTTP đã gửi một dòng đầu Content-Length (độ dài nội dung) không "
 "hợp lệ"
 
 #: methods/http.cc:621
@@ -1612,7 +1613,7 @@ msgstr ""
 
 #: methods/http.cc:623
 msgid "This HTTP server has broken range support"
-msgstr "Máy phục vụ HTTP đã ngắt cách hỗ trợ phạm vi"
+msgstr "Máy phục vụ HTTP không hỗ trợ tải một phần tập tin"
 
 #: methods/http.cc:647
 msgid "Unknown date format"
@@ -1628,7 +1629,7 @@ msgstr "Kết nối đã quá giờ"
 
 #: methods/http.cc:854
 msgid "Error writing to output file"
-msgstr "Gặp lỗi khi ghi vào tập tin xuất"
+msgstr "Gặp lỗi khi ghi vào tập tin đầu ra"
 
 #: methods/http.cc:885
 msgid "Error writing to file"
@@ -1782,8 +1783,8 @@ msgid ""
 msgstr ""
 "Cách dùng: apt-extracttemplates tập_tin1 [tập_tin2 ...]\n"
 "\n"
-"[extract:  rút;\n"
-"templates: những biểu mẫu]\n"
+"[extract:  rút trích;\n"
+"templates: mẫu]\n"
 "\n"
 "apt-extracttemplates là một công cụ rút thông tin kiểu cấu hình\n"
 "\tvà biểu mẫu đều từ gói Debian\n"
@@ -2156,7 +2157,7 @@ msgstr ""
 
 #: cmdline/apt-sortpkgs.cc:89
 msgid "Unknown package record!"
-msgstr "Không  bản ghi gói!"
+msgstr "Không hiểu bản ghi gói!"
 
 #: cmdline/apt-sortpkgs.cc:153
 msgid ""
@@ -2211,16 +2212,16 @@ msgstr "Chữ ký kho không hợp lệ"
 
 #: apt-inst/contrib/arfile.cc:82
 msgid "Error reading archive member header"
-msgstr "Gặp lỗi khi đọc phần đầu bộ phận kho"
+msgstr "Gặp lỗi khi đọc phần đầu thành viên kho"
 
 #: apt-inst/contrib/arfile.cc:94
 #, c-format
 msgid "Invalid archive member header %s"
-msgstr "Phần đầu bộ phận kho lưu không hợp lệ %s"
+msgstr "Phần đầu thành viên kho lưu không hợp lệ %s"
 
 #: apt-inst/contrib/arfile.cc:106
 msgid "Invalid archive member header"
-msgstr "Phần đầu bộ phận kho không hợp lê"
+msgstr "Phần đầu thành viên kho không hợp lê"
 
 #: apt-inst/contrib/arfile.cc:135
 msgid "Archive is too short"
@@ -2927,7 +2928,7 @@ msgstr ""
 
 #: apt-pkg/algorithms.cc:1240
 msgid "Unable to correct problems, you have held broken packages."
-msgstr "Không thể sửa vấn đề, bạn đã giữ lại một số gói bị ngắt."
+msgstr "Không thể sửa trục trặc này, bạn đã giữ lại một số gói bị hỏng."
 
 #: apt-pkg/algorithms.cc:1592 apt-pkg/algorithms.cc:1594
 msgid ""
@@ -2967,12 +2968,12 @@ msgstr "Đang tải tập tin %li trong tổng số %li"
 #: apt-pkg/acquire-worker.cc:112
 #, c-format
 msgid "The method driver %s could not be found."
-msgstr "Không tìm thấy trình điều khiển phương pháp %s."
+msgstr "Không tìm thấy trình điều khiển phương thức %s."
 
 #: apt-pkg/acquire-worker.cc:161
 #, c-format
 msgid "Method %s did not start correctly"
-msgstr "Phương pháp %s đã không bắt đầu cho đúng."
+msgstr "Phương thức %s đã không khởi chạy đúng đắn."
 
 #: apt-pkg/acquire-worker.cc:447
 #, c-format
@@ -3000,12 +3001,13 @@ msgstr ""
 
 #: apt-pkg/cachefile.cc:87
 msgid "The package lists or status file could not be parsed or opened."
-msgstr "Không thể phân tích hay mở danh sách gói hay tâp tin trạng thái."
+msgstr "Không thể phân tích hay mở danh sách gói hay tp tin trạng thái."
 
 #: apt-pkg/cachefile.cc:91
 msgid "You may want to run apt-get update to correct these problems"
 msgstr ""
-"Bạn nên chạy lệnh “apt-get update” (lấy cập nhật) để sửa các vấn đề này"
+"Bạn nên lấy cơ sở dữ liệu mới bằng lệnh “apt-get update” để sửa các vấn đề "
+"này"
 
 #: apt-pkg/cachefile.cc:109
 msgid "The list of sources could not be read."
@@ -3052,7 +3054,7 @@ msgstr "Bộ nhớ tạm có hệ thống điều khiển phiên bản không t
 #: apt-pkg/pkgcachegen.cc:563
 #, c-format
 msgid "Error occurred while processing %s (%s%d)"
-msgstr "Gặp lỗi khi xử lý %s (%s%d)"
+msgstr "Có lỗi phát sinh khi xử lý %s (%s%d)"
 
 #: apt-pkg/pkgcachegen.cc:251
 msgid "Wow, you exceeded the number of package names this APT is capable of."
index 54d35fef80c8326a726171a80ed4e682bc4f6942..4003d932cfffa8b25ff40a547d4fd42500799abf 100644 (file)
@@ -194,6 +194,7 @@ setupenvironment() {
        echo 'quiet::NoUpdate "true";' >> aptconfig.conf
        export LC_ALL=C
        export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin"
+       configcompression '.' 'gz' #'bz2' 'lzma' 'xz'
        msgdone "info"
 }
 
@@ -240,7 +241,13 @@ configdpkg() {
                if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then
                        DPKGARCH="$(dpkg --print-architecture)"
                        for ARCH in ${ARCHS}; do
-                               if [ "${ARCH}" != "${DPKGARCH}" ]; then dpkg --add-architecture ${ARCH}; fi
+                               if [ "${ARCH}" != "${DPKGARCH}" ]; then
+                                       if ! dpkg --add-architecture ${ARCH}; then
+                                               # old-style used e.g. in Ubuntu-P – and as it seems travis
+                                               echo "DPKG::options:: \"--foreign-architecture\";" >> aptconfig.conf
+                                               echo "DPKG::options:: \"${ARCH}\";" >> aptconfig.conf
+                                       fi
+                               fi
                        done
                        if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then
                                # dpkg doesn't really check the version as long as it is fully installed,
@@ -251,6 +258,20 @@ configdpkg() {
        fi
 }
 
+configcompression() {
+       while [ -n "$1" ]; do
+               case "$1" in
+               '.') echo ".\t.\tcat";;
+               'gz') echo "gzip\tgz\tgzip";;
+               'bz2') echo "bzip2\tbz2\tbzip2";;
+               'lzma') echo "lzma\tlzma\txz --format=lzma";;
+               'xz') echo "xz\txz\txz";;
+               *) echo "$1\t$1\t$1";;
+               esac
+               shift
+       done > ${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf
+}
+
 setupsimplenativepackage() {
        local NAME="$1"
        local ARCH="$2"
@@ -421,6 +442,8 @@ buildaptarchive() {
 }
 
 createaptftparchiveconfig() {
+       local COMPRESSORS="$(cut -d'    ' -f 1 ${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf | tr '\n' ' ')"
+       COMPRESSORS="${COMPRESSORS%* }"
        local ARCHS="$(find pool/ -name '*.deb' | grep -oE '_[a-z0-9-]+\.deb$' | sort | uniq | sed -e '/^_all.deb$/ d' -e 's#^_\([a-z0-9-]*\)\.deb$#\1#' | tr '\n' ' ')"
        if [ -z "$ARCHS" ]; then
                # the pool is empty, so we will operate on faked packages - let us use the configured archs
@@ -438,10 +461,10 @@ createaptftparchiveconfig() {
        echo -n '";
 };
 Default {
-       Packages::Compress ". gzip bzip2 lzma xz";
-       Sources::Compress ". gzip bzip2 lzma xz";
-       Contents::Compress ". gzip bzip2 lzma xz";
-       Translation::Compress ". gzip bzip2 lzma xz";
+       Packages::Compress "'"$COMPRESSORS"'";
+       Sources::Compress "'"$COMPRESSORS"'";
+       Contents::Compress "'"$COMPRESSORS"'";
+       Translation::Compress "'"$COMPRESSORS"'";
        LongDescription "false";
 };
 TreeDefault {
@@ -611,18 +634,27 @@ buildaptarchivefromfiles() {
        msginfo "Build APT archive for ${CCMD}$(basename $0)${CINFO} based on prebuild files…"
        find aptarchive -name 'Packages' -o -name 'Sources' | while read line; do
                msgninfo "\t${line} file… "
-               cat ${line} | gzip > ${line}.gz
-               cat ${line} | bzip2 > ${line}.bz2
-               cat ${line} | xz --format=lzma > ${line}.lzma
-               cat ${line} | xz > ${line}.xz
-               if [ -n "$1" ]; then
-                       touch -d "$1" ${line}.gz ${line}.bz2 ${line}.lzma ${line}.xz
-               fi
+               compressfile "$line" "$1"
                msgdone "info"
        done
        generatereleasefiles "$@"
 }
 
+compressfile() {
+       cat ${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf | while read compressor extension command; do
+               if [ "$compressor" = '.' ]; then
+                       if [ -n "$2" ]; then
+                               touch -d "$2" "$1"
+                       fi
+                       continue
+               fi
+               cat "$1" | $command > "${1}.${extension}"
+               if [ -n "$2" ]; then
+                       touch -d "$2" "${1}.${extension}"
+               fi
+       done
+}
+
 # can be overridden by testcases for their pleasure
 getcodenamefromsuite() { echo -n "$1"; }
 getreleaseversionfromsuite() { true; }
index 85c3a2fee723baf2b7cf244671e9e9610e0d7b02..cc3483f9bce7493cc99bfbfca790dd07218e9bd7 100755 (executable)
@@ -18,10 +18,7 @@ echo 'Description-de: automatisch generiertes Testpaket testing=0.8.15/stable
  Diese Pakete sind nur für das testen von APT gedacht,
  sie erfüllen keinen Zweck auf einem normalen System…
 ' >> Translation-de
-cat Translation-de | gzip > Translation-de.gz
-cat Translation-de | bzip2 > Translation-de.bz2
-cat Translation-de | xz --format=lzma > Translation-de.lzma
-cat Translation-de | xz > Translation-de.xz
+compressfile Translation-de
 rm Translation-en Translation-de
 cd - > /dev/null
 addtrap 'prefix' "chmod -R +w $PWD/rootdir/media/cdrom/dists/;"
index 99ea8bffa709093932d9175ab2b0e2940afc4d23..e77efb46e37c5c2e353284190e38ef54788aae12 100755 (executable)
@@ -21,9 +21,7 @@ prepare() {
        done
        cp $1 aptarchive/Packages
        find aptarchive -name 'Release' -delete
-       cat aptarchive/Packages | gzip > aptarchive/Packages.gz
-       cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2
-       cat aptarchive/Packages | xz --format=lzma > aptarchive/Packages.lzma
+       compressfile aptarchive/Packages
         # create Release file with incorret checksums
        cat > aptarchive/Release <<EOF
 Date: Fri, 05 Aug 2011 09:22:08 UTC
index 994489ee542eef68a95f862747bc2ad00be3eb2a..ac0563b7f8eed739a130f793741477bef4f3bca2 100755 (executable)
@@ -19,9 +19,7 @@ testequal "$(cat ${PKGFILE})
 " aptcache show apt oldstuff
 
 cp ${PKGFILE}-new aptarchive/Packages
-cat aptarchive/Packages | gzip > aptarchive/Packages.gz
-cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2
-cat aptarchive/Packages | xz --format=lzma > aptarchive/Packages.lzma
+compressfile 'aptarchive/Packages'
 rm -rf aptarchive/Packages.diff
 mkdir -p aptarchive/Packages.diff
 PATCHFILE="aptarchive/Packages.diff/$(date +%Y-%m-%d-%H%M.%S)"
index daba3919bfe5e2d5cd53826db537dee2d485b67a..a9f4b977523d0ba3be51e5b56899e3ccdd547ece 100755 (executable)
@@ -22,9 +22,7 @@ prepare() {
        aptget clean
        cp $1 aptarchive/Packages
        find aptarchive -name 'Release' -delete
-       cat aptarchive/Packages | gzip > aptarchive/Packages.gz
-       cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2
-       cat aptarchive/Packages | xz --format=lzma > aptarchive/Packages.lzma
+       compressfile 'aptarchive/Packages'
        generatereleasefiles "$DATE"
 }