Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / PublicKey.cc
index fa17b79..fc7435b 100644 (file)
@@ -130,7 +130,7 @@ namespace zypp
       }
       else
       { // translators: an annotation to a gpg keys expiry date
-       ret += str::form( PL_("(expires in %d day)", "(expires in %d days)", ttl ), ttl );
+       ret += str::form( _PL("(expires in %d day)", "(expires in %d days)", ttl ), ttl );
       }
     }
     return ret;
@@ -350,9 +350,6 @@ namespace zypp
         MIL << "Reading pubkey from " << info.path() << " of size " << info.size() << " and sha1 " << filesystem::checksum(info.path(), "sha1") << endl;
 
         static filesystem::TmpDir dir;
-       std::string tmppath( dir.path().asString() );
-       std::string datapath( _dataFile.path().asString() );
-
         const char* argv[] =
         {
           GPG_BINARY,
@@ -362,13 +359,13 @@ namespace zypp
           "--with-fingerprint",
           "--with-colons",
           "--homedir",
-          tmppath.c_str(),
+          dir.path().asString().c_str(),
           "--quiet",
           "--no-tty",
           "--no-greeting",
           "--batch",
           "--status-fd", "1",
-          datapath.c_str(),
+          _dataFile.path().asString().c_str(),
           NULL
         };
         ExternalProgram prog( argv, ExternalProgram::Discard_Stderr, false, -1, true );
@@ -378,15 +375,12 @@ namespace zypp
         {
          scanner.scan( line );
        }
-        int ret = prog.close();
+        prog.close();
 
        switch ( scanner._keys.size() )
        {
          case 0:
-           if ( ret == 129 )
-             ZYPP_THROW( Exception( std::string("Can't read public key data: ") + GPG_BINARY + " is not installed!" ) );
-           else
-             ZYPP_THROW( BadKeyException( "File " + _dataFile.path().asString() + " doesn't contain public key data" , _dataFile.path() ) );
+           ZYPP_THROW( BadKeyException( "File " + _dataFile.path().asString() + " doesn't contain public key data" , _dataFile.path() ) );
            break;
 
          case 1: