[Debian-l10n-commits] poedit branch experimental updated. debian/1.7.5-1-3-g5dc5324

Gianfranco Costamagna locutusofborg-guest at moszumanska.debian.org
Thu Apr 23 08:20:49 UTC 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "poedit".

The branch, experimental has been updated
       via  5dc5324f232256d45a5a44083fa6bf281835e425 (commit)
       via  834da42f8b19fdf52ac77c6e1d2fbb05419b73c2 (commit)
       via  7679febb9548ddc88be389409818e6f307395939 (commit)
      from  ba658258f8310ed40dfd7e2678e3111e230bf397 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------

http://anonscm.debian.org/gitweb/?p=debian-l10n/poedit.git;a=commitdiff;h=5dc5324f232256d45a5a44083fa6bf281835e425

commit 5dc5324f232256d45a5a44083fa6bf281835e425
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date:   Thu Apr 23 10:10:25 2015 +0200

    New upstream release


http://anonscm.debian.org/gitweb/?p=debian-l10n/poedit.git;a=commitdiff;h=834da42f8b19fdf52ac77c6e1d2fbb05419b73c2

commit 834da42f8b19fdf52ac77c6e1d2fbb05419b73c2
Merge: ba65825 7679feb
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date:   Thu Apr 23 10:09:33 2015 +0200

    Merge tag 'upstream/1.7.6' into experimental
    
    Upstream version 1.7.6

-----------------------------------------------------------------------

Summary of changes:
 NEWS             |  7 +++++
 configure        | 22 +++++++-------
 configure.ac     |  4 +--
 debian/changelog |  6 ++++
 docs/poedit.1    |  4 +--
 src/catalog.cpp  | 12 +++++---
 src/utility.cpp  | 91 ++++++++++++++++++++++++++++++++++++++++++--------------
 src/utility.h    |  9 +++++-
 src/version.h    |  4 +--
 9 files changed, 115 insertions(+), 44 deletions(-)

diff --git a/NEWS b/NEWS
index cba1938..067d652 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,11 @@
 
+Version 1.7.6
+-------------
+
+- fix handling of multiple displays
+- [Windows] fix "file couldn't be formatted nicely" problems with files in
+  directories with (some) Unicode names
+
 Version 1.7.5
 -------------
 
diff --git a/configure b/configure
index 19ed1b9..2f1a847 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for poedit 1.7.5.
+# Generated by GNU Autoconf 2.68 for poedit 1.7.6.
 #
 # Report bugs to <poedit at googlegroups.com>.
 #
@@ -560,8 +560,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='poedit'
 PACKAGE_TARNAME='poedit'
-PACKAGE_VERSION='1.7.5'
-PACKAGE_STRING='poedit 1.7.5'
+PACKAGE_VERSION='1.7.6'
+PACKAGE_STRING='poedit 1.7.6'
 PACKAGE_BUGREPORT='poedit at googlegroups.com'
 PACKAGE_URL=''
 
