Commit graph

15 commits

Author SHA1 Message Date
Leah Neukirchen 6089ec47be setup/git.sh: fix finding gitdir 2021-09-28 22:03:26 +02:00
Đoàn Trần Công Danh 4b239f5560 setup/git.sh: parser GIT_COMMITTER_DATE with plumbing command
To avoid:
- Commit's signature
- Future change in git log format
- Revision Walk

Close #33165
2021-09-28 22:16:04 +07:00
Piotr Wójcik 4ac333c3b1 xbps-src: allow to run without git
This makes possible to binary-bootstrap and build packages
with only base-system using tarball of void-packages.
2021-02-23 18:34:37 +01:00
Đoàn Trần Công Danh 2af30cdd78 setup: compute gitrev from outside of chroot
Together with previous commit, `xbps-src` is able to support
git-worktree and shared repository by now.
2020-05-23 06:59:24 +00:00
Đoàn Trần Công Danh 2cd2b99e41 setup: export SOURCE_DATE_EPOCH from outside of chroot
git-worktree(1), and Git shared repository can use a plain text file
named `.git` at the root of working tree, containing `gitdir: <path>` to
point to the real directory that has repository.
See: gitrepository-layout(5).

But, that directory is usually inaccessible inside chroot.

In order to support git-worktree(1) and Git shared repository, compute
SOURCE_DATE_EPOCH from outside of chroot, and the chroot will carry it
over to inside chroot.

I've only tested again xbps-uunshare(1).
2020-05-23 06:59:24 +00:00
Đoàn Trần Công Danh fd61886616 setup/git.sh: prefer git plumbing command
git-ls-files(1) is plumbing command, its output will never change
regardless of configuration, version.

git-status(1) output will be changed depends on configuration.
At least, 986d4dbc7d (common/environment/setup/git.sh: ensure untracked
files are checked., 2017-11-24) was added to address a different output
on `status.showUntrackedFiles`.

By doing this, also reduce a pipe, and a fork-exec.

Technically, git-log(1) is also a porcelain, but I _think_ `%ct` is
stable enough to stay there. If the day has come, that `git-log(1)` can
be replaced with:

    git cat-file commit HEAD |
    sed -ne '/^committer/{s/.* \([0-9]*\) [-+][0-9][0-9][0-9][0-9]$/\1/p;q}'
2020-05-23 06:59:24 +00:00
Đoàn Trần Công Danh 20f9bedefb xbps-src: use $XBPS_GIT_CMD for git 2020-05-23 06:59:24 +00:00
Michael Gehring b137c5393a xbps-src: ensure GIT_CMD is invoked on the distdir 2018-03-14 15:47:56 +00:00
Michael Gehring a4a229cf64 xbps-src: use HEAD commit time for SOURCE_DATE_EPOCH
In order to make builds more reproducible SOURCE_DATE_EPOCH was set to
the time of the last commit that touched the template. Since trying to
reproduce a build from a different revision is futile (the most obvious
reason is that the source-revisions property includes the HEAD commit
hash) and looking up the commit in question can take several seconds,
stop wasting time an just use HEAD.

Closes: #12314 [via git-merge-pr]
2018-03-14 12:58:36 +00:00
Leah Neukirchen 986d4dbc7d common/environment/setup/git.sh: ensure untracked files are checked. 2017-11-24 14:10:00 +01:00
Jürgen Buchmüller c459dade15 gcc: add support for SOURCE_DATE_EPOCH environment
+ Create symlinks from gcc/patches/libcpp-source_date_epoch.patch to cross-*/files/
+ Make all the _apply_patch() functions the same
2016-03-08 13:49:52 +01:00
Enno Boland d84d62940d common/environment: check if package is under version control.
only use git commit date for SOURCE_DATE_EPOCH if the template is under version
control.  Fall back to templates mtime if it's not managed by git.
2016-03-06 13:07:10 +01:00
Enno Boland d285f4dcdb common/environment: only load git commit date when in chroot. 2016-03-02 07:47:35 +01:00
Enno Boland b5e49c48e7 common: replace XBPS_COMMIT_TIMESTAMP by SOURCE_DATE_EPOCH
This way we are compatible to the Debians proposal. See [1].

[1] https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02210.html
2016-03-01 18:27:49 +01:00
Enno Boland 3c04642877 environment/build: overwrite __DATE__, __TIME__, and __TIMESTAMP__ macros.
This commit overwrites timestamps that depend on timestamps with the
commit date of a package.
2016-03-01 15:33:09 +01:00