Hello community,
here is the log from the commit of package yast2-backup
checked in at Wed Mar 5 21:37:00 CET 2008.
--------
--- yast2-backup/yast2-backup.changes 2007-12-11 15:08:47.000000000 +0100
+++ yast2-backup/yast2-backup.changes 2008-03-05 10:53:05.000000000 +0100
@@ -1,0 +2,6 @@
+Wed Mar 5 10:27:15 CET 2008 - locilka@suse.cz
+
+- Adapted to a new .process SCR agent.
+- 2.16.2
+
+-------------------------------------------------------------------
Old:
----
yast2-backup-2.16.1.tar.bz2
New:
----
yast2-backup-2.16.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-backup.spec ++++++
--- /var/tmp/diff_new_pack.qh7282/_old 2008-03-05 21:36:42.000000000 +0100
+++ /var/tmp/diff_new_pack.qh7282/_new 2008-03-05 21:36:42.000000000 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package yast2-backup (Version 2.16.1)
+# spec file for package yast2-backup (Version 2.16.2)
#
-# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@@ -10,13 +10,14 @@
# norootforbuild
+
Name: yast2-backup
-Version: 2.16.1
+Version: 2.16.2
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-backup-2.16.1.tar.bz2
+Source0: yast2-backup-2.16.2.tar.bz2
Prefix: /usr
Summary: YaST2 - System Backup
BuildArch: noarch
@@ -39,8 +40,8 @@
Requires: yast2
Requires: yast2-nfs-client
Requires: yast2-storage
-# New mod-UI
-Conflicts: yast2-core < 2.15.7
+# .process.buffer_empty
+Conflicts: yast2-core < 2.16.10
Recommends: yast2-bootloader
Recommends: yast2-network
Recommends: yast2-tune
@@ -62,7 +63,7 @@
Lukas Ocilka
%prep
-%setup -n yast2-backup-2.16.1
+%setup -n yast2-backup-2.16.2
%build
%{prefix}/bin/y2tool y2autoconf
++++++ yast2-backup-2.16.1.tar.bz2 -> yast2-backup-2.16.2.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-backup-2.16.1/configure new/yast2-backup-2.16.2/configure
--- old/yast2-backup-2.16.1/configure 2007-12-11 14:43:59.000000000 +0100
+++ new/yast2-backup-2.16.2/configure 2008-03-05 13:09:57.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for yast2-backup 2.16.1.
+# Generated by GNU Autoconf 2.61 for yast2-backup 2.16.2.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -574,8 +574,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-backup'
PACKAGE_TARNAME='yast2-backup'
-PACKAGE_VERSION='2.16.1'
-PACKAGE_STRING='yast2-backup 2.16.1'
+PACKAGE_VERSION='2.16.2'
+PACKAGE_STRING='yast2-backup 2.16.2'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1197,7 +1197,7 @@
# 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 yast2-backup 2.16.1 to adapt to many kinds of systems.
+\`configure' configures yast2-backup 2.16.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1268,7 +1268,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-backup 2.16.1:";;
+ short | recursive ) echo "Configuration of yast2-backup 2.16.2:";;
esac
cat <<\_ACEOF
@@ -1346,7 +1346,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-backup configure 2.16.1
+yast2-backup configure 2.16.2
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1360,7 +1360,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by yast2-backup $as_me 2.16.1, which was
+It was created by yast2-backup $as_me 2.16.2, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2181,7 +2181,7 @@
# Define the identity of the package.
PACKAGE='yast2-backup'
- VERSION='2.16.1'
+ VERSION='2.16.2'
cat >>confdefs.h <<_ACEOF
@@ -2409,7 +2409,7 @@
-VERSION="2.16.1"
+VERSION="2.16.2"
RPMNAME="yast2-backup"
MAINTAINER="Lukas Ocilka "
@@ -2651,8 +2651,8 @@
if test -z "$XGETTEXT" ; then
- { { echo "$as_me:$LINENO: error: xgettext is missing; please install gettext-devel." >&5
-echo "$as_me: error: xgettext is missing; please install gettext-devel." >&2;}
+ { { echo "$as_me:$LINENO: error: xgettext is missing; please install gettext-tools." >&5
+echo "$as_me: error: xgettext is missing; please install gettext-tools." >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -3304,7 +3304,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-backup $as_me 2.16.1, which was
+This file was extended by yast2-backup $as_me 2.16.2, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3347,7 +3347,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-backup config.status 2.16.1
+yast2-backup config.status 2.16.2
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-backup-2.16.1/configure.in new/yast2-backup-2.16.2/configure.in
--- old/yast2-backup-2.16.1/configure.in 2007-12-11 14:43:54.000000000 +0100
+++ new/yast2-backup-2.16.2/configure.in 2008-03-05 13:09:52.000000000 +0100
@@ -1,9 +1,9 @@
dnl configure.in for yast2-backup
dnl
-dnl -- This file is generated by y2autoconf 2.16.2 - DO NOT EDIT! --
+dnl -- This file is generated by y2autoconf 2.16.3 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-backup, 2.16.1, http://bugs.opensuse.org/, yast2-backup)
+AC_INIT(yast2-backup, 2.16.2, http://bugs.opensuse.org/, yast2-backup)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.16.1"
+VERSION="2.16.2"
RPMNAME="yast2-backup"
MAINTAINER="Lukas Ocilka "
@@ -108,7 +108,7 @@
dnl no need for AC_ARG_VAR
AC_PATH_PROG(XGETTEXT, xgettext)
if test -z "$XGETTEXT" ; then
- AC_MSG_ERROR(xgettext is missing; please install gettext-devel.)
+ AC_MSG_ERROR(xgettext is missing; please install gettext-tools.)
fi
Y2DEVTOOLS_PREFIX=`pkg-config --print-errors --variable=prefix yast2-devtools`
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-backup-2.16.1/Makefile.in new/yast2-backup-2.16.2/Makefile.in
--- old/yast2-backup-2.16.1/Makefile.in 2007-12-11 14:44:01.000000000 +0100
+++ new/yast2-backup-2.16.2/Makefile.in 2008-03-05 13:09:58.000000000 +0100
@@ -505,6 +505,10 @@
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
@@ -531,6 +535,8 @@
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
@@ -687,10 +693,10 @@
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
- dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \
- distclean-generic distclean-tags distcleancheck distdir \
- distuninstallcheck dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am \
+ dist-hook dist-lzma dist-shar dist-tarZ dist-zip distcheck \
+ distclean distclean-generic distclean-tags distcleancheck \
+ distdir distuninstallcheck dvi dvi-am html html-am info \
+ info-am install install-am install-data install-data-am \
install-data-local install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-backup-2.16.1/src/backup_get_packages.ycp new/yast2-backup-2.16.2/src/backup_get_packages.ycp
--- old/yast2-backup-2.16.1/src/backup_get_packages.ycp 2007-10-23 16:19:11.000000000 +0200
+++ new/yast2-backup-2.16.2/src/backup_get_packages.ycp 2008-03-05 13:06:22.000000000 +0100
@@ -29,8 +29,11 @@
y2milestone("Reading packages available on the installation sources...");
string filename = nil;
- if (is(WFM::Args(0), string)) {
- filename = (string) WFM::Args (0);
+ list args = WFM::Args();
+ y2milestone ("Args: %1", args);
+
+ if (args[0]:nil != nil && is(args[0]:"", string)) {
+ filename = (string) args[0]:"";
} else {
y2error ("Wrong parameter for script");
return false;
@@ -43,14 +46,16 @@
}
Pkg::TargetInitialize ("/");
+ Pkg::SourceRestore();
+ Pkg::SourceStartManager(true);
// list of available enabled installation sources
list<integer> sources = Pkg::SourceStartCache(true);
- y2debug("availables sources: %1", sources);
+ y2milestone("availables sources: %1", sources);
// list of installed products (last installed is first in the list)
list installed_products = Pkg::TargetProducts();
- y2debug("installed products: %1", installed_products);
+ y2milestone("installed products: %1", installed_products);
// installation sources for installed products
list<integer> product_sources = [];
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-backup-2.16.1/src/backup.ycp new/yast2-backup-2.16.2/src/backup.ycp
--- old/yast2-backup-2.16.1/src/backup.ycp 2007-05-18 10:43:36.000000000 +0200
+++ new/yast2-backup-2.16.2/src/backup.ycp 2008-03-05 13:09:31.000000000 +0100
@@ -8,7 +8,7 @@
* Authors:
* Ladislav Slezak
*
- * $Id: backup.ycp 24200 2005-07-20 12:11:50Z locilka $
+ * $Id: backup.ycp 45208 2008-03-05 12:09:30Z locilka $
*
* Main file for backup module - definition of workflow
*
@@ -153,7 +153,7 @@
// create wizard dialog
Wizard::CreateDialog();
// set icon
- Wizard::SetDesktopIcon("backup");
+ Wizard::SetTitleIcon("backup");
}
Backup::ReadBackupProfiles();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-backup-2.16.1/src/Backup.ycp new/yast2-backup-2.16.2/src/Backup.ycp
--- old/yast2-backup-2.16.1/src/Backup.ycp 2007-07-04 11:16:30.000000000 +0200
+++ new/yast2-backup-2.16.2/src/Backup.ycp 2008-03-05 13:09:31.000000000 +0100
@@ -8,7 +8,7 @@
* Authors:
* Ladislav Slezak
*
- * $Id: Backup.ycp 39154 2007-07-04 09:16:29Z locilka $
+ * $Id: Backup.ycp 45208 2008-03-05 12:09:30Z locilka $
*
* Main file for backup module
*
@@ -426,11 +426,17 @@
script_options = script_options + " --no-md5";
}
- // add widget file option
- script_options = script_options + " --widget-file " + ((string)SCR::Read(.target.tmpdir)) + "/items.ycp";
+ // if (display files before archiving them)
+ if (display) {
+ y2milestone ("Files files will be displayed before archiving");
+ // add widget file option
+ script_options = script_options + " --widget-file " + ((string)SCR::Read(.target.tmpdir)) + "/items.ycp";
- // add items list option
- script_options = script_options + " --list-file " + ((string)SCR::Read(.target.tmpdir)) + "/items-list.ycp";
+ // add items list option
+ script_options = script_options + " --list-file " + ((string)SCR::Read(.target.tmpdir)) + "/items-list.ycp";
+ } else {
+ y2milestone ("Displaying files will be skipped");
+ }
// add package verification option
script_options = script_options + " --pkg-verification";
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-backup-2.16.1/src/functions.ycp new/yast2-backup-2.16.2/src/functions.ycp
--- old/yast2-backup-2.16.1/src/functions.ycp 2007-10-30 09:53:20.000000000 +0100
+++ new/yast2-backup-2.16.2/src/functions.ycp 2008-03-05 13:09:31.000000000 +0100
@@ -8,7 +8,7 @@
* Authors:
* Ladislav Slezak
*
- * $Id: functions.ycp 41630 2007-10-30 08:53:19Z locilka $
+ * $Id: functions.ycp 45208 2008-03-05 12:09:30Z locilka $
*
* Functions used by backup module.
*/
@@ -703,6 +703,9 @@
* @return list<string> available packages
*/
define list <string> GetInstallPackages () {
+ // function returns empty list
+ return [];
+
y2milestone("--- backup_get_packages ---");
// was: return (list <string>) WFM::call("backup_get_packages", []);
// bugzilla #224899, saves memory occupied by zypp data (packager)
@@ -722,6 +725,7 @@
return [];
}
+ // breaks ncurses
string cmd = sformat("%1 backup_get_packages %2 1>/dev/null 2>/dev/null", yastbin, temporary_file);
y2milestone ("Running command: '%1'", cmd);
map command = (map) SCR::Execute(.target.bash_output, cmd);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-backup-2.16.1/src/scripts/backup_archive.pl new/yast2-backup-2.16.2/src/scripts/backup_archive.pl
--- old/yast2-backup-2.16.1/src/scripts/backup_archive.pl 2007-10-30 09:53:20.000000000 +0100
+++ new/yast2-backup-2.16.2/src/scripts/backup_archive.pl 2008-03-05 13:09:31.000000000 +0100
@@ -14,7 +14,7 @@
# This script creates backup archive as specified with command
# line parameters.
#
-# $Id: backup_archive.pl 41630 2007-10-30 08:53:19Z locilka $
+# $Id: backup_archive.pl 45208 2008-03-05 12:09:30Z locilka $
#
use Getopt::Long;
@@ -490,7 +490,7 @@
print "Creating archive:\n";
}
-if (defined open(FILES, $files_info))
+if (open(FILES, $files_info))
{
while (my $line = <FILES>)
{
@@ -597,6 +597,10 @@
close(FILES);
}
+else
+{
+ print STDERR "Cannot open list of files to backup";
+}
#last package
if (defined $opened)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-backup-2.16.1/src/ui.ycp new/yast2-backup-2.16.2/src/ui.ycp
--- old/yast2-backup-2.16.1/src/ui.ycp 2007-11-19 16:51:33.000000000 +0100
+++ new/yast2-backup-2.16.2/src/ui.ycp 2008-03-05 13:09:31.000000000 +0100
@@ -8,7 +8,7 @@
* Authors:
* Ladislav Slezak
*
- * $Id: ui.ycp 42181 2007-11-19 15:51:32Z locilka $
+ * $Id: ui.ycp 45208 2008-03-05 12:09:30Z locilka $
*
* Yast2 user interface functions - dialogs
*/
@@ -33,7 +33,10 @@
textdomain "backup";
- integer wait_time = 500; // loop delay (in miliseconds)
+integer wait_time = 250; // loop delay (in miliseconds)
+
+// used for the ag_process
+integer backup_PID = nil;
// variables needed for backup when freezes on ZERO (or almost zero) free space
integer waiting_without_output = 0;
@@ -92,7 +95,7 @@
y2milestone("Finishing backup...");
return `abort;
// !cron mode => ask user
- } else if ((boolean) SCR::Read(.background.isrunning)) {
+ } else if ((boolean) SCR::Read (.process.running, backup_PID)) {
if (!Popup::YesNoHeadline(
// headline of a popup message
_("Warning"),
@@ -122,7 +125,7 @@
y2milestone("Finishing backup...");
return `abort;
// !cron mode => ask user
- } else if ((boolean) SCR::Read(.background.isrunning)) {
+ } else if ((boolean) SCR::Read (.process.running, backup_PID)) {
if (!Popup::YesNoHeadline(
// headline of a popup message
_("Warning"),
@@ -165,7 +168,7 @@
if (AbortConfirmation(abort_question))
{
- SCR::Execute(.background.kill, nil);
+ SCR::Execute (.process.kill, backup_PID);
return ret;
}
else
@@ -174,33 +177,25 @@
}
}
- while ((integer)SCR::Read(.background.newlines) == 0 && (boolean)SCR::Read(.background.output_open))
+ if ((boolean) SCR::Read (.process.running, backup_PID))
{
sleep(wait);
ret = (symbol) UI::PollInput();
- if (ret == `abort || ret == `cancel)
- {
+ if (ret == `abort || ret == `cancel) {
ret = `abort;
- y2warning("Abort pressed");
+ y2warning("Abort pressed");
- if (AbortConfirmation(abort_question))
- {
- SCR::Execute(.background.kill, "");
- break;
- }
- else
- {
- ret = nil;
- }
- }
-
- if (Backup::just_creating_archive) {
- CheckFreeSpace();
- ret = EvaluateFreeSpace(ret);
- if (ret == `abort) {
- break;
+ if (Backup::just_creating_archive) {
+ CheckFreeSpace();
+ ret = EvaluateFreeSpace (ret);
+ } else {
+ if (AbortConfirmation(abort_question)) {
+ SCR::Execute(.process.kill, backup_PID);
+ } else {
+ ret = nil;
+ }
}
}
}
@@ -1682,9 +1677,6 @@
);
}
- // set buffer size
- SCR::Write(.background.buffer_size, 500);
-
// read list of available packages at the original installation sources
Backup::ReadInstallablePackages();
@@ -1874,19 +1866,26 @@
y2milestone("Search script: %1", Backup::script_get_files + Backup::get_search_script_parameters());
// starting the searching script in the background
- boolean started = (boolean)SCR::Execute(.background.run_output, Backup::script_get_files + Backup::get_search_script_parameters());
+ backup_PID = (integer) SCR::Execute (.process.start_shell, Backup::script_get_files + Backup::get_search_script_parameters(), $["C_locale":true]);
list<string> script_out = [ ];
+ boolean started = (backup_PID != nil && backup_PID > 0);
+
symbol ret = nil;
- y2milestone("subprocess started: %1 (PID: %2)", started, (integer)SCR::Read(.background.pid));
+ y2milestone ("subprocess started: %1 (PID: %2)", started, backup_PID);
if (!started) {
// error popup message
Report::Error(_("Could not start the search script.
Aborting the backup.
"));
- y2error("Errors: %1", (list<string>)SCR::Read(.background.newerr));
+ line = "";
+ while (line != nil) {
+ line = (string) SCR::Read (.process.read_line_stderr, backup_PID);
+ y2error ("Error: %1", line);
+ }
+
if (Backup::cron_mode) {
return `abort;
} else {
@@ -1897,19 +1896,15 @@
integer search_time = time();
// while background script runs
- while(((boolean)SCR::Read(.background.output_open)) || ((integer)SCR::Read(.background.newlines)) > 0) {
- script_out = (list<string>)SCR::Read(.background.newout);
-
- // processing the script output
- while (size(script_out) > 0) {
- line = script_out[0]:nil; // read line
- script_out = remove(script_out, 0); // remove line
+ while ((boolean) SCR::Read (.process.running, backup_PID) || ! (boolean) SCR::Read (.process.buffer_empty, backup_PID)) {
+ line = (string) SCR::Read (.process.read_line, backup_PID); // read line
+ while (line != nil) {
// reading installed packages until the last package is read
if (reading_installed_packages) {
Search_ProcessInstalledPackages();
} else {
- if (substring(line, 0, size(id_package)) == id_package || substring(line, 0, size(id_complete_package)) == id_complete_package) {
+ if (substring (line, 0, size(id_package)) == id_package || substring (line, 0, size(id_complete_package)) == id_complete_package) {
Search_ChangedPackageFiles();
} else {
if (substring(line, 0, size(id_file)) == id_file) {
@@ -1928,6 +1923,8 @@
}
}
}
+
+ line = (string) SCR::Read (.process.read_line, backup_PID); // read line
}
if (search_no_package) {
@@ -1936,19 +1933,18 @@
if (Backup::cron_mode) {
// in cron mode only wait for subprocess
- while (((integer)SCR::Read(.background.newlines)) == 0 && (boolean)SCR::Read(.background.output_open)) {
+ while ((string) SCR::Read (.process.read, backup_PID) != nil) {
sleep(wait_time);
}
ret = nil;
} else {
- ret = waitForUserOrProcess(wait_time, `changed);
+ ret = waitForUserOrProcess (wait_time, `changed);
}
if (ret != nil) {
return ret;
}
-
}
// end of the 'while' backround script runs
@@ -1978,24 +1974,13 @@
list package_files_part = [];
integer new_files = 0;
- while((boolean)SCR::Read(.background.output_open) || ((integer)SCR::Read(.background.newlines)) > 0 || (size(script_out) > 0))
+ while ((boolean) SCR::Read (.process.running, backup_PID) || ! (boolean) SCR::Read (.process.buffer_empty, backup_PID))
// test of script_out size is needed, because previous while cycle was interrupted and script could exited with no new output...
{
- if (size(script_out) == 0)
- {
- script_out = (list<string>)SCR::Read(.background.newout);
- }
-
- // current line index
- integer lineidx = 0;
- // number of new lines
- integer script_out_size = size(script_out);
-
- while (lineidx < script_out_size)
- {
- line = script_out[lineidx]:nil; // read line
- lineidx = lineidx + 1;
+ line = (string) SCR::Read (.process.read_line, backup_PID); // read line
+ if (line == nil) continue;
+ // --->
if (substring(line, 0, size(id_file)) == id_file)
{
line = substring(line, size(id_file));
@@ -2061,15 +2046,18 @@
}
}
}
- }
+ // <---
script_out = [];
if (Backup::cron_mode == true)
{
// in cron mode only wait for subprocess
- while (((integer)SCR::Read(.background.newlines)) == 0 && (boolean)SCR::Read(.background.output_open))
+ while ((boolean) SCR::Read (.process.running, backup_PID) || ! (boolean) SCR::Read (.process.buffer_empty, backup_PID))
{
+ while ((string) SCR::Read (.process.read, backup_PID) != nil) {
+ // do nothing
+ }
sleep(wait_time);
}
@@ -2560,21 +2548,8 @@
// prepare start
Backup::PrepareBackup();
- boolean started = (boolean)SCR::Execute(.background.run_output, sformat("%1 %2", Backup::script_create_archive, Backup::get_archive_script_parameters(tmpfile_list, tmpfile_comment)));
-
- if (!started)
- {
- // error popup message
- Report::Error(_("Could not start archiving script.
-Aborting the backup.
-"));
- return `abort;
- }
-
list<string> script_out = [ ];
-
-
archived_num = 0;
boolean tar_running = false;
@@ -2590,10 +2565,35 @@
y2milestone("Creating archive...");
+ backup_PID = (integer) SCR::Execute(
+ .process.start_shell,
+ sformat("%1 %2 | tee /tee-yast-backup", Backup::script_create_archive, Backup::get_archive_script_parameters(tmpfile_list, tmpfile_comment)),
+ $["C_locale":true]
+ );
+ boolean started = (backup_PID != nil && backup_PID > 0);
+
+ if (!started)
+ {
+ // error popup message
+ Report::Error(_("Could not start archiving script.
+Aborting the backup.
+"));
+ return `abort;
+ }
+
Backup::just_creating_archive = true;
- while(((boolean)SCR::Read(.background.output_open)) == true || ((integer)(SCR::Read(.background.newlines)) > 0))
+
+ line = "-- just -- started --";
+ // start while
+ //
+ // .running might return false
+ // but there still might be some buffer left
+ while ((boolean) SCR::Read (.process.running, backup_PID) || ! (boolean) SCR::Read (.process.buffer_empty, backup_PID))
{
- script_out = (list<string>) SCR::Read(.background.newout);
+ line = (string) SCR::Read(.process.read_line, backup_PID);
+ if (line == nil) continue;
+
+ script_out = [line];
// script returned some lines, no check the free space
if (size(script_out)>0) {
@@ -2812,7 +2812,10 @@
if (Backup::cron_mode) {
// in cron mode only wait for subprocess (and free space!)
- while ((integer) SCR::Read(.background.newlines) == 0 && (boolean) SCR::Read(.background.output_open) && enough_free_space_tmp && enough_free_space_target) {
+ while (((boolean) SCR::Read (.process.running, backup_PID) || ! (boolean) SCR::Read (.process.buffer_empty, backup_PID)) && enough_free_space_tmp && enough_free_space_target) {
+ while ((string) SCR::Read (.process.read_line, backup_PID) != nil) {
+ // do nothing
+ }
sleep(wait_time);
CheckFreeSpace();
}
@@ -2836,6 +2839,10 @@
}
}
+ // end while
+
+ y2milestone ("DEBUG: running %1", (boolean) SCR::Read (.process.running, backup_PID));
+ y2milestone ("DEBUG: empty %1", (boolean) SCR::Read (.process.buffer_empty, backup_PID));
Backup::selected_files = $[];
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-backup-2.16.1/VERSION new/yast2-backup-2.16.2/VERSION
--- old/yast2-backup-2.16.1/VERSION 2007-12-11 14:41:39.000000000 +0100
+++ new/yast2-backup-2.16.2/VERSION 2008-03-05 10:27:07.000000000 +0100
@@ -1 +1 @@
-2.16.1
+2.16.2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org