@@ -1281,7 +1281,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures poedit 1.7.5 to adapt to many kinds of systems.
+\`configure' configures poedit 1.7.6 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1351,7 +1351,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of poedit 1.7.5:";;
+     short | recursive ) echo "Configuration of poedit 1.7.6:";;
    esac
   cat <<\_ACEOF
 
@@ -1472,7 +1472,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-poedit configure 1.7.5
+poedit configure 1.7.6
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1715,7 +1715,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by poedit $as_me 1.7.5, which was
+It was created by poedit $as_me 1.7.6, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -2063,7 +2063,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-PACKAGE_SHORT_VERSION=1.7.5
+PACKAGE_SHORT_VERSION=1.7.6
 
 
 ac_aux_dir=
@@ -2607,7 +2607,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='poedit'
- VERSION='1.7.5'
+ VERSION='1.7.6'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -6437,7 +6437,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by poedit $as_me 1.7.5, which was
+This file was extended by poedit $as_me 1.7.6, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6494,7 +6494,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-poedit config.status 1.7.5
+poedit config.status 1.7.6
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index d154163..a8f4f2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,8 +2,8 @@ dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
 
-AC_INIT([poedit], [1.7.5], [poedit at googlegroups.com])
-PACKAGE_SHORT_VERSION=1.7.5
+AC_INIT([poedit], [1.7.6], [poedit at googlegroups.com])
+PACKAGE_SHORT_VERSION=1.7.6
 AC_SUBST(PACKAGE_SHORT_VERSION)
 
 AC_CONFIG_AUX_DIR([admin])
diff --git a/debian/changelog b/debian/changelog
index 2ee33cb..cad0a03 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+poedit (1.7.6-1) UNRELEASED; urgency=medium
+
+  * New Upstream Version
+
+ -- Gianfranco Costamagna <costamagnagianfranco at yahoo.it>  Thu, 23 Apr 2015 10:10:04 +0200
+
 poedit (1.7.5-1) experimental; urgency=medium
 
   * New Upstream Version
diff --git a/docs/poedit.1 b/docs/poedit.1
index d9d7f79..c2f7256 100644
--- a/docs/poedit.1
+++ b/docs/poedit.1
@@ -2,12 +2,12 @@
 .\"     Title: poedit
 .\"    Author: Vaclav Slavik <vaclav at slavik.io>
 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\"      Date: 03/11/2015
+.\"      Date: 04/18/2015
 .\"    Manual: \ \&
 .\"    Source: \ \&
 .\"  Language: English
 .\"
-.TH "POEDIT" "1" "03/11/2015" "\ \&" "\ \&"
+.TH "POEDIT" "1" "04/18/2015" "\ \&" "\ \&"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff --git a/src/catalog.cpp b/src/catalog.cpp
index 14a571a..657ac7e 100644
--- a/src/catalog.cpp
+++ b/src/catalog.cpp
@@ -1536,9 +1536,11 @@ bool Catalog::Save(const wxString& po_file, bool save_mo,
         else if (wrapping != DEFAULT_WRAPPING)
             wrappingFlag.Printf(" --width=%d", wrapping);
 
+        TempOutputFileFor po_file_temp2_obj(po_file_temp);
+        const wxString po_file_temp2 = po_file_temp2_obj.FileName();
         auto msgcatCmd = wxString::Format("msgcat --force-po%s -o %s %s",
                                           wrappingFlag,
-                                          QuoteCmdlineArg(po_file),
+                                          QuoteCmdlineArg(po_file_temp2),
                                           QuoteCmdlineArg(po_file_temp));
         wxLogTrace("poedit", "formatting file with %s", msgcatCmd);
 
@@ -1548,7 +1550,9 @@ bool Catalog::Save(const wxString& po_file, bool save_mo,
         //      msgids) that, while correct, are not something a *translator* can
         //      do anything about.
         wxLogNull null;
-        msgcat_ok = ExecuteGettext(msgcatCmd) && wxFileExists(po_file);
+        msgcat_ok = ExecuteGettext(msgcatCmd) &&
+                    wxFileExists(po_file_temp2) &&
+                    wxRenameFile(po_file_temp2, po_file, /*overwrite=*/true);
     }
 
     if ( msgcat_ok )
@@ -1600,7 +1604,7 @@ bool Catalog::Save(const wxString& po_file, bool save_mo,
                   (
                       wxString::Format("msgfmt -o %s %s",
                                        QuoteCmdlineArg(mo_file_temp),
-                                       QuoteCmdlineArg(po_file))
+                                       QuoteCmdlineArg(CliSafeFileName(po_file)))
                   ) )
             {
                 mo_compilation_status = CompilationStatus::Success;
@@ -1862,7 +1866,7 @@ int Catalog::DoValidate(const wxString& po_file)
     GettextErrors err;
     ExecuteGettextAndParseOutput
     (
-        wxString::Format("msgfmt -o /dev/null -c %s", QuoteCmdlineArg(po_file)),
+        wxString::Format("msgfmt -o /dev/null -c %s", QuoteCmdlineArg(CliSafeFileName(po_file))),
         err
     );
 
diff --git a/src/utility.cpp b/src/utility.cpp
index 26b2066..c74c280 100644
--- a/src/utility.cpp
+++ b/src/utility.cpp
@@ -136,6 +136,8 @@ TempOutputFileFor::TempOutputFileFor(const wxString& filename)
 {
     wxString path, name, ext;
     wxFileName::SplitPath(filename, &path, &name, &ext);
+    if (!ext.empty())
+        ext = "." + ext;
 
 #ifdef __WXOSX__
     NSURL *fileUrl = [NSURL fileURLWithPath:wxStringToNS(filename)];
@@ -146,22 +148,38 @@ TempOutputFileFor::TempOutputFileFor(const wxString& filename)
                                                  create:YES
                                                   error:nil];
     if (tempdirUrl)
-    {
-        NSURL *newFileUrl = [tempdirUrl URLByAppendingPathComponent:[fileUrl lastPathComponent]];
-        NSString *newFilePath = [newFileUrl path];
-        m_filenameTmp = wxStringFromNS(newFilePath);
         m_tempDir = wxStringFromNS([tempdirUrl path]);
-    }
-    // else: fall through to the generic code
-#endif // __WXOSX__
+#endif
 
-    if (m_filenameTmp.empty())
+    wxString counter;
+    for (;;)
     {
-        m_filenameTmp = filename + ".temp." + ext;
-    }
+#ifdef __WXOSX__
+        if (!m_tempDir.empty())
+        {
+            m_filenameTmp = m_tempDir + wxFILE_SEP_PATH + name + counter + ext;
+        }
+        else
+#endif // __WXOSX__
+        {
+            // Temp filenames may be ugly, nobody cares. Make them safe for
+            // Unicode-unfriendly uses on Windows, i.e. 8.3 without non-ASCII
+            // characters:
+            auto base = CliSafeFileName(path) + wxFILE_SEP_PATH;
+#ifdef __WXMSW__
+            // this is OK, ToAscii() replaces non-ASCII with '_':
+            base += name.ToAscii();
+#else
+            base += name;
+#endif
+            m_filenameTmp = base + ".temp" + counter + ext;
+        }
+
+        if (!wxFileExists(m_filenameTmp))
+            break; // good!
 
-    if ( wxFileExists(m_filenameTmp) )
-        wxRemoveFile(m_filenameTmp);
+        counter += wchar_t('a' + rand() % 26);
+    }
 }
 
 
@@ -173,6 +191,33 @@ TempOutputFileFor::~TempOutputFileFor()
 #endif
 }
 
+#ifdef __WXMSW__
+wxString CliSafeFileName(const wxString& fn)
+{
+    if (fn.IsAscii())
+    {
+        return fn;
+    }
+    else if (wxFileExists(fn) || wxDirExists(fn))
+    {
+        return wxFileName(fn).GetShortPath();
+    }
+    else
+    {
+        wxString path, name, ext;
+        wxFileName::SplitPath(fn, &path, &name, &ext);
+        if (wxDirExists(path))
+        {
+            auto p = wxFileName(path).GetShortPath() + wxFILE_SEP_PATH + name;
+            if (!ext.empty())
+                p += "." + ext;
+            return p;
+        }
+    }
+    return fn;
+}
+#endif // __WXMSW__
+
 
 // ----------------------------------------------------------------------
 // Helpers for persisting windows' state
@@ -226,7 +271,14 @@ void RestoreWindowState(wxTopLevelWindow *win, const wxSize& defaultSize, int fl
         int width = (int)cfg->Read(path + "w", defaultSize.x);
         int height = (int)cfg->Read(path + "h", defaultSize.y);
         if ( width != -1 || height != -1 )
+        {
+            // filter out ridiculous sizes:
+            if (width != -1 && width < 100)
+                width = defaultSize.x;
+            if (height != -1 && height < 100)
+                height = defaultSize.y;
             win->SetClientSize(width, height);
+        }
     }
 
 #if defined(__WXMSW__) || defined(__WXOSX__)
@@ -263,17 +315,10 @@ void RestoreWindowState(wxTopLevelWindow *win, const wxSize& defaultSize, int fl
 
     // If the window is completely out of all screens (e.g. because
     // screens configuration changed), move it to primary screen:
-#ifdef __WXOSX__
-    if ( win->GetPosition().x < 0 || win->GetPosition().y < 0 )
-        win->Move(20, 30);
-#else
     if ( wxDisplay::GetFromWindow(win) == wxNOT_FOUND )
-        win->Move(0, 0);
-#endif
-
+        win->Move(20, 40);
 #endif // __WXMSW__/__WXOSX__
 
-#ifndef __WXOSX__
     // If the window is larger than current screen, resize it to fit:
     int display = wxDisplay::GetFromWindow(win);
     if ( display == wxNOT_FOUND )
@@ -283,10 +328,13 @@ void RestoreWindowState(wxTopLevelWindow *win, const wxSize& defaultSize, int fl
 
     wxRect winRect = win->GetRect();
     if ( winRect.GetPosition() == wxDefaultPosition )
-        winRect.SetPosition(screenRect.GetPosition()); // not place yet, fake it
+        winRect.SetPosition(screenRect.GetPosition()); // not placed yet, fake it
 
     if ( !screenRect.Contains(winRect) )
     {
+        // Don't crop the window immediately, because it could become too small
+        // due to it. Try to move it to the center of the screen first, then crop.
+        winRect = winRect.CenterIn(screenRect);
         winRect.Intersect(screenRect);
         win->SetSize(winRect);
     }
@@ -296,5 +344,4 @@ void RestoreWindowState(wxTopLevelWindow *win, const wxSize& defaultSize, int fl
     {
         win->Maximize();
     }
-#endif // !__WXOSX__
 }
diff --git a/src/utility.h b/src/utility.h
index 5f4281c..f3f35a6 100644
--- a/src/utility.h
+++ b/src/utility.h
@@ -98,7 +98,14 @@ public:
     wxString m_filenameTmp;
 };
 
-// Helper for writing files
+
+#ifdef __WXMSW__
+/// Return filename safe for passing to CLI tools (gettext).
+/// Uses 8.3 short names to avoid Unicode and codepage issues.
+wxString CliSafeFileName(const wxString& fn);
+#else
+inline wxString CliSafeFileName(const wxString& fn) { return fn; }
+#endif
 
 
 // ----------------------------------------------------------------------
diff --git a/src/version.h b/src/version.h
index 4eef004..33ab210 100644
--- a/src/version.h
+++ b/src/version.h
@@ -26,7 +26,7 @@
 #ifndef _VERSION_H_
 #define _VERSION_H_
 
-#define POEDIT_VERSION           "1.7.5"
-#define POEDIT_VERSION_WIN        1,7,5,0
+#define POEDIT_VERSION           "1.7.6"
+#define POEDIT_VERSION_WIN        1,7,6,0
 
 #endif // _VERSION_H_
-----------------------------------------------------------------------


hooks/post-receive
-- 
poedit



More information about the Debian-l10n-commits mailing list