Skip to content
Snippets Groups Projects
  • Paul Spooren's avatar
    a83b2af4
    build: get_source_date_epoch allow external repos · a83b2af4
    Paul Spooren authored
    
    The SOURCE_DATE_EPOCH variable is used to make builds reproducible even
    if rebuild at different times. Instead of using the current timestamp,
    the time of the last source change is used.
    
    Created packages are `touch`ed with a specific timestamp so resulting
    packages have the same checksums.
    
    The `get_source_date_epoch.sh` script tries multiple ways (file, git,
    hg) to determine the correct timestamp.
    
    Until now the script would only consider the $TOPDIR instead of package
    specific changes. Resulting in packages with same versions but different
    timestamps, as $TOPDIR (openwrt.git) received changes not affecting
    package versions. This results in warning/erros in `opkg` as the package
    versions stay the same but checksums changed.
    
    This commit adds an optional argument to get the `SOURCE_DATE_EPOCH` of
    a specific path (e.g. package SOURCE) rather than the $TOPDIR. As a
    consequence this allows granular but still reproducible timestamps.
    
    As packages might be distributed over multiple repositories the check
    for `.git/` becomes unfeasible. Instead tell `git` and `hg` to change
    their working directories and automatically traverse the repo folder.
    
    Signed-off-by: default avatarPaul Spooren <mail@aparcar.org>
    a83b2af4
    History
    build: get_source_date_epoch allow external repos
    Paul Spooren authored
    
    The SOURCE_DATE_EPOCH variable is used to make builds reproducible even
    if rebuild at different times. Instead of using the current timestamp,
    the time of the last source change is used.
    
    Created packages are `touch`ed with a specific timestamp so resulting
    packages have the same checksums.
    
    The `get_source_date_epoch.sh` script tries multiple ways (file, git,
    hg) to determine the correct timestamp.
    
    Until now the script would only consider the $TOPDIR instead of package
    specific changes. Resulting in packages with same versions but different
    timestamps, as $TOPDIR (openwrt.git) received changes not affecting
    package versions. This results in warning/erros in `opkg` as the package
    versions stay the same but checksums changed.
    
    This commit adds an optional argument to get the `SOURCE_DATE_EPOCH` of
    a specific path (e.g. package SOURCE) rather than the $TOPDIR. As a
    consequence this allows granular but still reproducible timestamps.
    
    As packages might be distributed over multiple repositories the check
    for `.git/` becomes unfeasible. Instead tell `git` and `hg` to change
    their working directories and automatically traverse the repo folder.
    
    Signed-off-by: default avatarPaul Spooren <mail@aparcar.org>