new samples and control file writer
This commit is contained in:
@@ -226,7 +226,14 @@ builder_create() {
|
||||
|
||||
# replace variables from file OPSI/control
|
||||
local release_new=${CREATOR_TAG}${RELEASE}
|
||||
sed -e "s!VERSION!$VERSION!g" -e "s!RELEASE!${release_new}!g" -e "s!PRIORITY!$PRIORITY!g" -e "s!ADVICE!$ADVICE!g" ${PRODUCT_DIR}/OPSI/control >$INST_DIR/OPSI/control
|
||||
# sed -e "s!VERSION!$VERSION!g" -e "s!RELEASE!${release_new}!g" -e "s!PRIORITY!$PRIORITY!g" -e "s!ADVICE!$ADVICE!g" ${PRODUCT_DIR}/OPSI/control >$INST_DIR/OPSI/control
|
||||
write_control_file $INST_DIR/OPSI/control "Package" "version" "${release_new}"
|
||||
write_control_file $INST_DIR/OPSI/control "Product" "id" "$PN"
|
||||
write_control_file $INST_DIR/OPSI/control "Product" "name" "$NAME"
|
||||
write_control_file $INST_DIR/OPSI/control "Product" "description" "$DESCRIPTION"
|
||||
write_control_file $INST_DIR/OPSI/control "Product" "advice" "$ADVICE"
|
||||
write_control_file $INST_DIR/OPSI/control "Product" "version" "$VERSION"
|
||||
write_control_file $INST_DIR/OPSI/control "Product" "priority" "$PRIORITY"
|
||||
|
||||
# Create changelog based on git - if available
|
||||
if [ -d "${PRODUCT_DIR}/.git" ] ; then
|
||||
|
||||
@@ -321,3 +321,21 @@ write_ini_file() {
|
||||
done
|
||||
}
|
||||
|
||||
###################
|
||||
# Write control file
|
||||
#
|
||||
# Create a ini file containing needed information for package uninstall
|
||||
#
|
||||
# Parameter
|
||||
# file: file to create / modify
|
||||
#
|
||||
###################
|
||||
write_control_file() {
|
||||
local control_file=$1
|
||||
local control_section=$2
|
||||
local control_option=$3
|
||||
local control_value=$4
|
||||
|
||||
sed -i -e "/^\[$control_section\]/,/^\[.*\]/ s|^\($control_option[ \t]*:[ \t]*\).*$|\1$control_value|" "$control_file"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user