This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/src/bash/Makefile
liuh-80 5b5f3f06f0
[Bash] Fix bash build break when re-build bash issue. (#9027)
This pull request will fix bash build break issue when re-build bash.

#### Why I did it
    src/bash project using quilt to manage patches, and quilt can't apply patch correctly when cache folder '.pc' is not clean.

#### How I did it
    Add command in make file to remove quilt cache folder before apply patches.

#### How to verify it
    Re-build bash target target/debs/buster/bash_5.1-2_amd64.deb to validate this fix work.
    Pass all UT.


#### Which release branch to backport (provide reason below if selected)
    N/A

#### Description for the changelog
    Fix bash build break issue when re-build bash.

#### A picture of a cute animal (not mandatory but encouraged)
2021-10-22 10:29:12 +08:00

37 lines
934 B
Makefile

SHELL = /bin/bash
.ONESHELL:
.SHELLFLAGS += -e
MAIN_TARGET = bash_$(BASH_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Quilt store applied patches info in .pc folder, if this folder not clean, quilt can't apply patches correctly.
rm -rf .pc
rm -rf bash-$(BASH_VERSION_MAJOR)
dget -u https://launchpad.net/debian/+archive/primary/+sourcefiles/bash/$(BASH_VERSION_FULL)/bash_$(BASH_VERSION_FULL).dsc
# Apply plugin suport patches
quilt push -a
pushd bash-$(BASH_VERSION_MAJOR)
# build package
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)
# copy UT code.
cp -a ../Files/. ./
# generate config.h which need by UT
./configure
# generate 'pathnames.h' by make bash again, which is needed by UT.
make
# run UT after config.h ready.
make -C unittest && make test -C unittest
popd
mv $* $(DEST)/