Skip to content

Commit

Permalink
Merge pull request #67 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 2.3.0
  • Loading branch information
andyone authored Nov 3, 2018
2 parents 68194f9 + 96a08d2 commit b7c3d43
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 14 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
language: bash
language: generic

sudo: required

Expand All @@ -14,11 +14,15 @@ env:

before_install:
- wget https://storage.googleapis.com/shellcheck/shellcheck-latest.linux.x86_64.tar.xz
- wget -O hadolint "https://github.com/hadolint/hadolint/releases/download/v1.15.0/hadolint-Linux-x86_64"
- tar xf shellcheck-latest.linux.x86_64.tar.xz
- ./shellcheck-latest/shellcheck --version
- docker pull "$IMAGE"
- wget https://kaos.sh/perfecto/perfecto-docker
- chmod +x perfecto-docker
- chmod +x hadolint
- ./perfecto-docker --version
- ./shellcheck-latest/shellcheck --version
- ./hadolint --version

script:
- bash -c 'shopt -s globstar; ./shellcheck-latest/shellcheck SOURCES/rpmbuilder SOURCES/libexec/*.shx'
Expand All @@ -29,3 +33,5 @@ script:
- bash -c 'shopt -s globstar; ./shellcheck-latest/shellcheck SOURCES/docker-entrypoint'
- ./perfecto-docker rpmbuilder.spec
- ./perfecto-docker rpmbuilder-node.spec
- ./hadolint centos6.docker
- ./hadolint centos7.docker
2 changes: 1 addition & 1 deletion SOURCES/libexec/build-local.shx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ localBuildProcess() {
if [[ -n "$sign" ]] ; then
localSign "$package"
else
show "Result: ${CL_CYAN}$package_name${CL_NORM}"
show "${CL_BOLD}+${CL_NORM} ${CL_CYAN}$package_name${CL_NORM}"
fi

if [[ -n "$dest_dir" ]] ; then
Expand Down
4 changes: 2 additions & 2 deletions SOURCES/libexec/build-remote.shx
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ remoteBuildProcess() {
fi

if [[ $? -eq 0 ]] ; then
show "Result: ${CL_CYAN}$package_name${CL_NORM}"
show "${CL_BOLD}+${CL_NORM} ${CL_CYAN}$package_name${CL_NORM}"
else
show "Result: ${CL_CYAN}$package_name${CL_NORM} ${CL_DARK}(ALREADY EXIST)${CL_NORM}"
show "${CL_BOLD}+${CL_NORM} ${CL_CYAN}$package_name${CL_NORM} ${CL_DARK}(ALREADY EXIST)${CL_NORM}"
fi
done

Expand Down
26 changes: 19 additions & 7 deletions SOURCES/libexec/package.shx
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,47 @@
# Code: Yes
# Echo: No
validatePackage() {
local rpm_file rpm_name has_errors
local rpm_file rpm_name

rpm_file="$1"
rpm_name=$(basename "$rpm_file")

showm "${CL_CYAN}${rpm_name}:${CL_NORM} "

if rpm -qp --scripts "$rpm_file" 2>&1 | grep -E -q '\%\{.*\}' ; then
has_errors=true
error "ERROR\n" $RED
error "RPM package ${CL_BL_YELLOW}${rpm_name}${CL_YELLOW} contains unexpanded macroses in scriptlets:" $YELLOW
error "${CL_GREY}"
rpm -qp --scripts "$rpm_file" 2>&1 | grep -E -A1 -B1 '\%\{.*\}' | sed '/^$/d' | sed 's/^/ /g' 1>&2
error "${CL_NORM}"

return 1
fi

if rpm -qlp "$rpm_file" 2>&1 | grep -E -q '\%\{.*\}' ; then
has_errors=true
error "ERROR\n" $RED
error "RPM package ${CL_BL_YELLOW}${rpm_name}${CL_YELLOW} contains unexpanded macroses in files section:" $YELLOW
error "${CL_GREY}"
rpm -qlp "$rpm_file" 2>&1 | grep -E -A1 -B1 '\%\{.*\}' | sed '/^$/d' | sed 's/^/ /g' 1>&2
error "${CL_NORM}"

return 1
fi

if [[ -z "$has_errors" ]] ; then
show "OK" $GREEN
return 0
if [[ "$rpm_name" =~ \.src\. ]] ; then
local pver cver

pver=$(rpm -qp --qf "%{version}" "$rpm_file")
cver=$(rpm -qp --changelog "$rpm_file" | head -1 | cut -d"-" -f2 | tr -d " ")

if [[ "$pver" != "$cver" ]] ; then
error "WARNING" $YELLOW
error "RPM package version not equal to the version from the latest record in the changelog ($pver$cver)\n" $YELLOW

return 0
fi
fi

return 1
show "OK" $GREEN
return 0
}
2 changes: 1 addition & 1 deletion SOURCES/rpmbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
APP="RPMBuilder"

# Utility version (String)
VER="2.2.3"
VER="2.3.0"

####################################################################

Expand Down
6 changes: 5 additions & 1 deletion rpmbuilder.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Summary: RPM package build helper
Name: rpmbuilder
Version: 2.2.3
Version: 2.3.0
Release: 0%{?dist}
License: EKOL
Group: Development/Tools
Expand Down Expand Up @@ -55,6 +55,10 @@ rm -rf %{buildroot}
################################################################################

%changelog
* Sat Nov 03 2018 Anton Novojilov <[email protected]> - 2.3.0-0
- Improved package validation
- Minor UI improvements

* Thu Sep 13 2018 Anton Novojilov <[email protected]> - 2.2.3-0
- Minor UI bugfixes

Expand Down

0 comments on commit b7c3d43

Please sign in to comment.