summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2006-10-14 16:01:37 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2006-10-14 16:01:37 +0000
commit8f2cf188831bce252c1c19319d545f4febb60415 (patch)
tree09bc89890a222e2c92874276bd114cc75738d8f8 /sys-block
parentStable on ia64. (diff)
downloadgentoo-2-8f2cf188831bce252c1c19319d545f4febb60415.tar.gz
gentoo-2-8f2cf188831bce252c1c19319d545f4febb60415.tar.bz2
gentoo-2-8f2cf188831bce252c1c19319d545f4febb60415.zip
Merged additional patches (fixes/improvements).
(Portage version: 2.1-r1)
Diffstat (limited to 'sys-block')
-rw-r--r--sys-block/partimage/ChangeLog8
-rw-r--r--sys-block/partimage/files/partimage-0.6.4-dont-discard-error-message-in-batch-mode.patch61
-rw-r--r--sys-block/partimage/files/partimage-0.6.4-save_file_and_rest_file_actions.patch127
-rw-r--r--sys-block/partimage/files/partimage-0.6.4-varargs.patch11
-rw-r--r--sys-block/partimage/partimage-0.6.4-r4.ebuild5
5 files changed, 210 insertions, 2 deletions
diff --git a/sys-block/partimage/ChangeLog b/sys-block/partimage/ChangeLog
index b5bea950df81..23c1b6284134 100644
--- a/sys-block/partimage/ChangeLog
+++ b/sys-block/partimage/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-block/partimage
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/ChangeLog,v 1.23 2006/10/05 03:02:26 josejx Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/ChangeLog,v 1.24 2006/10/14 16:01:37 xmerlin Exp $
+
+ 14 Oct 2006; Christian Zoffoli <xmerlin@gentoo.org>
+ +files/partimage-0.6.4-dont-discard-error-message-in-batch-mode.patch,
+ +files/partimage-0.6.4-save_file_and_rest_file_actions.patch,
+ +files/partimage-0.6.4-varargs.patch, partimage-0.6.4-r4.ebuild:
+ Merged additional patches (fixes/improvements).
05 Oct 2006; Joseph Jezak <josejx@gentoo.org> partimage-0.6.4-r3.ebuild,
partimage-0.6.4-r4.ebuild:
diff --git a/sys-block/partimage/files/partimage-0.6.4-dont-discard-error-message-in-batch-mode.patch b/sys-block/partimage/files/partimage-0.6.4-dont-discard-error-message-in-batch-mode.patch
new file mode 100644
index 000000000000..17f9f3ae8a7e
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.4-dont-discard-error-message-in-batch-mode.patch
@@ -0,0 +1,61 @@
+--- partimage-0.6.4/src/client/main.cpp.pix 2004-02-04 01:57:36.000000000 +0100
++++ partimage-0.6.4/src/client/main.cpp 2005-10-20 17:02:36.000000000 +0200
+@@ -133,6 +133,12 @@
+ }*/
+ }
+
++void ensure_interface_is_non_interactive()
++{
++ delete g_interface;
++ g_interface = new CInterfaceNone("");
++}
++
+ // =======================================================
+ int main(int argc, char *argv[])
+ {
+@@ -568,8 +574,9 @@
+ goto beginMainWin;
+ }
+
+- if (!options.bBatchMode)
+- g_interface -> Error(excep, szImageFile, szDevice);
++ if (options.bBatchMode) ensure_interface_is_non_interactive();
++
++ g_interface -> Error(excep, szImageFile, szDevice);
+
+ showDebug(1, "\nFINAL ERROR\n\n");
+
+@@ -580,8 +587,10 @@
+ else
+ {
+ showDebug(1, "The file system of [%s] is [%s], and is not supported\n", szDevice, szFileSystem);
+- if (!options.bBatchMode)
+- g_interface->msgBoxError("The file system of [%s] is [%s], and is not supported", szDevice, szFileSystem);
++
++ if (options.bBatchMode) ensure_interface_is_non_interactive();
++
++ g_interface->msgBoxError("The file system of [%s] is [%s], and is not supported", szDevice, szFileSystem);
+ nRes = -1;
+ }
+ //#endif // DEVEL_SUPPORT
+@@ -661,7 +670,7 @@
+ // update the disk IO
+ if (options.bSync)
+ {
+- g_interface -> StatusLine(i18n("commiting buffer cache to disk."));
++ if (!options.bBatchMode) g_interface -> StatusLine(i18n("commiting buffer cache to disk."));
+ sync();
+ }
+
+--- partimage-0.6.4/src/client/interface_none.cpp.pix 2004-02-04 01:57:36.000000000 +0100
++++ partimage-0.6.4/src/client/interface_none.cpp 2005-10-20 17:03:01.000000000 +0200
+@@ -96,7 +96,8 @@
+ void CInterfaceNone::msgBoxError(char *title, ...) {
+ va_list al;
+ va_start(al,title);
+- message_only("Error", title, "", al, 0);
++ vfprintf(stderr,title,al);
++ fputc('\n',stderr);
+ va_end(al);
+ }
+
diff --git a/sys-block/partimage/files/partimage-0.6.4-save_file_and_rest_file_actions.patch b/sys-block/partimage/files/partimage-0.6.4-save_file_and_rest_file_actions.patch
new file mode 100644
index 000000000000..0c61a85673e7
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.4-save_file_and_rest_file_actions.patch
@@ -0,0 +1,127 @@
+--- partimage-0.6.4.orig/src/client/main.cpp 2006-10-14 14:09:50.000000000 +0200
++++ partimage-0.6.4/src/client/main.cpp 2006-10-14 14:00:30.000000000 +0200
+@@ -517,6 +517,10 @@
+ else if (strcmp(argv[optind], "imginfo")==0)
+ // show informations about the imagefile
+ nChoice = OPERATION_IMGINFO;
++ else if (strcmp(argv[optind], "save_file")==0)
++ nChoice = OPERATION_SAVE_FILE;
++ else if (strcmp(argv[optind], "rest_file")==0)
++ nChoice = OPERATION_REST_FILE;
+ else if (strcmp(argv[optind], "save_all")==0)
+ nChoice = OPERATION_SAVE_ALL;
+ else if (strcmp(argv[optind], "rest_all")==0)
+@@ -690,7 +694,35 @@
+ nRes = -1;
+ }
+ break;
+-
++
++ case OPERATION_SAVE_FILE:
++ showDebug(1, "action=SAVE_FILE\n");
++ try { save_file(szImageFile, &options); }
++ catch (CExceptions *excep)
++ {
++ showDebug(1, "save_file caught exception: %d\n", excep->GetExcept());
++
++ if (options.bBatchMode) ensure_interface_is_non_interactive();
++ g_interface -> Error(excep, szImageFile, "");
++
++ nRes = -1;
++ }
++ break;
++
++ case OPERATION_REST_FILE:
++ showDebug(1, "action=REST_FILE\n");
++ try { rest_file(szImageFile, &options); }
++ catch (CExceptions *excep)
++ {
++ showDebug(1, "rest_file caught exception: %d\n", excep->GetExcept());
++
++ if (options.bBatchMode) ensure_interface_is_non_interactive();
++ g_interface -> Error(excep, szImageFile, "");
++
++ nRes = -1;
++ }
++ break;
++
+ default: // exit
+ if (options.bSync)
+ {
+--- partimage-0.6.4.orig/src/client/misc.cpp 2006-10-14 14:09:50.000000000 +0200
++++ partimage-0.6.4/src/client/misc.cpp 2006-10-14 14:04:24.000000000 +0200
+@@ -2502,3 +2502,52 @@
+
+ RETURN;
+ }
++
++void save_file(char *szImageFile, COptions *options)
++{
++ BEGIN;
++ int in_offset = 0;
++ char *in = (char *) malloc(MAXPATHLEN);
++
++ CImage image(options);
++ image.set_szImageFilename(szImageFile);
++ image.openWriting();
++
++ while (1) {
++ int len = fread(in + in_offset, 1, MAXPATHLEN, stdin);
++ showDebug(1, "read %d chars on stdin\n", len);
++ if (!len) break;
++ in = (char *) realloc(in, MAXPATHLEN + (in_offset += len));
++ }
++ showDebug(1, "writing %d chars in %s\n", in_offset, szImageFile);
++ write_unsigned(&image, in_offset);
++ image.write((void *) in, in_offset, true);
++ free(in);
++
++ closeFilesSave(false, *options, &image, NULL);
++
++ RETURN;
++}
++
++void rest_file(char *szImageFile, COptions *options)
++{
++ BEGIN;
++
++ CImage image(options);
++
++ {
++ image.set_szImageFilename(szImageFile);
++ image.openReading();
++
++ unsigned int len = read_unsigned(&image);
++ char *s = (char *) malloc(len + 1);
++ image.read(s, len, true);
++ fwrite(s, 1, len, stdout);
++ free(s);
++
++ // since sfdisk.lst is not really nice to the library, we can't close the thread from procReadBuffer$
++ image.closeReading(false);
++ }
++
++ RETURN;
++}
+--- partimage-0.6.4.orig/src/client/misc.h 2006-10-14 14:09:50.000000000 +0200
++++ partimage-0.6.4/src/client/misc.h 2006-10-14 14:00:30.000000000 +0200
+@@ -47,6 +47,8 @@
+ void savePartition(char *szDevice, char *szImageName, /*char *szFilesystem, */COptions *options);
+ void restorePartition(char *szDevice, char *szImageName, COptions *options);
+ void restoreMbr(char *szImageFile, COptions *options);
++void save_file(char *szImageFile, COptions *options);
++void rest_file(char *szImageFile, COptions *options);
+ void save_all(char *szImageDir, COptions *options);
+ void rest_all(char *szImageDir, COptions *options);
+
+--- partimage-0.6.4.orig/src/client/partimage.h 2006-10-14 14:09:50.000000000 +0200
++++ partimage-0.6.4/src/client/partimage.h 2006-10-14 14:09:18.000000000 +0200
+@@ -96,6 +96,8 @@
+ #define OPERATION_EXIT 5
+ #define OPERATION_SAVE_ALL 6
+ #define OPERATION_REST_ALL 7
++#define OPERATION_SAVE_FILE 8
++#define OPERATION_REST_FILE 9
+
+ // returned by CExceptionsGUI::windowError
+ // user canceled the job
diff --git a/sys-block/partimage/files/partimage-0.6.4-varargs.patch b/sys-block/partimage/files/partimage-0.6.4-varargs.patch
new file mode 100644
index 000000000000..3ec8bd5d534f
--- /dev/null
+++ b/sys-block/partimage/files/partimage-0.6.4-varargs.patch
@@ -0,0 +1,11 @@
+--- partimage-0.6.4/src/client/imagefile.cpp.varargs 2004-02-03 19:57:36.000000000 -0500
++++ partimage-0.6.4/src/client/imagefile.cpp 2005-08-23 08:17:08.000000000 -0400
+@@ -470,7 +470,7 @@ void CImage::splitChangeImageFileWrite()
+ if (!fork()) // we're the child // no error check maid
+ execl("/tmp/partimage-shell",
+ get_szImageFilename(), get_szPath(),
+- get_szOriginalFilename(), get_dwVolumeNumber());
++ get_szOriginalFilename(), get_dwVolumeNumber(), (char *)NULL);
+ }
+
+ // wait for a keyboard keypress if need
diff --git a/sys-block/partimage/partimage-0.6.4-r4.ebuild b/sys-block/partimage/partimage-0.6.4-r4.ebuild
index 508d6fefac6f..81ad5430a8a5 100644
--- a/sys-block/partimage/partimage-0.6.4-r4.ebuild
+++ b/sys-block/partimage/partimage-0.6.4-r4.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/partimage-0.6.4-r4.ebuild,v 1.11 2006/10/05 03:02:26 josejx Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/partimage/partimage-0.6.4-r4.ebuild,v 1.12 2006/10/14 16:01:37 xmerlin Exp $
WANT_AUTOMAKE="1.8"
@@ -61,6 +61,9 @@ src_unpack() {
epatch ${FILESDIR}/${P}-LP64-fixes.patch || die
epatch ${FILESDIR}/${P}-save_all_and_rest_all_actions.patch || die
epatch ${FILESDIR}/${P}-datadir-path.patch || die
+ epatch ${FILESDIR}/${P}-dont-discard-error-message-in-batch-mode.patch || die
+ epatch ${FILESDIR}/${P}-save_file_and_rest_file_actions.patch || die
+ epatch ${FILESDIR}/${P}-varargs.patch || die
}
src_compile() {