@@ -129,14 +129,20 @@ build_package() {
129129 # Check if this package requires special setup
130130 if [[ -f " setup.sh" ]]; then
131131 echo " Running setup script for ${source_dir} ..."
132+ echo " Current directory before setup.sh: $( pwd) "
133+ echo " Directory contents before setup.sh:"
134+ ls -la
132135 chmod +x setup.sh
133136 ./setup.sh || {
134137 echo " Failed to run setup script for ${source_dir} ."
135138 return 1
136139 }
140+ echo " Current directory after setup.sh: $( pwd) "
141+ echo " Directory contents after setup.sh:"
142+ ls -la
137143
138- # After setup.sh, we might be in a different directory
139- # Find the debian directory to determine where to install dependencies
144+ # After setup.sh, we need to find where the source code and debian directory are
145+ # The setup.sh script might have created a subdirectory structure
140146 if [[ -d " debian" ]]; then
141147 echo " Found debian directory in current location"
142148 DEBIAN_DIR=" ."
@@ -147,8 +153,19 @@ build_package() {
147153 echo " Found debian directory in: ${DEBIAN_DIR} "
148154 cd " ${DEBIAN_DIR} "
149155 else
150- echo " Error: No debian directory found after setup.sh"
151- return 1
156+ # If no debian directory found, check if we're in a subdirectory that was created by setup.sh
157+ # Look for setup.py or other build files to determine if this is the source directory
158+ if [[ -f " setup.py" ]] || [[ -f " pyproject.toml" ]] || [[ -f " Makefile" ]]; then
159+ echo " Found source directory with build files in current location"
160+ DEBIAN_DIR=" ."
161+ else
162+ echo " Error: No debian directory or source files found after setup.sh"
163+ echo " Current directory contents:"
164+ ls -la
165+ echo " Looking for debian directories:"
166+ find . -name " debian" -type d 2> /dev/null || echo " No debian directories found"
167+ return 1
168+ fi
152169 fi
153170 fi
154171 fi
0 commit comments