mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-01 01:41:52 -05:00
makepkg: remove VCS package support
The current VCS packaging support is really, really, really bad. It is best to strip it out completely before rewriting it. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
ec5e6d9029
commit
d338b3981d
@ -392,70 +392,6 @@ The install script does not need to be specified in the source array. A
|
|||||||
template install file is available in '{pkgdatadir}' as 'proto.install' for
|
template install file is available in '{pkgdatadir}' as 'proto.install' for
|
||||||
reference with all of the available functions defined.
|
reference with all of the available functions defined.
|
||||||
|
|
||||||
|
|
||||||
Development Directives
|
|
||||||
----------------------
|
|
||||||
makepkg supports building development versions of packages without having to
|
|
||||||
manually update the pkgver in the PKGBUILD. This was formerly done using the
|
|
||||||
separate utility 'versionpkg'. In order to utilize this functionality, your
|
|
||||||
PKGBUILD must use correct variable names depending on the SCM being fetched
|
|
||||||
from (e.g., 'makepkg-git', 'mplayer-svn').
|
|
||||||
|
|
||||||
*CVS*::
|
|
||||||
The generated pkgver will be the date the package is built.
|
|
||||||
|
|
||||||
*_cvsroot*;;
|
|
||||||
The root of the CVS repository.
|
|
||||||
|
|
||||||
*_cvsmod*;;
|
|
||||||
The CVS module to fetch.
|
|
||||||
|
|
||||||
*SVN*::
|
|
||||||
The generated pkgver will be the latest SVN revision number.
|
|
||||||
|
|
||||||
*_svntrunk*;;
|
|
||||||
The trunk of the SVN repository.
|
|
||||||
|
|
||||||
*_svnmod*;;
|
|
||||||
The SVN module to fetch.
|
|
||||||
|
|
||||||
*Git*::
|
|
||||||
The generated pkgver will be the date the package is built.
|
|
||||||
|
|
||||||
*_gitroot*;;
|
|
||||||
The URL (all protocols supported) to the GIT repository.
|
|
||||||
|
|
||||||
*_gitname*;;
|
|
||||||
GIT tag or branch to use.
|
|
||||||
|
|
||||||
*Mercurial*::
|
|
||||||
The generated pkgver will be the hg tip revision number.
|
|
||||||
|
|
||||||
*_hgroot*;;
|
|
||||||
The URL of the mercurial repository.
|
|
||||||
|
|
||||||
*_hgrepo*;;
|
|
||||||
The repository to follow.
|
|
||||||
|
|
||||||
*Darcs*::
|
|
||||||
The generated pkgver will be the date the package is built.
|
|
||||||
|
|
||||||
*_darcstrunk*;;
|
|
||||||
URL to the repository trunk.
|
|
||||||
|
|
||||||
*_darcsmod*;;
|
|
||||||
Darcs module to use.
|
|
||||||
|
|
||||||
*Bazaar*::
|
|
||||||
The generated pkgver will be the latest Bazaar revision number (revno).
|
|
||||||
|
|
||||||
*_bzrtrunk*;;
|
|
||||||
URL to the bazaar repository.
|
|
||||||
|
|
||||||
*_bzrmod*;;
|
|
||||||
Bazaar module to use.
|
|
||||||
|
|
||||||
|
|
||||||
Example
|
Example
|
||||||
-------
|
-------
|
||||||
The following is an example PKGBUILD for the 'patch' package. For more
|
The following is an example PKGBUILD for the 'patch' package. For more
|
||||||
|
@ -71,11 +71,6 @@ Options
|
|||||||
default to the current directory. This allows the built package to be
|
default to the current directory. This allows the built package to be
|
||||||
overwritten.
|
overwritten.
|
||||||
|
|
||||||
*--forcever*::
|
|
||||||
This is a hidden option that should *not* be used unless you really know
|
|
||||||
what you are doing. makepkg uses this internally when calling itself to
|
|
||||||
set the new development pkgver of the package.
|
|
||||||
|
|
||||||
*-g, \--geninteg*::
|
*-g, \--geninteg*::
|
||||||
For each source file in the source array of PKGBUILD, download the file
|
For each source file in the source array of PKGBUILD, download the file
|
||||||
if required and generate integrity checks. The integrity checks generated
|
if required and generate integrity checks. The integrity checks generated
|
||||||
@ -96,11 +91,6 @@ Options
|
|||||||
*-h, \--help*::
|
*-h, \--help*::
|
||||||
Output syntax and command line options.
|
Output syntax and command line options.
|
||||||
|
|
||||||
*\--holdver*::
|
|
||||||
Useful when building development versions of packages. Prevents makepkg
|
|
||||||
from automatically bumping the pkgver to the latest revision number in
|
|
||||||
the package's development tree.
|
|
||||||
|
|
||||||
*-i, \--install*::
|
*-i, \--install*::
|
||||||
Install or upgrade the package after a successful build using
|
Install or upgrade the package after a successful build using
|
||||||
linkman:pacman[8].
|
linkman:pacman[8].
|
||||||
|
@ -70,7 +70,6 @@ REPKG=0
|
|||||||
LOGGING=0
|
LOGGING=0
|
||||||
SOURCEONLY=0
|
SOURCEONLY=0
|
||||||
IGNOREARCH=0
|
IGNOREARCH=0
|
||||||
HOLDVER=0
|
|
||||||
PREPAREFUNC=0
|
PREPAREFUNC=0
|
||||||
BUILDFUNC=0
|
BUILDFUNC=0
|
||||||
CHECKFUNC=0
|
CHECKFUNC=0
|
||||||
@ -185,12 +184,7 @@ clean_up() {
|
|||||||
|
|
||||||
enter_fakeroot() {
|
enter_fakeroot() {
|
||||||
msg "$(gettext "Entering %s environment...")" "fakeroot"
|
msg "$(gettext "Entering %s environment...")" "fakeroot"
|
||||||
|
fakeroot -- $0 -F "${ARGLIST[@]}" || exit $?
|
||||||
if [[ -n $newpkgver ]]; then
|
|
||||||
fakeroot -- $0 --forcever $newpkgver -F "${ARGLIST[@]}" || exit $?
|
|
||||||
else
|
|
||||||
fakeroot -- $0 -F "${ARGLIST[@]}" || exit $?
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1794,114 +1788,6 @@ check_software() {
|
|||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
devel_check() {
|
|
||||||
newpkgver=""
|
|
||||||
|
|
||||||
# Do not update pkgver if --holdver is set, when building a source package, repackaging,
|
|
||||||
# reading PKGBUILD from pipe (-f), or if we cannot write to the file (-w)
|
|
||||||
if (( HOLDVER || SOURCEONLY || REPKG )) ||
|
|
||||||
[[ ! -f $BUILDFILE || ! -w $BUILDFILE || $BUILDFILE = "/dev/stdin" ]]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $FORCE_VER ]]; then
|
|
||||||
# Check if this is a svn/cvs/etc PKGBUILD; set $newpkgver if so.
|
|
||||||
# This will only be used on the first call to makepkg; subsequent
|
|
||||||
# calls to makepkg via fakeroot will explicitly pass the version
|
|
||||||
# number to avoid having to determine the version number twice.
|
|
||||||
# Also do a check to make sure we have the VCS tool available.
|
|
||||||
local vcs=()
|
|
||||||
|
|
||||||
[[ -n ${_darcstrunk} && -n ${_darcsmod} ]] && vcs+=("darcs")
|
|
||||||
[[ -n ${_cvsroot} && -n ${_cvsmod} ]] && vcs+=("cvs")
|
|
||||||
[[ -n ${_gitroot} && -n ${_gitname} ]] && vcs+=("git")
|
|
||||||
[[ -n ${_svntrunk} && -n ${_svnmod} ]] && vcs+=("svn")
|
|
||||||
[[ -n ${_bzrtrunk} && -n ${_bzrmod} ]] && vcs+=("bzr")
|
|
||||||
[[ -n ${_hgroot} && -n ${_hgrepo} ]] && vcs+=("hg")
|
|
||||||
|
|
||||||
if (( ${#vcs[@]} == 0 )); then
|
|
||||||
return
|
|
||||||
elif (( ${#vcs[@]} > 1 )); then
|
|
||||||
warning "$(gettext "Ambiguous VCS package. Cannot pick from: %s.")" "${vcs[*]}"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! type -p "$vcs" >/dev/null; then
|
|
||||||
warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "$vcs" "$vcs"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg "$(gettext "Determining latest %s revision...")" "$vcs"
|
|
||||||
|
|
||||||
case "$vcs" in
|
|
||||||
darcs)
|
|
||||||
newpkgver=$(date +%Y%m%d)
|
|
||||||
;;
|
|
||||||
cvs)
|
|
||||||
newpkgver=$(date +%Y%m%d)
|
|
||||||
;;
|
|
||||||
git)
|
|
||||||
newpkgver=$(date +%Y%m%d)
|
|
||||||
;;
|
|
||||||
svn)
|
|
||||||
newpkgver=$(LC_ALL=C svn info $_svntrunk | sed -n 's/^Last Changed Rev: \([0-9]*\)$/\1/p')
|
|
||||||
;;
|
|
||||||
bzr)
|
|
||||||
newpkgver=$(bzr revno ${_bzrtrunk})
|
|
||||||
;;
|
|
||||||
hg)
|
|
||||||
if pushd "./src/$_hgrepo" > /dev/null; then
|
|
||||||
local ret=0
|
|
||||||
hg pull || ret=$?
|
|
||||||
if (( ! ret )); then
|
|
||||||
hg update
|
|
||||||
elif (( ret != 1 )); then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
[[ ! -d ./src/ ]] && mkdir ./src/
|
|
||||||
hg clone "$_hgroot/$_hgrepo" "./src/$_hgrepo"
|
|
||||||
if ! pushd "./src/$_hgrepo" > /dev/null; then
|
|
||||||
warning "$(gettext "An error occured while determining the hg version number.")"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
newpkgver=$(hg tip --template "{rev}")
|
|
||||||
popd > /dev/null
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [[ -n $newpkgver ]]; then
|
|
||||||
msg2 "$(gettext "Version found: %s")" "$newpkgver"
|
|
||||||
fi
|
|
||||||
|
|
||||||
else
|
|
||||||
# Version number retrieved from fakeroot->makepkg argument
|
|
||||||
newpkgver=$FORCE_VER
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
devel_update() {
|
|
||||||
# This is lame, but if we're wanting to use an updated pkgver for
|
|
||||||
# retrieving svn/cvs/etc sources, we'll update the PKGBUILD with
|
|
||||||
# the new pkgver and then re-source it. This is the most robust
|
|
||||||
# method for dealing with PKGBUILDs that use, e.g.:
|
|
||||||
#
|
|
||||||
# pkgver=23
|
|
||||||
# ...
|
|
||||||
# _foo=pkgver
|
|
||||||
#
|
|
||||||
if [[ -n $newpkgver && $newpkgver != "$pkgver" ]]; then
|
|
||||||
if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then
|
|
||||||
@SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE"
|
|
||||||
@SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE"
|
|
||||||
source "$BUILDFILE"
|
|
||||||
else
|
|
||||||
warning "$(gettext "%s is not writeable -- pkgver will not be updated")" "$BUILDFILE"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
backup_package_variables() {
|
backup_package_variables() {
|
||||||
local var
|
local var
|
||||||
for var in ${splitpkg_overrides[@]}; do
|
for var in ${splitpkg_overrides[@]}; do
|
||||||
@ -1980,7 +1866,6 @@ usage() {
|
|||||||
printf -- "$(gettext " --asroot Allow %s to run as root user")\n" "makepkg"
|
printf -- "$(gettext " --asroot Allow %s to run as root user")\n" "makepkg"
|
||||||
printf -- "$(gettext " --check Run the %s function in the %s")\n" "check()" "$BUILDSCRIPT"
|
printf -- "$(gettext " --check Run the %s function in the %s")\n" "check()" "$BUILDSCRIPT"
|
||||||
printf -- "$(gettext " --config <file> Use an alternate config file (instead of '%s')")\n" "$confdir/makepkg.conf"
|
printf -- "$(gettext " --config <file> Use an alternate config file (instead of '%s')")\n" "$confdir/makepkg.conf"
|
||||||
printf -- "$(gettext " --holdver Prevent automatic version bumping for development %ss")\n" "$BUILDSCRIPT"
|
|
||||||
printf -- "$(gettext " --key <key> Specify a key to use for %s signing instead of the default")\n" "gpg"
|
printf -- "$(gettext " --key <key> Specify a key to use for %s signing instead of the default")\n" "gpg"
|
||||||
printf -- "$(gettext " --nocheck Do not run the %s function in the %s")\n" "check()" "$BUILDSCRIPT"
|
printf -- "$(gettext " --nocheck Do not run the %s function in the %s")\n" "check()" "$BUILDSCRIPT"
|
||||||
printf -- "$(gettext " --nosign Do not create a signature for the package")\n"
|
printf -- "$(gettext " --nosign Do not create a signature for the package")\n"
|
||||||
@ -2022,11 +1907,11 @@ ARGLIST=("$@")
|
|||||||
|
|
||||||
# Parse Command Line Options.
|
# Parse Command Line Options.
|
||||||
OPT_SHORT="AcdefFghiLmop:rRsSV"
|
OPT_SHORT="AcdefFghiLmop:rRsSV"
|
||||||
OPT_LONG=('allsource' 'asroot' 'ignorearch' 'check' 'clean' 'nodeps'
|
OPT_LONG=('allsource' 'asroot' 'check' 'clean' 'config:' 'force' 'geninteg'
|
||||||
'noextract' 'force' 'forcever:' 'geninteg' 'help' 'holdver' 'skippgpcheck'
|
'help' 'ignorearch' 'install' 'key:' 'log' 'nobuild' 'nocolor'
|
||||||
'install' 'key:' 'log' 'nocolor' 'nobuild' 'nocheck' 'nosign' 'pkg:' 'rmdeps'
|
'nocheck' 'nodeps' 'noextract' 'nosign' 'pkg:' 'repackage' 'rmdeps'
|
||||||
'repackage' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'sign' 'source' 'syncdeps'
|
'skipchecksums' 'skipinteg' 'skippgpcheck' 'skippgpcheck' 'sign'
|
||||||
'version' 'config:')
|
'source' 'syncdeps' 'version')
|
||||||
|
|
||||||
# Pacman Options
|
# Pacman Options
|
||||||
OPT_LONG+=('asdeps' 'noconfirm' 'noprogressbar')
|
OPT_LONG+=('asdeps' 'noconfirm' 'noprogressbar')
|
||||||
@ -2054,11 +1939,8 @@ while true; do
|
|||||||
-d|--nodeps) NODEPS=1 ;;
|
-d|--nodeps) NODEPS=1 ;;
|
||||||
-e|--noextract) NOEXTRACT=1 ;;
|
-e|--noextract) NOEXTRACT=1 ;;
|
||||||
-f|--force) FORCE=1 ;;
|
-f|--force) FORCE=1 ;;
|
||||||
#hidden opt used by fakeroot call for svn/cvs/etc PKGBUILDs to set pkgver
|
|
||||||
--forcever) shift; FORCE_VER=$1;;
|
|
||||||
-F) INFAKEROOT=1 ;;
|
-F) INFAKEROOT=1 ;;
|
||||||
-g|--geninteg) GENINTEG=1 ;;
|
-g|--geninteg) GENINTEG=1 ;;
|
||||||
--holdver) HOLDVER=1 ;;
|
|
||||||
-i|--install) INSTALL=1 ;;
|
-i|--install) INSTALL=1 ;;
|
||||||
--key) shift; GPGKEY=$1 ;;
|
--key) shift; GPGKEY=$1 ;;
|
||||||
-L|--log) LOGGING=1 ;;
|
-L|--log) LOGGING=1 ;;
|
||||||
@ -2192,12 +2074,6 @@ SRCEXT=${_SRCEXT:-$SRCEXT}
|
|||||||
GPGKEY=${_GPGKEY:-$GPGKEY}
|
GPGKEY=${_GPGKEY:-$GPGKEY}
|
||||||
PACKAGER=${_PACKAGER:-$PACKAGER}
|
PACKAGER=${_PACKAGER:-$PACKAGER}
|
||||||
|
|
||||||
if (( HOLDVER )) && [[ -n $FORCE_VER ]]; then
|
|
||||||
# The '\\0' is here to prevent gettext from thinking --holdver is an option
|
|
||||||
error "$(gettext "\\0%s and %s cannot both be specified" )" "--holdver" "--forcever"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if (( ! INFAKEROOT )); then
|
if (( ! INFAKEROOT )); then
|
||||||
if (( EUID == 0 && ! ASROOT )); then
|
if (( EUID == 0 && ! ASROOT )); then
|
||||||
# Warn those who like to live dangerously.
|
# Warn those who like to live dangerously.
|
||||||
@ -2277,13 +2153,6 @@ check_sanity || exit 1
|
|||||||
# check we have the software required to process the PKGBUILD
|
# check we have the software required to process the PKGBUILD
|
||||||
check_software || exit 1
|
check_software || exit 1
|
||||||
|
|
||||||
# We need to run devel_update regardless of whether we are in the fakeroot
|
|
||||||
# build process so that if the user runs makepkg --forcever manually, we
|
|
||||||
# 1) output the correct pkgver, and 2) use the correct filename when
|
|
||||||
# checking if the package file already exists - fixes FS #9194
|
|
||||||
devel_check
|
|
||||||
devel_update
|
|
||||||
|
|
||||||
if (( ${#pkgname[@]} > 1 )); then
|
if (( ${#pkgname[@]} > 1 )); then
|
||||||
SPLITPKG=1
|
SPLITPKG=1
|
||||||
fi
|
fi
|
||||||
@ -2524,7 +2393,6 @@ else
|
|||||||
# if we are root or if fakeroot is not enabled, then we don't use it
|
# if we are root or if fakeroot is not enabled, then we don't use it
|
||||||
if ! check_buildenv "fakeroot" "y" || (( EUID == 0 )); then
|
if ! check_buildenv "fakeroot" "y" || (( EUID == 0 )); then
|
||||||
if (( ! REPKG )); then
|
if (( ! REPKG )); then
|
||||||
devel_update
|
|
||||||
(( BUILDFUNC )) && run_build
|
(( BUILDFUNC )) && run_build
|
||||||
(( CHECKFUNC )) && run_check
|
(( CHECKFUNC )) && run_check
|
||||||
fi
|
fi
|
||||||
@ -2546,7 +2414,6 @@ else
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if (( ! REPKG && ( PKGFUNC || SPLITPKG ) )); then
|
if (( ! REPKG && ( PKGFUNC || SPLITPKG ) )); then
|
||||||
devel_update
|
|
||||||
(( BUILDFUNC )) && run_build
|
(( BUILDFUNC )) && run_build
|
||||||
(( CHECKFUNC )) && run_check
|
(( CHECKFUNC )) && run_check
|
||||||
cd_safe "$startdir"
|
cd_safe "$startdir"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user