Commit 081d22dc authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

support any kind of _generic files

parent 6e9230cd
......@@ -84,9 +84,19 @@ copy_and_solve_templates () {
for descriptor in "$1"/*; do
cp -r "$descriptor" "$2"
for template_path in $(find "$2/${descriptor##$1/}" -name *.in -type f); do
item=${descriptor##$1/}
for template_path in $(find "$2/$item" -name *.in -type f); do
sed "$ALL_REGEX" "$template_path" > "${template_path%.in}"
rm "$template_path"
done
[ -f "$2/$(basename $item .in)" ] && item=$(basename $item .in)
# if something is called _generic.XXX replace with $SOFTWARE_NAME.XXX
for gen in $(find "$2/$item" -name _generic.* -type f); do
filename=$(basename -- "$gen")
extension="${filename##*.}"
if [ "$filename" = _generic."$extension" ] ; then
mv $gen $(dirname -- "$gen")/"$SOFTWARE_NAME"."$extension"
fi
done
done
}
......@@ -15,7 +15,6 @@ cd "$INITIAL_DIR"
# copy compilation files and override the files from _generic
# with the one from <software_name>
copy_and_solve_templates "$DISTRIB_FILES_GENERIC_DIR" "$OBS_DIR"
mv "$OBS_DIR"/_generic.dsc "$OBS_DIR/$SOFTWARE_AND_VERSION.dsc"
copy_and_solve_templates "$DISTRIB_FILES_SOFTWARE_DIR" "$OBS_DIR"
# ARCHIVES FILES
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment