File: archdetect.c

package info (click to toggle)
ddetect 1.14
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 736 kB
  • ctags: 112
  • sloc: sh: 872; ansic: 533; makefile: 93
file content (24 lines) | stat: -rw-r--r-- 553 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <cdebconf/debconfclient.h>

#include "archdetect.h"

int main(int argc, char *argv[])
{
        const char *subarch;

	if (!(subarch = subarch_analyze()))
 		return EXIT_FAILURE;

	if (strstr(argv[0], "postinst") || (argc > 1 && strcmp(argv[1], "postinst") == 0)) {
                struct debconfclient *debconf;
		debconf = debconfclient_new();
		debconf_set(debconf, "debian-installer/kernel/subarchitecture", subarch);
	} else
		printf("%s/%s\n", CPU_TEXT, subarch);

	return 0;
}