summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2014-05-12 03:51:01 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2014-05-12 03:51:01 +0000
commit96a3138793a72c655eb3831166b14eaad6a55acd (patch)
treeef61b9bc9598ab7a9e0d59d0a1caf8129f940c0c /app-arch
parentadd pypy support (diff)
downloadgentoo-2-96a3138793a72c655eb3831166b14eaad6a55acd.tar.gz
gentoo-2-96a3138793a72c655eb3831166b14eaad6a55acd.tar.bz2
gentoo-2-96a3138793a72c655eb3831166b14eaad6a55acd.zip
Import ArchLinux patchset, including fixes for RPMs, archives with spaces, segfaults with password protected archives, more mime types, and rar5 files with white spaces.
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
Diffstat (limited to 'app-arch')
-rw-r--r--app-arch/xarchiver/files/xarchiver-0.5.3-add-mime-types.patch17
-rw-r--r--app-arch/xarchiver/files/xarchiver-0.5.3-fix-double-escaping.patch32
-rw-r--r--app-arch/xarchiver/files/xarchiver-0.5.3-fix-password-protected.patch42
-rw-r--r--app-arch/xarchiver/files/xarchiver-0.5.3-fix-rpm-support.patch86
-rw-r--r--app-arch/xarchiver/files/xarchiver-0.5.3-rar5-whitespace.patch44
-rw-r--r--app-arch/xarchiver/xarchiver-0.5.3-r1.ebuild58
6 files changed, 279 insertions, 0 deletions
diff --git a/app-arch/xarchiver/files/xarchiver-0.5.3-add-mime-types.patch b/app-arch/xarchiver/files/xarchiver-0.5.3-add-mime-types.patch
new file mode 100644
index 000000000000..ec427b99aeee
--- /dev/null
+++ b/app-arch/xarchiver/files/xarchiver-0.5.3-add-mime-types.patch
@@ -0,0 +1,17 @@
+diff -Naur xarchiver-0.5.3.orig/xarchiver.desktop.in xarchiver-0.5.3/xarchiver.desktop.in
+--- xarchiver-0.5.3.orig/xarchiver.desktop.in 2014-05-12 01:08:12.159131913 +0000
++++ xarchiver-0.5.3/xarchiver.desktop.in 2014-05-12 01:09:02.585526393 +0000
+@@ -4,11 +4,11 @@
+ _Name=Xarchiver
+ _Comment=A GTK+2 only archive manager
+ _GenericName=Archive manager
+-Exec=xarchiver
++Exec=xarchiver %f
+ Icon=xarchiver
+ Terminal=false
+ Type=Application
+ X-MultipleArgs=false
+ Categories=GTK;Archiving;Utility;
+ StartupNotify=true
+-MimeType=application/x-arj;application/arj;application/x-bzip;application/x-bzip-compressed-tar;application/x-gzip;application/x-rar;application/x-rar-compressed;application/x-tar;application/x-zip;application/x-zip-compressed;application/zip;multipart/x-zip;application/x-7z-compressed;application/x-compressed-tar;application/x-bzip2;application/x-bzip2-compressed-tar;
++MimeType=application/x-arj;application/arj;application/x-bzip;application/x-bzip-compressed-tar;application/x-gzip;application/x-rar;application/x-rar-compressed;application/x-tar;application/x-zip;application/x-zip-compressed;application/zip;application/x-7z-compressed;application/x-compressed-tar;application/x-bzip2;application/x-bzip2-compressed-tar;application/x-lzma;application/x-lzma-compressed-tar;application/x-lzop;application/x-lzop-compressed-tar;application/x-xz;application/x-xz-compressed-tar;application/x-deb;application/x-rpm;
diff --git a/app-arch/xarchiver/files/xarchiver-0.5.3-fix-double-escaping.patch b/app-arch/xarchiver/files/xarchiver-0.5.3-fix-double-escaping.patch
new file mode 100644
index 000000000000..8b44d91a0e58
--- /dev/null
+++ b/app-arch/xarchiver/files/xarchiver-0.5.3-fix-double-escaping.patch
@@ -0,0 +1,32 @@
+From: =?UTF-8?q?Guido=20Berh=C3=B6rster?= <gber@opensuse.org>
+Date: Sat, 19 Jan 2013 09:27:36 +0100
+Subject: fix-double-escaping
+
+Do not escape file names twice. Fixes an error when trying to create archives
+with spaces.
+
+Bug: http://bugs.debian.org/697493.
+---
+ src/main.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/main.c b/src/main.c
+index a13d737..a6a7f93 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -208,13 +208,13 @@ int main (int argc, char **argv)
+ g_free(_current_dir);
+ GSList *files = NULL;
+ _current_dir = g_path_get_basename(add_files);
+- files = g_slist_append(files,xa_escape_filename(_current_dir,"$'`\"\\!?* ()[]&|:;<>#"));
++ files = g_slist_append(files,g_strdup(_current_dir));
+ g_free(_current_dir);
+ g_free(add_files);
+ for (x = 1; x< argc; x++)
+ {
+ _current_dir = g_path_get_basename(argv[x]);
+- files = g_slist_append(files,xa_escape_filename(_current_dir,"$'`\"\\!?* ()[]&|:;<>#"));
++ files = g_slist_append(files,g_strdup(_current_dir));
+ g_free (_current_dir);
+ }
+ xa_execute_add_commands(archive,files,NULL);
diff --git a/app-arch/xarchiver/files/xarchiver-0.5.3-fix-password-protected.patch b/app-arch/xarchiver/files/xarchiver-0.5.3-fix-password-protected.patch
new file mode 100644
index 000000000000..00969349db01
--- /dev/null
+++ b/app-arch/xarchiver/files/xarchiver-0.5.3-fix-password-protected.patch
@@ -0,0 +1,42 @@
+diff -Naur xarchiver-0.5.3.orig/src/window.c xarchiver-0.5.2/src/window.c
+--- xarchiver-0.5.3.orig/src/window.c 2014-01-24 08:10:09.305990000 +0100
++++ xarchiver-0.5.3/src/window.c 2014-01-24 08:42:45.110729290 +0100
+@@ -1694,7 +1694,7 @@
+ {
+ if (archive->passwd == NULL)
+ {
+- archive->passwd = xa_create_password_dialog(NULL);
++ archive->passwd = xa_create_password_dialog(archive);
+ if ( archive->passwd == NULL)
+ {
+ gtk_drag_finish (dc,FALSE,FALSE,t);
+@@ -2702,9 +2702,12 @@
+
+ if (entry->is_encrypted)
+ {
+- archive[idx]->passwd = xa_create_password_dialog(archive[idx]);
+ if (archive[idx]->passwd == NULL)
+- return;
++ {
++ archive[idx]->passwd = xa_create_password_dialog(archive[idx]);
++ if (archive[idx]->passwd == NULL)
++ return;
++ }
+ }
+ filename = g_strconcat(archive[idx]->tmp,"/",entry->filename,NULL);
+ if (g_file_test(filename,G_FILE_TEST_EXISTS))
+@@ -2768,8 +2771,12 @@
+ {
+ if (entry->is_encrypted)
+ {
+- if (archive->passwd == NULL)
+- return;
++ if (archive->passwd == NULL)
++ {
++ archive->passwd = xa_create_password_dialog(archive);
++ if (archive->passwd == NULL)
++ return;
++ }
+ }
+ if (archive->extraction_path)
+ {
diff --git a/app-arch/xarchiver/files/xarchiver-0.5.3-fix-rpm-support.patch b/app-arch/xarchiver/files/xarchiver-0.5.3-fix-rpm-support.patch
new file mode 100644
index 000000000000..cf17ff7385cb
--- /dev/null
+++ b/app-arch/xarchiver/files/xarchiver-0.5.3-fix-rpm-support.patch
@@ -0,0 +1,86 @@
+diff -Naur xarchiver-0.5.3.orig/src/rpm.c xarchiver-0.5.3/src/rpm.c
+--- xarchiver-0.5.3.orig/src/rpm.c 2014-02-09 16:26:24.000000000 +0100
++++ xarchiver-0.5.3/src/rpm.c 2014-02-19 07:54:27.744136749 +0100
+@@ -23,8 +23,11 @@
+
+ void xa_open_rpm (XArchive *archive)
+ {
++ unsigned char bytes[8];
+ unsigned short int i;
+- int response;
++ int dl,il,sigsize,offset,response;
++ gchar *ibs,*executable;
++ gchar *gzip_tmp = NULL;
+ GSList *list = NULL;
+ FILE *stream;
+ gboolean result;
+@@ -53,14 +56,68 @@
+ archive->column_types[i] = types[i];
+
+ xa_create_liststore (archive,names);
++ if (fseek ( stream, 104 , SEEK_CUR ) )
++ {
++ fclose (stream);
++ response = xa_show_message_dialog (GTK_WINDOW (xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Can't fseek to position 104:"),g_strerror(errno));
++ return;
++ }
++ if ( fread ( bytes, 1, 8, stream ) == 0 )
++ {
++ fclose ( stream );
++ response = xa_show_message_dialog (GTK_WINDOW (xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Can't read data from file:"),g_strerror(errno));
++ return;
++ }
++ il = 256 * ( 256 * ( 256 * bytes[0] + bytes[1]) + bytes[2] ) + bytes[3];
++ dl = 256 * ( 256 * ( 256 * bytes[4] + bytes[5]) + bytes[6] ) + bytes[7];
++ sigsize = 8 + 16 * il + dl;
++ offset = 104 + sigsize + ( 8 - ( sigsize % 8 ) ) % 8 + 8;
++ if (fseek ( stream, offset , SEEK_SET ) )
++ {
++ fclose (stream);
++ response = xa_show_message_dialog (GTK_WINDOW (xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Can't fseek in file:"),g_strerror(errno));
++ return;
++ }
++ if ( fread ( bytes, 1, 8, stream ) == 0 )
++ {
++ fclose ( stream );
++ response = xa_show_message_dialog (GTK_WINDOW (xa_main_window),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Can't read data from file:"),g_strerror(errno));
++ return;
++ }
++ il = 256 * ( 256 * ( 256 * bytes[0] + bytes[1]) + bytes[2] ) + bytes[3];
++ dl = 256 * ( 256 * ( 256 * bytes[4] + bytes[5]) + bytes[6] ) + bytes[7];
++ sigsize = 8 + 16 * il + dl;
++ offset = offset + sigsize;
++ fclose (stream);
+
+ /* Create a unique temp dir in /tmp */
+ result = xa_create_temp_directory (archive);
+ if (!result)
+ return;
+
++ gzip_tmp = g_strconcat (archive->tmp,"/file.gz_bz",NULL);
++ ibs = g_strdup_printf ( "%u" , offset );
++
+ /* Now I run dd to have the bzip2 / gzip compressed cpio archive in /tmp */
+- gchar *command = g_strconcat ( "sh -c \"rpm2cpio ",archive->escaped_path," > ",archive->tmp, "/file.cpio\"",NULL);
++ gchar *command = g_strconcat ( "dd if=",archive->escaped_path," ibs=",ibs," skip=1 of=",gzip_tmp,NULL);
++ g_free (ibs);
++ list = g_slist_append(list,command);
++ batch_mode = TRUE;
++ result = xa_run_command (archive,list);
++ if (result == FALSE)
++ {
++ g_free (gzip_tmp);
++ return;
++ }
++ if (xa_detect_archive_type (gzip_tmp) == XARCHIVETYPE_GZIP)
++ executable = "gzip -dc ";
++ else if (xa_detect_archive_type (gzip_tmp) == XARCHIVETYPE_BZIP2)
++ executable = "bzip2 -dc ";
++ else
++ executable = "xz -dc ";
++
++ command = g_strconcat("sh -c \"",executable,gzip_tmp," > ",archive->tmp,"/file.cpio\"",NULL);
++ g_free(gzip_tmp);
+ list = NULL;
+ list = g_slist_append(list,command);
+ result = xa_run_command (archive,list);
diff --git a/app-arch/xarchiver/files/xarchiver-0.5.3-rar5-whitespace.patch b/app-arch/xarchiver/files/xarchiver-0.5.3-rar5-whitespace.patch
new file mode 100644
index 000000000000..0d317e41e9de
--- /dev/null
+++ b/app-arch/xarchiver/files/xarchiver-0.5.3-rar5-whitespace.patch
@@ -0,0 +1,44 @@
+--- xarchiver-0.5.3.orig/src/rar.c
++++ xarchiver-0.5.3/src/rar.c
+@@ -345,7 +345,7 @@
+ unsigned short int i = 0;
+ unsigned int linesize,n,a;
+ gboolean dir = FALSE;
+- static gchar *filename;
++ static gchar *filename, *end;
+
+ if (last_line)
+ return;
+@@ -388,7 +388,6 @@
+ last_line = TRUE;
+ return;
+ }
+-
+ archive->nr_of_files++;
+
+ /* Permissions */
+@@ -453,15 +452,15 @@
+ for(; n < linesize && line[n] != ' '; n++);
+ line[n] = '\0';
+ item[i] = line + a;
+- i++;
+- n++;
+-
+- /* fileName */
+- for(n=64; n < linesize && line[n] == ' '; n++);
+- a = n;
+- for(; n < linesize && line[n] != ' ' && line[n] != '\n'; n++);
+- line[n]='\0';
+- filename = g_strdup(line + a);
++
++ /* FileName */
++ line[linesize - 1] = '\0';
++ filename = g_strdup(line+64);
++
++ /* Strip trailing whitespace */
++ end = filename + strlen(filename) - 1;
++ while(end >= filename && *end == ' ') end--;
++ *(end + 1) = '\0';
+
+ /* Work around for rar which doesn't
+ * output / with directories */
diff --git a/app-arch/xarchiver/xarchiver-0.5.3-r1.ebuild b/app-arch/xarchiver/xarchiver-0.5.3-r1.ebuild
new file mode 100644
index 000000000000..43a84d4b396e
--- /dev/null
+++ b/app-arch/xarchiver/xarchiver-0.5.3-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/xarchiver/xarchiver-0.5.3-r1.ebuild,v 1.1 2014/05/12 03:51:01 ssuominen Exp $
+
+EAPI=5
+inherit xfconf
+
+DESCRIPTION="a GTK+ based and advanced archive manager that can be used with Thunar"
+HOMEPAGE="http://xarchiver.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux"
+IUSE="debug"
+
+RDEPEND=">=dev-libs/glib-2
+ >=x11-libs/gtk+-2.24:2"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+pkg_setup() {
+ PATCHES=(
+ "${FILESDIR}"/${P}-add-mime-types.patch
+ "${FILESDIR}"/${P}-fix-password-protected.patch
+ "${FILESDIR}"/${P}-rar5-whitespace.patch
+ "${FILESDIR}"/${P}-fix-double-escaping.patch
+ "${FILESDIR}"/${P}-fix-rpm-support.patch
+ )
+
+ XFCONF=(
+ $(xfconf_use_debug)
+ )
+
+ DOCS=( AUTHORS ChangeLog README TODO )
+}
+
+src_prepare() {
+ sed -e '/COPYING/d' -e '/NEWS/d' -i doc/Makefile.in || die
+ xfconf_src_prepare
+}
+
+src_install() {
+ xfconf_src_install DOCDIR="${ED}/usr/share/doc/${PF}"
+}
+
+pkg_postinst() {
+ xfconf_pkg_postinst
+ elog "You need external programs for some formats, including:"
+ elog "7zip - app-arch/p7zip"
+ elog "arj - app-arch/unarj app-arch/arj"
+ elog "lha - app-arch/lha"
+ elog "lzop - app-arch/lzop"
+ elog "rar - app-arch/unrar app-arch/rar"
+ elog "zip - app-arch/unzip app-arch/zip"
+}