src-rev/jenkins: adapted src-rev to handle packages from a file
the file autorev-packages.inc holds holds all recipes with a SRCREV set to AUTOREV. When releasing this file shall be used as base which recipes to update. BugzID: 75209 Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
0704618e91
commit
6848564543
|
|
@ -70,7 +70,7 @@ def cleanupAutoRevIncludeFile(versionParam) {
|
||||||
|
|
||||||
def updateSourceRevisions() {
|
def updateSourceRevisions() {
|
||||||
println "update source revisions to head..."
|
println "update source revisions to head..."
|
||||||
sh(returnStdout: true, script: "bash -c '. ./env.image-ostree > /dev/null && cd ../ && ./src-rev.sh -v -d -r -l ./srcrev.log'")
|
sh(returnStdout: true, script: "bash -c '. ./env.image-ostree > /dev/null && cd ../ && ./src-rev.sh -v -d -r -l ./srcrev.log -a ./autorev-packages.inc'")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ def updateMachineSrcRevs(machine) {
|
||||||
println "update source revisions for ${env.MACHINE} to head..."
|
println "update source revisions for ${env.MACHINE} to head..."
|
||||||
sh("echo '==> ${env.MACHINE} =======================' >> ./${env.SOURCE_REVISION_UPDATE_LOG}")
|
sh("echo '==> ${env.MACHINE} =======================' >> ./${env.SOURCE_REVISION_UPDATE_LOG}")
|
||||||
sh("bash -c '. ./env.image-ostree > /dev/null && cd ../'")
|
sh("bash -c '. ./env.image-ostree > /dev/null && cd ../'")
|
||||||
sh(returnStdout: true, script: "./src-rev.sh -v -d -r -l ./srcrev.log")
|
sh(returnStdout: true, script: "./src-rev.sh -v -d -r -l ./srcrev.log -a ./autorev-packages.inc")
|
||||||
sh("cat ./srcrev.log >> ./${env.SOURCE_REVISION_UPDATE_LOG}")
|
sh("cat ./srcrev.log >> ./${env.SOURCE_REVISION_UPDATE_LOG}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
57
src-rev.sh
57
src-rev.sh
|
|
@ -6,10 +6,11 @@ SCRIPT_NAME=$(basename ${SCRIPT_PATHNAME})
|
||||||
SCRIPT_PATH=$(dirname ${SCRIPT_PATHNAME})
|
SCRIPT_PATH=$(dirname ${SCRIPT_PATHNAME})
|
||||||
YOCTO_DIR="${YOCTO_DIR:-$SCRIPT_PATH}"
|
YOCTO_DIR="${YOCTO_DIR:-$SCRIPT_PATH}"
|
||||||
|
|
||||||
export LOGFILE=/dev/null
|
LOGFILE=/dev/null
|
||||||
export IS_REPLACE_SRCREV=false
|
IS_REPLACE_SRCREV=false
|
||||||
export IS_VERBOSE=false
|
IS_VERBOSE=false
|
||||||
export IS_DISPLAY=false
|
IS_DISPLAY=false
|
||||||
|
LIST=""
|
||||||
|
|
||||||
#**********************************************************************************************
|
#**********************************************************************************************
|
||||||
# local helper functions
|
# local helper functions
|
||||||
|
|
@ -18,13 +19,19 @@ export IS_DISPLAY=false
|
||||||
function printUsage()
|
function printUsage()
|
||||||
{
|
{
|
||||||
echo -e "\nUsage: ${SCRIPT_NAME} [OPTIONS]\n"
|
echo -e "\nUsage: ${SCRIPT_NAME} [OPTIONS]\n"
|
||||||
|
echo -e "find the source revision of the packages within the netmodule meta layers and"
|
||||||
|
echo -e "display/replace them with the latest hashes."
|
||||||
|
echo -e "NOTE: there is a list containing packages set to AUTOREV. Use option -a to handle"
|
||||||
|
echo -e "only revisions of this list. Otherwise we might get incompatible versions of 3rd"
|
||||||
|
echo -e "party packages.\n"
|
||||||
echo -e ""
|
echo -e ""
|
||||||
echo -e " OPTIONS:"
|
echo -e " OPTIONS:"
|
||||||
echo -e " -r|--replace replace SRCREVs"
|
echo -e " -r|--replace replace SRCREVs"
|
||||||
echo -e " -d|--display display found SRVREVs"
|
echo -e " -d|--display display found SRVREVs"
|
||||||
echo -e " -l|--log=LOGFILE write command output to LOGFILE (default = $LOGFILE)"
|
echo -e " -a|--autorev-list=LIST handle only revisions of LIST (e.g. autorev-packages.inc)"
|
||||||
echo -e " -h|--help Show this help"
|
echo -e " -l|--log=LOGFILE write command output to LOGFILE (default = $LOGFILE)"
|
||||||
echo -e " -v|--verbose Set script to verbose"
|
echo -e " -h|--help show this help"
|
||||||
|
echo -e " -v|--verbose set script to verbose"
|
||||||
}
|
}
|
||||||
#----------------------------------------------------------------------------------------------
|
#----------------------------------------------------------------------------------------------
|
||||||
function logMessage()
|
function logMessage()
|
||||||
|
|
@ -55,18 +62,28 @@ function checkingEnvironment()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
#----------------------------------------------------------------------------------------------
|
#----------------------------------------------------------------------------------------------
|
||||||
|
function getBBFiles()
|
||||||
|
{
|
||||||
|
if [[ "${LIST}" == "" ]]; then
|
||||||
|
files=$(find ${YOCTO_DIR}/meta-netmodule* -name "*.bb" | xargs -i sh -c "grep -q SRCREV {} && echo {}")
|
||||||
|
else
|
||||||
|
files=$(cat $LIST | grep "#" | cut -d'#' -f2)
|
||||||
|
fi
|
||||||
|
echo "${files}"
|
||||||
|
}
|
||||||
|
#----------------------------------------------------------------------------------------------
|
||||||
function displayItem()
|
function displayItem()
|
||||||
{
|
{
|
||||||
local bbfile="${1}"
|
local bbfile="${1}"
|
||||||
local recipeName="${2}"
|
local recipeName="${2}"
|
||||||
local revision="${3}"
|
local revision="${3}"
|
||||||
|
|
||||||
printMessage "Recipe: $recipe"
|
printMessage "Recipe: $recipeName"
|
||||||
printMessage "New Revision: $newrev"
|
printMessage "New Revision: $revision"
|
||||||
printMessage "BB File: $bbfile"
|
printMessage "BB File: $bbfile"
|
||||||
if [[ "${IS_DISPLAY}" == "true" && "${IS_VERBOSE}" == "false" ]]; then
|
if [[ "${IS_DISPLAY}" == "true" && "${IS_VERBOSE}" == "false" ]]; then
|
||||||
echo "Recipe: $recipe"
|
echo "Recipe: $recipeName"
|
||||||
echo "New Revision: $newrev"
|
echo "New Revision: $revision"
|
||||||
echo "BB File: $bbfile"
|
echo "BB File: $bbfile"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
@ -75,7 +92,7 @@ function displayItem()
|
||||||
#**********************************************************************************************
|
#**********************************************************************************************
|
||||||
# main
|
# main
|
||||||
#**********************************************************************************************
|
#**********************************************************************************************
|
||||||
O=$(getopt -o hl:vrd --long help,log:,verbose,replace,display -- "$@") || exit 1
|
O=$(getopt -o hl:a:vrd --long help,log:,autorev-list:,verbose,replace,display -- "$@")
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
echo "ERROR: Could not parse command line options"
|
echo "ERROR: Could not parse command line options"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -96,6 +113,11 @@ while true; do
|
||||||
export IS_REPLACE_SRCREV=true
|
export IS_REPLACE_SRCREV=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-a|--autorev-list)
|
||||||
|
export LIST="${2}"
|
||||||
|
export LIST=$(realpath "${LIST}")
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
-l|--log)
|
-l|--log)
|
||||||
export LOGFILE="${2}"
|
export LOGFILE="${2}"
|
||||||
export LOGFILE=$(realpath "${LOGFILE}")
|
export LOGFILE=$(realpath "${LOGFILE}")
|
||||||
|
|
@ -118,8 +140,8 @@ done
|
||||||
echo "${SCRIPT_NAME} called with ${SCRIPT_PARAMS}" > $LOGFILE
|
echo "${SCRIPT_NAME} called with ${SCRIPT_PARAMS}" > $LOGFILE
|
||||||
checkingEnvironment
|
checkingEnvironment
|
||||||
|
|
||||||
printMessage "> get bbfiles..."
|
printMessage "> get bbfiles (LIST='${LIST}')..."
|
||||||
bbfiles=$(find ${YOCTO_DIR}/meta-netmodule* -name "*.bb" | xargs -i sh -c "grep -q SRCREV {} && echo {}")
|
bbfiles=$(getBBFiles)
|
||||||
logMessage "${bbfiles}"
|
logMessage "${bbfiles}"
|
||||||
|
|
||||||
printMessage "> getting recipes residing in bbfiles..."
|
printMessage "> getting recipes residing in bbfiles..."
|
||||||
|
|
@ -128,6 +150,7 @@ logMessage "${recipes}"
|
||||||
|
|
||||||
printMessage "> getting check-upgrade-status..."
|
printMessage "> getting check-upgrade-status..."
|
||||||
newcommits=$(devtool check-upgrade-status $recipes 2>&1 | grep "new commits")
|
newcommits=$(devtool check-upgrade-status $recipes 2>&1 | grep "new commits")
|
||||||
|
logMessage "${newcommits}"
|
||||||
|
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
for newcommit in $newcommits; do
|
for newcommit in $newcommits; do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue