From 7ccf64ee091629796631b280432b51f95bf3ce83 Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Mon, 13 Aug 2018 13:52:28 -0500 Subject: [PATCH] obs: pkglib: remove unused option. Remove unused option. Signed-off-by: Jose Carlos Venegas Munoz --- obs-packaging/scripts/pkglib.sh | 39 ++++++++++----------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/obs-packaging/scripts/pkglib.sh b/obs-packaging/scripts/pkglib.sh index e29efe00aa..a6c3d5912d 100644 --- a/obs-packaging/scripts/pkglib.sh +++ b/obs-packaging/scripts/pkglib.sh @@ -47,7 +47,6 @@ function display_help() Options: -l --local-build Build the runtime locally - -c --commit-id Build with a given commit ID -b --branch Build with a given branch name -p --push Push changes to OBS -a --api-url Especify an OBS API (e.g. custom private OBS) @@ -61,9 +60,9 @@ function display_help() Usage examples: $SCRIPT_NAME --local-build --branch staging - $SCRIPT_NAME --commit-id a76f45c --push --api-url http://127.0.0.1 - $SCRIPT_NAME --commit-id a76f45c --push --obs-repository home:userx/repository - $SCRIPT_NAME --commit-id a76f45c --push + $SCRIPT_NAME --push --api-url http://127.0.0.1 + $SCRIPT_NAME --push --obs-repository home:userx/repository + $SCRIPT_NAME --push EOL exit 1 @@ -117,20 +116,7 @@ function get_git_info() function set_versions() { local commit_hash="$1" - - if [ -n "$OBS_REVISION" ] - then - # Validate input is alphanumeric, commit ID - # If a commit ID is provided, override versions.txt one - if [ -n "$COMMIT" ] && [[ "$OBS_REVISION" =~ ^[a-zA-Z0-9][-a-zA-Z0-9]{0,40}[a-zA-Z0-9]$ ]]; then - hash_tag=$OBS_REVISION - elif [ -n "$BRANCH" ] - then - hash_tag=$commit_hash - fi - else - hash_tag=$commit_hash - fi + hash_tag="$commit_hash" short_hashtag="${hash_tag:0:7}" } @@ -177,18 +163,16 @@ function local_build() function checkout_repo() { - local REPO="$1" - if [ -z "$OBS_WORKDIR" ] + local REPO="${1}" + if [ -z "${OBS_WORKDIR:-}" ] then - # If no workdir is provided, use a temporary directory. - temp=$(basename $0) - OBS_WORKDIR=$(mktemp -d -u -t ${temp}.XXXXXXXXXXX) || exit 1 - osc $APIURL co $REPO -o $OBS_WORKDIR + OBS_WORKDIR=$(mktemp -d -u -t obs-repo.XXXXXXXXXXX) || exit 1 + osc "${APIURL}" co "${REPO}" -o "${OBS_WORKDIR}" fi - find ${OBS_WORKDIR} -maxdepth 1 -mindepth 1 ! -name '.osc' -prune -exec echo remove {} \; -exec rm -rf {} \; + find "${OBS_WORKDIR}" -maxdepth 1 -mindepth 1 ! -name '.osc' -prune -exec echo remove {} \; -exec rm -rf {} \; - mv ${GENERATED_FILES[@]} "$OBS_WORKDIR" - cp ${STATIC_FILES[@]} "$OBS_WORKDIR" + mv "${GENERATED_FILES[@]}" "${OBS_WORKDIR}" + cp "${STATIC_FILES[@]}" "$OBS_WORKDIR" } function obs_push() @@ -206,7 +190,6 @@ function cli() case "${1}" in -a | --api-url ) APIURL="$2"; shift 2;; -b | --branch ) BRANCH="true"; OBS_REVISION="$2"; shift 2;; - -c | --commit-id ) COMMIT="true"; OBS_REVISION="$2"; shift 2;; -l | --local-build ) LOCAL_BUILD="true"; shift;; -p | --push ) OBS_PUSH="true"; shift;; -r | --obs-repository ) PROJECT_REPO="$2"; shift 2;;