-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add PACKGEN to build_packages.sh and add better parameter parsing #159
Conversation
Scripts/Packaging/build_packages.sh
Outdated
echo " --rpm-dir <path> Set the RPM directory" | ||
echo " --deb-release <release> Set the DEB package release" | ||
echo " --rpm-release <release> Set the RPM package release" | ||
echo " --cpackgen <tool> Specify the CPack tool" |
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.
echo " --cpackgen <tool> Specify the CPack tool" | |
echo " --packgen <format> Specify the package format. Options 'DEB' or 'RPM'. Default: '', which generates both." |
Scripts/Packaging/build_packages.sh
Outdated
-h | --help) | ||
echo "Usage: build_rocm_examples.sh [options]" | ||
echo "Options:" | ||
echo " --root <path> Set the root of the ROCm examples" |
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.
echo " --root <path> Set the root of the ROCm examples" | |
echo " --src-dir<path> Set the source directory" |
Changing to src-dir
to match other path related options. Maybe we should move it lower to also group them all together.
echo " --pkgname <name> Set the package name" | ||
echo " --version <version> Set the package version" |
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.
Let's group pkgname
, version
, deb-release
, and rpm-release
together. Logically, they are all related and make up the full package name.
Scripts/Packaging/build_packages.sh
Outdated
RPM_DIR="$BUILD_DIR/rpm" | ||
DEB_PACKAGE_RELEASE="local.9999" | ||
RPM_PACKAGE_RELEASE="local.9999" | ||
CPACKGEN="" |
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.
CPACKGEN="" | |
PACKGEN="" # Default is both DEB and RPM |
Changing name to "PACKGEN", since you're not actually using CPack to build your packages. NOTE: I haven't changed subsequent references.
Scripts/Packaging/build_packages.sh
Outdated
echo " --deb-release <release> Set the DEB package release" | ||
echo " --rpm-release <release> Set the RPM package release" |
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.
echo " --deb-release <release> Set the DEB package release" | |
echo " --rpm-release <release> Set the RPM package release" | |
echo " --deb-release <release> Set the DEB package release info (used to generate filename)" | |
echo " --rpm-release <release> Set the RPM package release info (used to generate filename)" |
Scripts/Packaging/build_packages.sh
Outdated
GIT_TOP_LEVEL=$(git rev-parse --show-toplevel) | ||
ROCM_EXAMPLES_ROOT="$GIT_TOP_LEVEL" |
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.
ROCM_EXAMPLES_ROOT="$GIT_TOP_LEVEL" | |
SRC_DIR="$GIT_TOP_LEVEL" |
Changing to SRC_DIR to match other path related options. Maybe we should move it lower to also group them all together. NOTE: I haven't changed subsequent references.
Scripts/Packaging/build_packages.sh
Outdated
PACKAGE_HOMEPAGE_URL="https://github.com/ROCm/ROCm-examples" | ||
|
||
# Getopt argument parsing | ||
VALID_ARGS=$(getopt -o hcr --long help,clean,release,root:,pkgname:,version:,install-prefix:,test-install-prefix:,build-dir:,deb-dir:,rpm-dir:,deb-release:,rpm-release:,cpackgen: -- "$@") |
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.
VALID_ARGS=$(getopt -o hcr --long help,clean,release,root:,pkgname:,version:,install-prefix:,test-install-prefix:,build-dir:,deb-dir:,rpm-dir:,deb-release:,rpm-release:,cpackgen: -- "$@") | |
VALID_ARGS=$(getopt -o h --long help,root:,pkgname:,version:,install-prefix:,test-install-prefix:,build-dir:,deb-dir:,rpm-dir:,deb-release:,rpm-release:,cpackgen: -- "$@") |
I didn't see "clean" or "release" in your switch-case statement. If I'm missing something, you can ignore this suggestion.
Passes PACKGEN as a parameter to
build_packages.sh
to determine which distribution the script is generating a package for(DEB/RPM). Default is both RPM and DEB packages are generated. Additionally adds better parameter parsing.