Commit e27ac308 authored by Stefan Bader's avatar Stefan Bader

UBUNTU: [Packaging] update helper scripts

BugLink: https://bugs.launchpad.net/bugs/1786013Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent 640f2e51
...@@ -118,10 +118,16 @@ if [ -d "$DEBIAN/config" ]; then ...@@ -118,10 +118,16 @@ if [ -d "$DEBIAN/config" ]; then
fi fi
fi fi
# Derivatives and backports have a master kernel directory (DEBIAN_MASTER). # For normal trees the fact that the update.conf file exists means that they are rebase
case "$DEBIAN" in # kernels. There are some special trees which started with uc20-efi, which have that
debian.master|debian.uc20-efi) skip_master_entries=1 ;; # file because they logically depend on another source but do not have the directory
esac # which DEBIAN_MASTER points to.
# Skip inserting parent source entries if this is not a rebase tree.
if [ ! -f "$DEBIAN/etc/update.conf" ]; then
skip_master_entries=1
elif [ "$DEBIAN_MASTER" != "" -a ! -d "$DEBIAN_MASTER" ]; then
skip_master_entries=1
fi
if [ $skip_master_entries == 0 ]; then if [ $skip_master_entries == 0 ]; then
if [ "$DEBIAN_MASTER" = "" ]; then if [ "$DEBIAN_MASTER" = "" ]; then
echo "DEBIAN_MASTER should be defined either in $DEBIAN/etc/update.conf or the environment" echo "DEBIAN_MASTER should be defined either in $DEBIAN/etc/update.conf or the environment"
......
...@@ -175,8 +175,13 @@ if [ -d "$DEBIAN/abi" ]; then ...@@ -175,8 +175,13 @@ if [ -d "$DEBIAN/abi" ]; then
if [ "$reuse_abi" -ne 0 ]; then if [ "$reuse_abi" -ne 0 ]; then
# Get the old ABI directory: # Get the old ABI directory:
old=$(find "$DEBIAN/abi/" -mindepth 1 -maxdepth 1 -type d -a -name "${new%%-*}*") old=$(find "$DEBIAN/abi/" -mindepth 1 -maxdepth 1 -type d | \
if [ "$(echo "$old" | wc -l)" -gt 1 ]; then grep -P '/abi/[0-9]+\.[0-9]+\.[0-9]+-[0-9]+\.[0-9]+')
if [ -z "${old}" ] ; then
echo "Failed to find the previous ABI directory." \
"Please check \"$DEBIAN/abi/\"!" >&2
exit 1
elif [ "$(echo "$old" | wc -l)" -gt 1 ]; then
echo "Failed to rename the current ABI directory." \ echo "Failed to rename the current ABI directory." \
"Multiple directories found. Please check \"$DEBIAN/abi/\"!" >&2 "Multiple directories found. Please check \"$DEBIAN/abi/\"!" >&2
exit 1 exit 1
......
...@@ -56,12 +56,20 @@ while getopts "r:b:l:d" opt; do ...@@ -56,12 +56,20 @@ while getopts "r:b:l:d" opt; do
done done
shift $((OPTIND - 1)) shift $((OPTIND - 1))
case "$DEBIAN" in # For normal trees the fact that the update.conf file exists means that they are rebase
debian.master|debian.uc20-efi) # kernels. There are some special trees which started with uc20-efi, which have that
# file because they logically depend on another source but do not have the directory
# which DEBIAN_MASTER points to.
IS_REBASE_KERNEL=true
if [ ! -f "$DEBIAN/etc/update.conf" ]; then
IS_REBASE_KERNEL=false
elif [ "$DEBIAN_MASTER" != "" -a ! -d "$DEBIAN_MASTER" ]; then
IS_REBASE_KERNEL=false
fi
if ! $IS_REBASE_KERNEL; then
echo "This is not a rebase kernel, no rebase should be needed, please report if otherwise" echo "This is not a rebase kernel, no rebase should be needed, please report if otherwise"
exit 0 exit 0
;; fi
esac
if [ "$DEBIAN_MASTER" = "" ]; then if [ "$DEBIAN_MASTER" = "" ]; then
echo "DEBIAN_MASTER should be defined either in ${DEBIAN}/etc/update.conf or the environment" echo "DEBIAN_MASTER should be defined either in ${DEBIAN}/etc/update.conf or the environment"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment