[Pbuilder-maint] Bug#331554: --variant compatibility option
Junichi Uekawa
dancer at netfort.gr.jp
Sun Oct 9 12:02:19 UTC 2005
tags 331554 + patch
thanks
patch follows,
regards,
junichi
diff -ur cdebootstrap-0.3.9orig/src/frontend/standalone/cdebootstrap.man cdebootstrap-0.3.9-dif/src/frontend/standalone/cdebootstrap.man
--- cdebootstrap-0.3.9orig/src/frontend/standalone/cdebootstrap.man 2005-02-10 20:56:05.000000000 +0900
+++ cdebootstrap-0.3.9-dif/src/frontend/standalone/cdebootstrap.man 2005-10-09 20:58:00.000000000 +0900
@@ -25,6 +25,10 @@
.B FLAVOURS
below).
.TP
+\fB\-\-variant\fR=\fIVARIANT\fR
+Compatibility option against debootstrap. supports
+\fBbuildd \fR only.
+.TP
\fB\-q\fR, \fB\-\-quiet\fR
be quiet
.TP
diff -ur cdebootstrap-0.3.9orig/src/frontend/standalone/main.c cdebootstrap-0.3.9-dif/src/frontend/standalone/main.c
--- cdebootstrap-0.3.9orig/src/frontend/standalone/main.c 2005-01-06 06:48:37.000000000 +0900
+++ cdebootstrap-0.3.9-dif/src/frontend/standalone/main.c 2005-10-09 20:56:29.000000000 +0900
@@ -63,6 +63,7 @@
GETOPT_DEBUG,
GETOPT_DEVFS,
GETOPT_VERSION,
+ GETOPT_VARIANT
};
static struct option const long_opts[] =
@@ -72,6 +73,7 @@
{"debug", no_argument, 0, GETOPT_DEBUG},
{"download-only", no_argument, 0, 'd'},
{"flavour", required_argument, 0, 'f'},
+ {"variant", required_argument, 0, GETOPT_VARIANT},
{"helperdir", required_argument, 0, 'H'},
{"include", required_argument, 0, 'i'},
{"quiet", no_argument, 0, 'q'},
@@ -146,6 +148,17 @@
exit (status);
}
+char *debootstrap_compat_match_flavor(const char *matchstr)
+{
+ /* compatibility with debootstrap */
+ if (!strcmp(matchstr,"buildd"))
+ return strdup("build");
+ else if (!strcmp(matchstr,"fakechroot"))
+ return NULL;
+ else
+ return NULL;
+}
+
int frontend_main (int argc, char **argv, char **envp)
{
int c;
@@ -156,7 +169,7 @@
program_name = argv[0];
- while ((c = getopt_long (argc, argv, "a:c:df:hH:i:qv", long_opts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "a:c:df:hH:i:qvV:", long_opts, NULL)) != -1)
{
switch (c)
{
@@ -215,6 +228,13 @@
", stdout);
exit (EXIT_SUCCESS);
break;
+ case GETOPT_VARIANT:
+ if (!(flavour = debootstrap_compat_match_flavor(optarg)))
+ {
+ log_text(DI_LOG_LEVEL_ERROR, "Invalid flavour");
+ exit (EXIT_FAILURE);
+ }
+ break;
default:
usage (EXIT_FAILURE);
}
More information about the Pbuilder-maint
mailing list