~vcs-imports/busybox/trunk

« back to all changes in this revision

Viewing changes to scripts/kconfig/confdata.c

  • Committer: Denys Vlasenko
  • Author(s): Christian Franke
  • Date: 2023-11-13 10:32:35 UTC
  • Revision ID: git-v1:a63b60bdd6fa26b867c80d44074118babbae7ffd
Cygwin: regenerate defconfig

Signed-off-by: Christian Franke <christian.franke@t-online.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
                strncat(res_value, in, src - in);
55
55
                src++;
56
56
                dst = name;
57
 
                while (isalnum(*src) || *src == '_')
 
57
                while (isalnum((unsigned char)*src) || *src == '_')
58
58
                        *dst++ = *src++;
59
59
                *dst = 0;
60
60
                sym = sym_lookup(name, 0);
342
342
        time_t now;
343
343
        int use_timestamp = 1;
344
344
        char *env;
 
345
        char *source_date_epoch;
 
346
        struct tm *build_time;
345
347
 
346
348
        dirname[0] = 0;
347
349
        if (name && name[0]) {
378
380
        }
379
381
        sym = sym_lookup("KERNELVERSION", 0);
380
382
        sym_calc_value(sym);
381
 
        time(&now);
 
383
 
 
384
        source_date_epoch = getenv("SOURCE_DATE_EPOCH");
 
385
        if (source_date_epoch && *source_date_epoch) {
 
386
                now = strtoull(source_date_epoch, NULL, 10);
 
387
                build_time = gmtime(&now);
 
388
        } else {
 
389
                time(&now);
 
390
                build_time = localtime(&now);
 
391
        }
 
392
 
382
393
        env = getenv("KCONFIG_NOTIMESTAMP");
383
394
        if (env && *env)
384
395
                use_timestamp = 0;
398
409
                if (use_timestamp) {
399
410
                        size_t ret = \
400
411
                                strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP "
401
 
                                        "\"%Y-%m-%d %H:%M:%S %Z\"\n", localtime(&now));
 
412
                                        "\"%Y-%m-%d %H:%M:%S %Z\"\n", build_time);
402
413
                        /* if user has Factory timezone or some other odd install, the
403
414
                         * %Z above will overflow the string leaving us with undefined
404
415
                         * results ... so let's try again without the timezone.
405
416
                         */
406
417
                        if (ret == 0)
407
418
                                strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP "
408
 
                                        "\"%Y-%m-%d %H:%M:%S\"\n", localtime(&now));
 
419
                                        "\"%Y-%m-%d %H:%M:%S\"\n", build_time);
409
420
                } else { /* bbox */
410
421
                        strcpy(buf, "#define AUTOCONF_TIMESTAMP \"\"\n");
411
422
                }