chiark / gitweb /
import: support downloading bzip2-encoded images
[elogind.git] / src / import / import.c
index d9cff3e239be2aa2fd3330785b9aab8148bdd36b..b3ebb353570fa09608878ff84e5859171c290037 100644 (file)
@@ -51,10 +51,12 @@ static int strip_tar_suffixes(const char *name, char **ret) {
         char *s;
 
         e = endswith(name, ".tar");
+        if (!e)
+                e = endswith(name, ".tar.xz");
         if (!e)
                 e = endswith(name, ".tar.gz");
         if (!e)
-                e = endswith(name, ".tar.xz");
+                e = endswith(name, ".tar.bz2");
         if (!e)
                 e = endswith(name, ".tgz");
         if (!e)
@@ -135,7 +137,7 @@ static int pull_tar(int argc, char *argv[], void *userdata) {
         if (r < 0)
                 return log_error_errno(r, "Failed to allocate importer: %m");
 
-        r = tar_import_pull(import, url, local, arg_force);
+        r = tar_import_pull(import, url, local, arg_force, arg_verify);
         if (r < 0)
                 return log_error_errno(r, "Failed to pull image: %m");
 
@@ -162,6 +164,7 @@ static int strip_raw_suffixes(const char *p, char **ret) {
         static const char suffixes[] =
                 ".xz\0"
                 ".gz\0"
+                ".bz2\0"
                 ".raw\0"
                 ".qcow2\0"
                 ".img\0"