-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify .deb and .rpm LSC package generation #112
Simplify .deb and .rpm LSC package generation #112
Conversation
The gvm-lsc-rpm-creator script is replaced with a simpler script that does not include makeself and a new script is used to generate Debian packages directly with dpkg instead of using alien to convert the RPM. Because of this, checks for alien are removed and the INSTALL doc is updated accordingly.
tools/gvm-lsc-deb-creator.sh
Outdated
|
||
# Create .ssh directory | ||
mkdir -p "${SSH_DATA_DIR}" | ||
if [ 0 -ne "$?" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using if ! mkdir -p "${SSH_DATA_DIR}"
here
mkdir -p "${DOC_DATA_DIR}" | ||
|
||
# Create Changelog | ||
cd "${DOC_DATA_DIR}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using 'cd ... || exit'
to not simply continue on cd
failures
tools/gvm-lsc-deb-creator.sh
Outdated
cd "${DOC_DATA_DIR}" | ||
CHANGELOG_FILE="${DOC_DATA_DIR}/changelog.Debian" | ||
echo "${PACKAGE_NAME} (${PACKAGE_VERSION}) experimental; urgency=low" > ${CHANGELOG_FILE} | ||
echo "" >> ${CHANGELOG_FILE} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using { cmd1; cmd2; } >> file
instead of individual redirects.
In the post-installation of the generated packages, change the owner of the whole home directory, not just the .ssh subdirectory. Also change the owner group to the given username.
File variables are now used with quotes to prevent globbing. Using 'if [ 0 -ne "$?" ]' is now avoided. Blocks of commands generating content like multiple echos are run in a subshell so only one redirection is needed per file.
@wiegandm: I've changed the scripts according to most of those hints but I'm not sure about the one about adding |
Good point! I think in the interest of both readability and consistent error handling, using |
The LSC package generator scripts now exit on any error, sending an error message to stderr.
The gvm-lsc-rpm-creator script is replaced with a simpler script that
does not include makeself and a new script is used to generate Debian
packages directly with dpkg instead of using alien to convert the RPM.
Because of this, checks for alien are removed and the INSTALL doc is
updated accordingly.