@@ -842,20 +842,20 @@ copy_oldpackages() {
842
842
}
843
843
844
844
copy_sources () {
845
- local include_directories
846
- if test -n " $RUNNING_IN_VM " -o " $BUILDTYPE " = kiwi -o " $BUILDTYPE " = docker -o " $BUILDTYPE " = fissile -o " $BUILDTYPE " = podman -o " $BUILDTYPE " = productcompose ; then
847
- include_directories =true
845
+ local image_mode i
846
+ if test " $BUILDTYPE " = kiwi -o " $BUILDTYPE " = docker -o " $BUILDTYPE " = fissile -o " $BUILDTYPE " = podman -o " $BUILDTYPE " = productcompose ; then
847
+ image_mode =true
848
848
fi
849
849
if test -n " $RUNNING_IN_VM " -o -n " $COPY_SOURCES_ASIS " -o -n " $RPM_BUILD_IN_PLACE " ; then
850
+ image_mode=
850
851
( shopt -s nullglob ; cp -pRd " $1 /" .[^.]* " $1 /" ..?* " $1 " /* " $2 " )
851
- elif test -n " $include_directories " ; then
852
- cp -pRL " $1 " /* " $2 "
853
852
elif test -e " $1 /.git" ; then
854
853
# check which directory belongs to the git repository and only copy those
855
854
type -p git >& /dev/null || cleanup_and_exit 1 " need git to check file status"
856
855
for i in " $1 /" .* " $1 " /* ; do
857
856
local ii=" ${i##*/ } "
858
857
test " $ii " = . -o " $ii " = .. -o " $ii " = .git && continue
858
+ test -n " $image_mode " -a \( " $ii " = repos -o " $ii " = containers \) && continue
859
859
if test -L " $i " -o -d " $i " -o " ${ii# .} " ! = " $ii " ; then
860
860
if test -e " $i /.build.asset" || git -C " $1 " --noglob-pathspecs -c safe.directory=" $ii " ls-files --error-unmatch -- " $ii " >& /dev/null ; then
861
861
cp -pRd " $i " " $2 "
@@ -871,7 +871,21 @@ copy_sources() {
871
871
$BUILD_DIR /export_debian_orig_from_git " $1 " " $2 /build.origtar" || cleanup_and_exit 1 " export_debian_orig_from_git failed"
872
872
fi
873
873
else
874
- cp -p " $1 " /* " $2 "
874
+ if test -n " $image_mode " ; then
875
+ for i in " $1 " /* ; do
876
+ local ii=" ${i##*/ } "
877
+ test -n " $image_mode " -a \( " $ii " = repos -o " $ii " = containers \) && continue
878
+ cp -p " $i " " $2 "
879
+ done
880
+ else
881
+ cp -p " $1 " /* " $2 "
882
+ fi
883
+ fi
884
+ if test -n " $image_mode " ; then
885
+ rm -rf " $2 /repos" " $2 /containers"
886
+ for i in " $1 /repos" " $1 /containers" ; do
887
+ test -d " $i " && cp -pRL " $i " " $2 "
888
+ done
875
889
fi
876
890
test -n " $RPM_BUILD_IN_PLACE " -a -z " $RUNNING_IN_VM " && cp -f " $RECIPEPATH " " $2 "
877
891
}
0 commit comments