Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Merge branch 'master' of etoilebsd.net:pkgng
Baptiste Daroussin committed 15 years ago
commit 4f3e6058ac8fda6e4335c4f7ebccad74f6b41e95
parent ff858bf34ddf2491def496d85b3540380fbb016e
1 file changed +14 -17
modified libpkg/pkg_create.c
@@ -179,30 +179,27 @@ static const char *
pkg_create_set_format(struct archive *pkg_archive, pkg_formats format)
{
	switch (format) {
-
		case TAR:
-
			archive_write_set_compression_none(pkg_archive);
-
			return ("tar");
-
		case TGZ:
-
			if (archive_write_set_compression_gzip(pkg_archive) != ARCHIVE_OK) {
-
				warnx("gzip compression is not supported, trying plain tar");
-
				return (pkg_create_set_format(pkg_archive, TAR));
+
		case TXZ:
+
			if (archive_write_set_compression_xz(pkg_archive) == ARCHIVE_OK) {
+
				return ("txz");
			} else {
-
				return ("tgz");
+
				warnx("xz compression is not supported, trying bzip2");
			}
		case TBZ:
-
			if (archive_write_set_compression_bzip2(pkg_archive) != ARCHIVE_OK) {
-
				warnx("bzip2 compression is not supported, trying gzip");
-
				return (pkg_create_set_format(pkg_archive, TGZ));
-
			} else {
+
			if (archive_write_set_compression_bzip2(pkg_archive) == ARCHIVE_OK) {
				return ("tbz");
+
			} else {
+
				warnx("bzip2 compression is not supported, trying gzip");
			}
-
		case TXZ:
-
			if (archive_write_set_compression_xz(pkg_archive) != ARCHIVE_OK) {
-
				warnx("xz compression is not supported, trying bzip2");
-
				return (pkg_create_set_format(pkg_archive, TBZ));
+
		case TGZ:
+
			if (archive_write_set_compression_gzip(pkg_archive) == ARCHIVE_OK) {
+
				return ("tgz");
			} else {
-
				return ("txz");
+
				warnx("gzip compression is not supported, trying plain tar");
			}
+
		case TAR:
+
			archive_write_set_compression_none(pkg_archive);
+
			return ("tar");
	}
	return (NULL);
}