Files
openwrt_yocto/poky/scripts/native-intercept/ar
T
francis.wang 4c86c082a2 Initial commit: OpenWrt-Yocto monorepo
Combine poky (Yocto scarthgap), meta-openembedded (scarthgap), and
meta-openwrt into a single repository.

Components:
- poky/             Yocto core framework (BitBake + OE-Core)
- meta-openembedded/ Community layers (meta-oe, meta-python, meta-networking)
- meta-openwrt/     OpenWrt customization layer
- setup-env.sh      One-click build environment setup
- README.md         Project documentation
2026-07-11 13:28:01 +08:00

33 lines
778 B
Python
Executable File

#!/usr/bin/env python3
#
# Wrapper around 'ar' that defaults to deterministic archives
import os
import shutil
import sys
# calculate path to the real 'ar'
path = os.environ['PATH']
path = path.replace(os.path.dirname(sys.argv[0]), '')
real_ar = shutil.which('ar', path=path)
if len(sys.argv) == 1:
os.execl(real_ar, 'ar')
# modify args to mimic 'ar' configured with --default-deterministic-archives
argv = sys.argv
if argv[1].startswith('--'):
# No modifier given
None
else:
# remove the optional '-'
if argv[1][0] == '-':
argv[1] = argv[1][1:]
if 'U' in argv[1]:
sys.stderr.write("ar: non-deterministic mode requested\n")
else:
argv[1] = argv[1].replace('u', '')
argv[1] = 'D' + argv[1]
os.execv(real_ar, argv)