1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-04 06:15:24 +00:00

- Replace '--touch' option with '-m'

- Fix '--use-compress-program' usage with bsdtar where needed
- Improve LZMA detection
- Add missing dependency to zipinfo (required to view contents of ZIP archives)
- Add ARJ and LZO options
- Sort USES
while here
- Add RAR option

PR:		203103
Submitted by:	Andriy Voskoboinyk <s3erios@gmail.com>
MFH:		2015Q3
This commit is contained in:
Danilo Egea Gondolfo 2015-09-17 00:12:19 +00:00
parent f0a68f6868
commit b3ee19566e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=397093
4 changed files with 167 additions and 2 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= xarchiver
PORTVERSION= 0.5.4
PORTREVISION= 1
CATEGORIES= archivers
MASTER_SITES= SF/${PORTNAME:tl}
@ -13,16 +14,29 @@ LICENSE= GPLv2
RUN_DEPENDS= xdg-open:${PORTSDIR}/devel/xdg-utils \
7zr:${PORTSDIR}/archivers/p7zip \
zip:${PORTSDIR}/archivers/zip
zip:${PORTSDIR}/archivers/zip \
zipinfo:${PORTSDIR}/archivers/unzip
USES= tar:bzip2 gmake pkgconfig desktop-file-utils
USES= desktop-file-utils gmake pkgconfig tar:bzip2
USE_GNOME= glib20 gtk20 intltool
GNU_CONFIGURE= yes
INSTALLS_ICONS= yes
OPTIONS_DEFINE= DOCS NLS
OPTIONS_GROUP= FORMATS
OPTIONS_GROUP_FORMATS= ARJ LZO RAR
OPTIONS_SUB= yes
FORMATS_DESC= Additional compression formats support
ARJ_DESC= ARJ compression support
LZO_DESC= LZO compression support
RAR_DESC= RAR compression support
ARJ_RUN_DEPENDS= arj:${PORTSDIR}/archivers/arj
LZO_RUN_DEPENDS= lzop:${PORTSDIR}/archivers/lzop
RAR_RUN_DEPENDS= unrar:${PORTSDIR}/archivers/unrar \
rar:${PORTSDIR}/archivers/rar
NLS_USES= gettext
NLS_CPPFLAGS+= -I${LOCALBASE}/include
NLS_LDFLAGS+= -L${LOCALBASE}/lib

View File

@ -0,0 +1,17 @@
--- src/bzip2.c.orig 2014-02-09 15:26:24 UTC
+++ src/bzip2.c
@@ -171,11 +171,11 @@ void xa_open_tar_compressed_file(XArchiv
if (archive->type == XARCHIVETYPE_TAR_BZ2)
command = g_strconcat(tar," tfjv ",archive->escaped_path,NULL);
else if (archive->type == XARCHIVETYPE_TAR_LZMA)
- command = g_strconcat(tar," tv --use-compress-program=lzma -f ",archive->escaped_path,NULL);
+ command = g_strconcat(tar," tv --use-compress-program='lzma -d' -f ",archive->escaped_path,NULL);
else if (archive->type == XARCHIVETYPE_TAR_XZ)
- command = g_strconcat(tar," tv --use-compress-program=xz -f ",archive->escaped_path,NULL);
+ command = g_strconcat(tar," tv --use-compress-program='xz -d' -f ",archive->escaped_path,NULL);
else if (archive->type == XARCHIVETYPE_TAR_LZOP)
- command = g_strconcat(tar," tv --use-compress-program=lzop -f ",archive->escaped_path,NULL);
+ command = g_strconcat(tar," tv --use-compress-program='lzop -d' -f ",archive->escaped_path,NULL);
/* else fail? */
archive->has_properties = archive->can_add = archive->can_extract = archive->has_test = TRUE;

View File

@ -0,0 +1,123 @@
--- src/tar.c.orig 2014-09-28 20:10:38 UTC
+++ src/tar.c
@@ -331,7 +331,7 @@ gboolean xa_tar_extract(XArchive *archiv
#else
archive->overwrite ? " --overwrite" : " --keep-old-files",
#endif
- archive->tar_touch ? " --touch" : "",
+ archive->tar_touch ? " -m" : "",
" -C ",archive->extraction_path," ",names->str,NULL);
}
else
@@ -350,7 +350,7 @@ gboolean xa_tar_extract(XArchive *archiv
#else
archive->overwrite ? " --overwrite" : " --keep-old-files",
#endif
- archive->tar_touch ? " --touch" : "",
+ archive->tar_touch ? " -m" : "",
" -C ",archive->extraction_path," ",names->str,NULL);
}
else
@@ -369,7 +369,7 @@ gboolean xa_tar_extract(XArchive *archiv
#else
archive->overwrite ? " --overwrite" : " --keep-old-files",
#endif
- archive->tar_touch ? " --touch" : "",
+ archive->tar_touch ? " -m" : "",
" -C ",archive->extraction_path," ",names->str,NULL);
}
else
@@ -382,18 +382,18 @@ gboolean xa_tar_extract(XArchive *archiv
case XARCHIVETYPE_TAR_LZMA:
if (archive->full_path || multi_extract)
{
- command = g_strconcat (tar, " --use-compress-program=lzma -xvf " , archive->escaped_path,
+ command = g_strconcat (tar, " --use-compress-program='lzma -d' -xvf " , archive->escaped_path,
#ifdef __FreeBSD__
archive->overwrite ? " " : " -k",
#else
archive->overwrite ? " --overwrite" : " --keep-old-files",
#endif
- archive->tar_touch ? " --touch" : "",
+ archive->tar_touch ? " -m" : "",
" -C ",archive->extraction_path," ",names->str,NULL);
}
else
{
- result = xa_extract_tar_without_directories ( "tar --use-compress-program=lzma -xvf ",archive,names->str);
+ result = xa_extract_tar_without_directories ( "tar --use-compress-program='lzma -d' -xvf ",archive,names->str);
command = NULL;
}
break;
@@ -401,18 +401,18 @@ gboolean xa_tar_extract(XArchive *archiv
case XARCHIVETYPE_TAR_LZOP:
if (archive->full_path || multi_extract)
{
- command = g_strconcat (tar, " --use-compress-program=lzop -xvf " , archive->escaped_path,
+ command = g_strconcat (tar, " --use-compress-program='lzop -d' -xvf " , archive->escaped_path,
#ifdef __FreeBSD__
archive->overwrite ? " " : " -k",
#else
archive->overwrite ? " --overwrite" : " --keep-old-files",
#endif
- archive->tar_touch ? " --touch" : "",
+ archive->tar_touch ? " -m" : "",
" -C ",archive->extraction_path," ",names->str,NULL);
}
else
{
- result = xa_extract_tar_without_directories ( "tar --use-compress-program=lzop -xvf ",archive,names->str);
+ result = xa_extract_tar_without_directories ( "tar --use-compress-program='lzop -d' -xvf ",archive,names->str);
command = NULL;
}
break;
@@ -420,18 +420,18 @@ gboolean xa_tar_extract(XArchive *archiv
case XARCHIVETYPE_TAR_XZ:
if (archive->full_path || multi_extract)
{
- command = g_strconcat (tar, " --use-compress-program=xz -xvf " , archive->escaped_path,
+ command = g_strconcat (tar, " --use-compress-program='xz -d' -xvf " , archive->escaped_path,
#ifdef __FreeBSD__
archive->overwrite ? " " : " -k",
#else
archive->overwrite ? " --overwrite" : " --keep-old-files",
#endif
- archive->tar_touch ? " --touch" : "",
+ archive->tar_touch ? " -m" : "",
" -C ",archive->extraction_path," ",names->str,NULL);
}
else
{
- result = xa_extract_tar_without_directories ( "tar --use-compress-program=xz -xvf ",archive,names->str);
+ result = xa_extract_tar_without_directories ( "tar --use-compress-program='xz -d' -xvf ",archive,names->str);
command = NULL;
}
break;
@@ -567,7 +567,7 @@ gboolean xa_extract_tar_without_director
archive->overwrite ? " --overwrite" : " --keep-old-files",
" --no-wildcards ",
#endif
- archive->tar_touch ? " --touch" : "",
+ archive->tar_touch ? " -m" : "",
"-C ",archive->tmp," ",files_to_extract,NULL);
list = g_slist_append(list,command);
if (strstr(files_to_extract,"/") || strcmp(archive->tmp,archive->extraction_path) != 0)
@@ -618,15 +618,15 @@ void xa_tar_test(XArchive *archive)
break;
case XARCHIVETYPE_TAR_LZMA:
- command = g_strconcat (tar, " --use-compress-program=lzma -tvf ",archive->path, NULL);
+ command = g_strconcat (tar, " --use-compress-program='lzma -d' -tvf ",archive->path, NULL);
break;
case XARCHIVETYPE_TAR_LZOP:
- command = g_strconcat (tar, " --use-compress-program=lzop -tvf ",archive->path, NULL);
+ command = g_strconcat (tar, " --use-compress-program='lzop -d' -tvf ",archive->path, NULL);
break;
case XARCHIVETYPE_TAR_XZ:
- command = g_strconcat (tar, " --use-compress-program=xz -tvf ",archive->path, NULL);
+ command = g_strconcat (tar, " --use-compress-program='xz -d' -tvf ",archive->path, NULL);
break;
case XARCHIVETYPE_LZMA:

View File

@ -0,0 +1,11 @@
--- src/window.c.orig 2014-09-28 20:42:37 UTC
+++ src/window.c
@@ -1130,7 +1130,7 @@ XArchiveType xa_detect_archive_type (gch
xx = XARCHIVETYPE_BZIP2;
else if (memcmp ( magic,"\x1f\x8b",2) == 0 || memcmp ( magic,"\x1f\x9d",2) == 0)
xx = XARCHIVETYPE_GZIP;
- else if (memcmp ( magic,"\x5d\x00\x00\x80",4) == 0)
+ else if (memcmp ( magic,"\x5d\x00\x00",3) == 0)
xx = XARCHIVETYPE_LZMA;
else if (memcmp ( magic,"\xfd\x37\x7a\x58\x5a",5) == 0)
xx = XARCHIVETYPE_XZ;