#
SET(VERSION_MAJOR "1")
SET(VERSION_MINOR "12")
-SET(VERSION_PATCH "29")
+SET(VERSION_PATCH "30")
-# LAST RELEASED: 1.12.29
+# LAST RELEASED: 1.12.30
#=======
-------------------------------------------------------------------
+Wed Jan 27 13:34:22 CET 2016 - ma@suse.de
+
+- Propagate repo refresh errors even if main action succeeded
+ (bsc#961719)
+- Fix misaligned TAB stops in colored prompts (bsc#948566)
+- version 1.12.30
+
+-------------------------------------------------------------------
+Sun Jan 24 01:14:09 CET 2016 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Jan 21 01:15:51 CET 2016 - ma@suse.de
+
+- Update sle-zypper-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Jan 21 01:14:12 CET 2016 - ma@suse.de
+
+- Update zypper-po.tar.bz2
+
+-------------------------------------------------------------------
Wed Jan 20 15:05:47 CET 2016 - ma@suse.de
- Enhance guessing of 'obs://' URLs on openSUSE Leap (bnc#959804)
, _argv( NULL )
, _out_ptr( NULL )
, _command( ZypperCommand::NONE )
-, _exit_code( ZYPPER_EXIT_OK )
+, _exitCode( ZYPPER_EXIT_OK )
+, _refreshCode( ZYPPER_EXIT_OK )
, _running_shell( false )
, _running_help( false )
, _exit_requested( false )
{ if ( !_rm ) _rm.reset( new RepoManager( _gopts.rm_options ) ); return *_rm; }
- int exitCode() const { return _exit_code; }
+ int exitCode() const { return _exitCode; }
void setExitCode( int exit ) {
WAR << "setExitCode " << exit << endl;
- _exit_code = exit;
+ _exitCode = exit;
}
+
+ int refreshCode() const { return _refreshCode; }
+ void setRefreshCode( int exit ) {
+ WAR << "setRefreshCode " << exit << endl;
+ _refreshCode = exit;
+ }
+
bool runningShell() const { return _running_shell; }
bool runningHelp() const { return _running_help; }
bool exitRequested() const { return _exit_requested; }
ArgList _arguments;
std::string _command_help;
- int _exit_code;
+ int _exitCode;
+ int _refreshCode; // do_init_repos hack!
bool _running_shell;
bool _running_help;
bool _exit_requested;
return ZYPPER_EXIT_ERR_BUG;
}
- return Zypper::instance()->main( argc, argv );
+ Zypper & zypper( *Zypper::instance() );
+ int exitcode = zypper.main( argc, argv );
+ if ( !exitcode )
+ exitcode = zypper.refreshCode(); // propagate refresh errors even if main action succeeded
+ return exitcode;
}
else
cout << startdesc << endl;
- ColorStream cout( std::cout, ColorContext::PROMPT ); // scoped color on std::cout
+ std::ostringstream pstr;
+ ColorStream cout( pstr, ColorContext::PROMPT ); // scoped color on std::cout
+
cout << prompt;
if ( ! poptions.empty() )
cout << " " << ColorString( poptions.optionString() );
- cout << ": " << std::flush;
+ cout << ": ";
+
+ if ( do_colors() )
+ {
+ // bsc#948566: Terminal is dumb and simply counts the amount of printable
+ // characters. If the number of printable characters within ansi SGR sequences
+ // is not a multiple of 8, tab stops are not computed correctly. We use
+ // superfluous resets ("\033[0m"; 3 printable chars) to fill up.
+ // Better ideas are welcome.
+ size_t invis = 0;
+ bool insgr = false;
+ for ( char ch : pstr.str() )
+ {
+ if ( insgr )
+ {
+ ++invis;
+ if ( ch == 'm' )
+ insgr = false;
+ }
+ else if ( ch == '\033' )
+ insgr = true;
+ }
+ invis %= 8;
+
+ if ( invis )
+ {
+ // "\033[0m" has 3 printable chars:
+ // ( resets[to fill] * 3 ) % 8 == to fill
+ // 0 1 2 3 4 5 6 7
+ static const size_t resets[] = { 0,3,6,1,4,7,2,5 };
+ for ( size_t i = resets[8-invis]; i; --i )
+ cout << ansi::Color::SGRReset();
+ }
+ }
+
+ std::cout << pstr.str() << std::flush;
// prompt ends with newline (user hits <enter>) unless exited abnormaly
_newline = true;
}
++it;
}
+ unsigned skip_count = 0;
for ( std::list<RepoInfo>::iterator it = gData.repos.begin(); it != gData.repos.end(); ++it )
{
RepoInfo repo( *it );
if ( refresh_raw_metadata( zypper, repo, false ) || build_cache( zypper, repo, false ) )
{
WAR << "Skipping repository '" << repo.alias() << "' because of the above error." << endl;
- zypper.out().info( str::Format(_("Skipping repository '%s' because of the above error.")) % repo.asUserString(),
- Out::QUIET );
+ zypper.out().warning( str::Format(_("Skipping repository '%s' because of the above error.")) % repo.asUserString(),
+ Out::QUIET );
it->setEnabled( false );
contentcheck = false;
+ ++skip_count;
}
}
// non-root user
it->setEnabled( false );
contentcheck = false;
+ ++skip_count;
}
}
// non-root user
it->setEnabled( false );
contentcheck = false;
- }
+ ++skip_count;
+ }
}
}
}
}
}
+
+ if ( skip_count )
+ {
+ zypper.out().error(_("Some of the repositories have not been refreshed because of an error.") );
+ // TODO: A user abort during repo refresh as well as unavailable metadata
+ // should probably lead to ZYPPER_EXIT_ERR_ZYPP right here. Ignored refresh
+ // errors may continue. For now at least remember the refresh error to prevent
+ // a 0 exit code after the action completed. (bsc#961719, bsc#961724, et.al.)
+ // zypper.setExitCode( ZYPPER_EXIT_ERR_ZYPP );
+ zypper.setRefreshCode( ZYPPER_EXIT_ERR_ZYPP );
+ }
}
// ----------------------------------------------------------------------------