* [gentoo-commits] gentoo-projects commit in portage-utils: qtbz2.c
@ 2010-06-08 5:31 Mike Frysinger (vapier)
0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger (vapier) @ 2010-06-08 5:31 UTC (permalink / raw
To: gentoo-commits
vapier 10/06/08 05:31:09
Modified: qtbz2.c
Log:
if we cant open files for writting, then abort with a message as pointed out by Steve L #248067
Revision Changes Path
1.16 portage-utils/qtbz2.c
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qtbz2.c?rev=1.16&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qtbz2.c?rev=1.16&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qtbz2.c?r1=1.15&r2=1.16
Index: qtbz2.c
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- qtbz2.c 7 Apr 2010 05:58:16 -0000 1.15
+++ qtbz2.c 8 Jun 2010 05:31:09 -0000 1.16
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2010 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v 1.15 2010/04/07 05:58:16 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v 1.16 2010/06/08 05:31:09 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -44,7 +44,7 @@
"Write files to stdout",
COMMON_OPTS_HELP
};
-static const char qtbz2_rcsid[] = "$Id: qtbz2.c,v 1.15 2010/04/07 05:58:16 solar Exp $";
+static const char qtbz2_rcsid[] = "$Id: qtbz2.c,v 1.16 2010/06/08 05:31:09 vapier Exp $";
#define qtbz2_usage(ret) usage(ret, QTBZ2_FLAGS, qtbz2_long_opts, qtbz2_opts_help, lookup_applet_idx("qtbz2"))
static char tbz2_stdout = 0;
@@ -138,7 +138,7 @@
if (tbz2_stdout)
out = stdout;
else if ((out = fopen(dst, "w")) == NULL)
- return;
+ errp("cannot write to '%s'", dst);
do {
this_write = fread(buffer, 1, _TBZ2_MIN(len, sizeof(buffer)), src);
^ permalink raw reply [flat|nested] 3+ messages in thread
* [gentoo-commits] gentoo-projects commit in portage-utils: qtbz2.c
@ 2012-11-17 18:25 Mike Frysinger (vapier)
0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger (vapier) @ 2012-11-17 18:25 UTC (permalink / raw
To: gentoo-commits
vapier 12/11/17 18:25:22
Modified: qtbz2.c
Log:
qtbz2: make -j doc more clear, as well as the error message when it fails
Revision Changes Path
1.20 portage-utils/qtbz2.c
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qtbz2.c?rev=1.20&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qtbz2.c?rev=1.20&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qtbz2.c?r1=1.19&r2=1.20
Index: qtbz2.c
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- qtbz2.c 2 Oct 2011 21:52:29 -0000 1.19
+++ qtbz2.c 17 Nov 2012 18:25:22 -0000 1.20
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2010 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v 1.19 2011/10/02 21:52:29 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v 1.20 2012/11/17 18:25:22 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -39,14 +39,14 @@
};
static const char * const qtbz2_opts_help[] = {
"Change to specified directory",
- "Join tar.bz2 + xpak into a tbz2",
+ "Join: <tar.bz2> <xpak> <tbz2>",
"Split a tbz2 into a tar.bz2 + xpak",
"Just split the tar.bz2",
"Just split the xpak",
"Write files to stdout",
COMMON_OPTS_HELP
};
-static const char qtbz2_rcsid[] = "$Id: qtbz2.c,v 1.19 2011/10/02 21:52:29 vapier Exp $";
+static const char qtbz2_rcsid[] = "$Id: qtbz2.c,v 1.20 2012/11/17 18:25:22 vapier Exp $";
#define qtbz2_usage(ret) usage(ret, QTBZ2_FLAGS, qtbz2_long_opts, qtbz2_opts_help, lookup_applet_idx("qtbz2"))
static char tbz2_stdout = 0;
@@ -313,7 +313,8 @@
}
if (tbz2_compose(dir_fd, tarbz2, xpak, tbz2))
- warn("Could not compose '%s' and '%s'", tarbz2, xpak);
+ warnp("Could not create '%s' from '%s' and '%s'",
+ tbz2, tarbz2, xpak);
/* tbz2tool split .tbz2 .tar.bz2 .xpak */
} else {
^ permalink raw reply [flat|nested] 3+ messages in thread
* [gentoo-commits] gentoo-projects commit in portage-utils: qtbz2.c
@ 2012-11-17 18:44 Mike Frysinger (vapier)
0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger (vapier) @ 2012-11-17 18:44 UTC (permalink / raw
To: gentoo-commits
vapier 12/11/17 18:44:59
Modified: qtbz2.c
Log:
qtbz2: add magic checks to catch accidental argument swapping
Revision Changes Path
1.21 portage-utils/qtbz2.c
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qtbz2.c?rev=1.21&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qtbz2.c?rev=1.21&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/qtbz2.c?r1=1.20&r2=1.21
Index: qtbz2.c
===================================================================
RCS file: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- qtbz2.c 17 Nov 2012 18:25:22 -0000 1.20
+++ qtbz2.c 17 Nov 2012 18:44:58 -0000 1.21
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2010 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v 1.20 2012/11/17 18:25:22 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v 1.21 2012/11/17 18:44:58 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -46,7 +46,7 @@
"Write files to stdout",
COMMON_OPTS_HELP
};
-static const char qtbz2_rcsid[] = "$Id: qtbz2.c,v 1.20 2012/11/17 18:25:22 vapier Exp $";
+static const char qtbz2_rcsid[] = "$Id: qtbz2.c,v 1.21 2012/11/17 18:44:58 vapier Exp $";
#define qtbz2_usage(ret) usage(ret, QTBZ2_FLAGS, qtbz2_long_opts, qtbz2_opts_help, lookup_applet_idx("qtbz2"))
static char tbz2_stdout = 0;
@@ -91,6 +91,7 @@
FILE *out, *in_tarbz2, *in_xpak;
struct stat st;
int ret = 1, fd;
+ char buf[8];
if (verbose)
printf("input xpak: %s\ninput tar.bz2: %s\noutput tbz2: %s\n",
@@ -105,6 +106,8 @@
fclose(out);
return ret;
}
+ if (pread(fd, buf, 3, 0) != 3 || memcmp(buf, "BZh", 3))
+ warn("%s: does not appear to be a .tar.bz2", tarbz2);
in_tarbz2 = fdopen(fd, "r");
if (in_tarbz2 == NULL) {
fclose(out);
@@ -118,6 +121,8 @@
fclose(in_tarbz2);
return ret;
}
+ if (pread(fd, buf, 8, 0) != 8 || memcmp(buf, "XPAKPACK", 8))
+ warn("%s: does not appear to be a .xpak", xpak);
in_xpak = fdopen(fd, "r");
if (in_xpak == NULL) {
fclose(out);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-11-17 18:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-08 5:31 [gentoo-commits] gentoo-projects commit in portage-utils: qtbz2.c Mike Frysinger (vapier)
-- strict thread matches above, loose matches on Subject: below --
2012-11-17 18:25 Mike Frysinger (vapier)
2012-11-17 18:44 Mike Frysinger (vapier)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox