mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-16 01:21:07 +00:00
pbuilder-dist: more fixes (thanks to Adrien Cunin), accept 'upgrade' as an alias for 'update', comment out not used stuff (authenticacion method detection), etc.
This commit is contained in:
parent
71391dec33
commit
53cef1a285
4
debian/changelog
vendored
4
debian/changelog
vendored
@ -23,8 +23,12 @@ ubuntu-dev-tools (0.27) UNRELEASED; urgency=low
|
|||||||
* pbuilder-dist:
|
* pbuilder-dist:
|
||||||
- Apply patch from James Westby to fix a problem where it always
|
- Apply patch from James Westby to fix a problem where it always
|
||||||
wanted to get the architecture to use as an option (LP: #194633).
|
wanted to get the architecture to use as an option (LP: #194633).
|
||||||
|
- Fix a recently introduced problem where pbuilder-dist would always
|
||||||
|
want to know the architecture. Thanks to Adrien Cunin for finding
|
||||||
|
where the problem was!
|
||||||
- Escape many variables to avoid possible problems there.
|
- Escape many variables to avoid possible problems there.
|
||||||
- Reorganize the code a bit and comment it.
|
- Reorganize the code a bit and comment it.
|
||||||
|
- Accept "upgrade" as an alias for "update".
|
||||||
* 404main:
|
* 404main:
|
||||||
- Filter out entries from Debian, thanks to Adrien Cunin! (LP: #194704)
|
- Filter out entries from Debian, thanks to Adrien Cunin! (LP: #194704)
|
||||||
* debian/copyright.
|
* debian/copyright.
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
#
|
#
|
||||||
# License: GPLv2 or later
|
# License: GPLv2 or later
|
||||||
#
|
#
|
||||||
# This script is a wrapper to be able to easily use pbuilder with
|
# This script is a wrapper to be able to easily use pbuilder for
|
||||||
# differentd istributions (eg, Gutsy, Hardy, Debian unstable, etc).
|
# different distributions (eg, Gutsy, Hardy, Debian unstable, etc).
|
||||||
#
|
#
|
||||||
# You can create symlinks to a pbuilder-dist executable to get different
|
# You can create symlinks to a pbuilder-dist executable to get different
|
||||||
# configurations. For example, a symlink called pbuilder-hardy will assume
|
# configurations. For example, a symlink called pbuilder-hardy will assume
|
||||||
@ -68,7 +68,6 @@ then
|
|||||||
else
|
else
|
||||||
ORIGINAL_NAME=1
|
ORIGINAL_NAME=1
|
||||||
DISTRIBUTION=$1
|
DISTRIBUTION=$1
|
||||||
ARCHITECTURE=$REALARCH
|
|
||||||
shift 1
|
shift 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -84,6 +83,12 @@ then
|
|||||||
shift 1
|
shift 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If architecture hasn't been set yet, use the system's one.
|
||||||
|
if [ -z "$ARCHITECTURE" ]
|
||||||
|
then
|
||||||
|
ARCHITECTURE=$REALARCH
|
||||||
|
fi
|
||||||
|
|
||||||
# Check if there's a component modifier
|
# Check if there's a component modifier
|
||||||
if [ "$1" = 'mainonly' ]; then
|
if [ "$1" = 'mainonly' ]; then
|
||||||
EXTRACOMP=0
|
EXTRACOMP=0
|
||||||
@ -189,19 +194,34 @@ case $DISTRIBUTION in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if the selected operation is correct
|
# Save the selected operation in a variable.
|
||||||
OPERATION=$1
|
OPERATION=$1
|
||||||
|
shift 1
|
||||||
|
|
||||||
|
# Check if the selected operation is an alias for another one.
|
||||||
|
case "$OPERATION" in
|
||||||
|
upgrade)
|
||||||
|
OPERATION=update
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Check if the selected operation is correct, or if it is an alias for
|
||||||
|
# another one.
|
||||||
case "$OPERATION" in
|
case "$OPERATION" in
|
||||||
create|update|build|clean|login|execute)
|
create|update|build|clean|login|execute)
|
||||||
shift 1
|
# Allright.
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
upgrade)
|
||||||
|
OPERATION=update
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
if [ ${OPERATION##*.} = 'dsc' ]
|
if [ ${OPERATION##*.} = 'dsc' ]
|
||||||
then
|
then
|
||||||
OPERATION=build
|
OPERATION=build
|
||||||
else
|
else
|
||||||
echo "Unrecognized argument. Please use one of those:"
|
echo "Unrecognized argument '$OPERATION'. Please use one of those:"
|
||||||
echo " create"
|
echo " create"
|
||||||
echo " update"
|
echo " update"
|
||||||
echo " build"
|
echo " build"
|
||||||
@ -213,6 +233,8 @@ case "$OPERATION" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Determine the base name for the chroot tarball and the folder where the
|
||||||
|
# resulting files will be stored.
|
||||||
FOLDERBASE="${DISTRIBUTION}-$ARCHITECTURE"
|
FOLDERBASE="${DISTRIBUTION}-$ARCHITECTURE"
|
||||||
|
|
||||||
# Create the folder where the resulting files will be placed (if the
|
# Create the folder where the resulting files will be placed (if the
|
||||||
@ -228,6 +250,8 @@ then
|
|||||||
DEBCACHE='/var/cache/apt/archives/'
|
DEBCACHE='/var/cache/apt/archives/'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If it's an Ubuntu system, create an editable configuration file,
|
||||||
|
# and if it's a stable release add the -security and -updates repositories.
|
||||||
if [ $ISDEBIAN = "False" ]
|
if [ $ISDEBIAN = "False" ]
|
||||||
then
|
then
|
||||||
if [ ! -d $BASE_DIR/etc/$DISTRIBUTION/apt.conf/ ]
|
if [ ! -d $BASE_DIR/etc/$DISTRIBUTION/apt.conf/ ]
|
||||||
@ -250,27 +274,27 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$PBUILDAUTH" ]
|
#if [ -z "$PBUILDAUTH" ]
|
||||||
then
|
#then
|
||||||
if [ -n "$DESKTOP_SESSION" ]
|
# if [ -n "$DESKTOP_SESSION" ]
|
||||||
then
|
# then
|
||||||
case $DESKTOP_SESSION in
|
# case $DESKTOP_SESSION in
|
||||||
gnome )
|
# gnome )
|
||||||
SUDOREPLACE="gksudo -D \"Pbuilder\" "
|
# SUDOREPLACE="gksudo -D \"Pbuilder\""
|
||||||
;;
|
# ;;
|
||||||
kde|kde4 )
|
# kde|kde4 )
|
||||||
SUDOREPLACE="kdesudo -d --comment \"Pbuilder\""
|
# SUDOREPLACE="kdesudo -d --comment \"Pbuilder\""
|
||||||
;;
|
# ;;
|
||||||
* )
|
# * )
|
||||||
SUDOREPLACE="sudo"
|
# SUDOREPLACE="sudo"
|
||||||
;;
|
# ;;
|
||||||
esac
|
# esac
|
||||||
else
|
# else
|
||||||
SUDOREPLACE=sudo
|
# SUDOREPLACE=sudo
|
||||||
fi
|
# fi
|
||||||
else
|
#else
|
||||||
SUDOREPLACE=$PBUILDAUTH
|
# SUDOREPLACE=$PBUILDAUTH
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
sudo pbuilder $OPERATION \
|
sudo pbuilder $OPERATION \
|
||||||
--basetgz "$BASE_DIR/${FOLDERBASE}-base.tgz" \
|
--basetgz "$BASE_DIR/${FOLDERBASE}-base.tgz" \
|
||||||
@ -282,5 +306,5 @@ $( [ -z "$PROXY" ] || echo "--http-proxy ${PROXY}" ) \
|
|||||||
$( [ -z "$DEBCACHE" ] || echo "--aptcache ${DEBCACHE}" ) \
|
$( [ -z "$DEBCACHE" ] || echo "--aptcache ${DEBCACHE}" ) \
|
||||||
--buildresult "${BASE_DIR}/${FOLDERBASE}_result" \
|
--buildresult "${BASE_DIR}/${FOLDERBASE}_result" \
|
||||||
--mirror "${ARCHIVE}" \
|
--mirror "${ARCHIVE}" \
|
||||||
--aptconfdir "${BASE_DIR}/etc/${DISTRIBUTION}/apt.conf/" \
|
$( [ $ISDEBIAN != "False" ] || echo "--aptconfdir \"${BASE_DIR}/etc/${DISTRIBUTION}/apt.conf/\"" ) \
|
||||||
$@
|
$@
|
||||||
|
Loading…
x
Reference in New Issue
Block a user