xbps-src: cleanup version/revision mess.

This commit is contained in:
Juan RP 2011-07-18 16:25:18 +02:00
parent ac7c66d00a
commit 07db31cb54
15 changed files with 80 additions and 154 deletions

View file

@ -42,16 +42,10 @@ done
install_src_phase() install_src_phase()
{ {
local f i subpkg lver spkgrev local f i subpkg spkgrev
[ -z $pkgname ] && return 2 [ -z $pkgname ] && return 2
if [ -n "$revision" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
# #
# There's nothing we can do if we are a meta template. # There's nothing we can do if we are a meta template.
# Just creating the dir is enough to write the package metadata. # Just creating the dir is enough to write the package metadata.
@ -70,7 +64,7 @@ install_src_phase()
# Run pre_install func. # Run pre_install func.
if [ ! -f $XBPS_PRE_INSTALL_DONE ]; then if [ ! -f $XBPS_PRE_INSTALL_DONE ]; then
run_func pre_install run_func pre_install
msg_normal "'$pkgname-$lver': pre_install (destdir) phase done.\n" msg_normal "$pkgver: pre_install (destdir) phase done.\n"
touch -f $XBPS_PRE_INSTALL_DONE touch -f $XBPS_PRE_INSTALL_DONE
fi fi
@ -85,18 +79,18 @@ install_src_phase()
esac esac
cd ${wrksrc} || msg_error "can't change cwd to wrksrc!\n" cd ${wrksrc} || msg_error "can't change cwd to wrksrc!\n"
msg_normal "'$pkgname-$lver': install (destdir) phase done.\n" msg_normal "$pkgver: install (destdir) phase done.\n"
# Run post_install func. # Run post_install func.
if [ ! -f $XBPS_POST_INSTALL_DONE ]; then if [ ! -f $XBPS_POST_INSTALL_DONE ]; then
run_func post_install run_func post_install
msg_normal "'$pkgname-$lver': post_install (destdir) phase done.\n" msg_normal "$pkgver: post_install (destdir) phase done.\n"
touch -f $XBPS_POST_INSTALL_DONE touch -f $XBPS_POST_INSTALL_DONE
fi fi
# Remove libtool archives by default. # Remove libtool archives by default.
if [ -z "$keep_libtool_archives" ]; then if [ -z "$keep_libtool_archives" ]; then
msg_normal "'$pkgname-$lver': removing libtool archives...\n" msg_normal "$pkgver: removing libtool archives...\n"
find ${DESTDIR} -type f -name \*.la -delete find ${DESTDIR} -type f -name \*.la -delete
fi fi
# Always remove perllocal.pod and .packlist files. # Always remove perllocal.pod and .packlist files.
@ -106,10 +100,10 @@ install_src_phase()
fi fi
# Remove empty directories by default. # Remove empty directories by default.
if [ -z "$keep_empty_dirs" ]; then if [ -z "$keep_empty_dirs" ]; then
msg_normal "'$pkgname-$lver': removing empty dirs...\n" msg_normal "$pkgver: removing empty dirs...\n"
find ${DESTDIR} -depth -type d -exec rmdir 2>/dev/null {} \; find ${DESTDIR} -depth -type d -exec rmdir 2>/dev/null {} \;
fi fi
msg_normal "'$pkgname-$lver': installed into destdir.\n" msg_normal "$pkgver: installed into destdir.\n"
if [ "$build_style" != "custom-install" -a -z "$distfiles" ]; then if [ "$build_style" != "custom-install" -a -z "$distfiles" ]; then
touch -f $XBPS_INSTALL_DONE touch -f $XBPS_INSTALL_DONE
@ -128,7 +122,7 @@ install_src_phase()
if [ $? -eq 0 -a -z "$BOOTSTRAP_PKG_REBUILD" ]; then if [ $? -eq 0 -a -z "$BOOTSTRAP_PKG_REBUILD" ]; then
continue continue
fi fi
msg_normal "'${sourcepkg}-$lver': preparing subpackage '${subpkg}'...\n" msg_normal "$pkgver: preparing subpackage '${subpkg}'...\n"
if [ ! -f $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template ]; then if [ ! -f $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template ]; then
msg_error "Cannot find '${subpkg}' subpkg build template!\n" msg_error "Cannot find '${subpkg}' subpkg build template!\n"
fi fi
@ -139,7 +133,7 @@ install_src_phase()
run_func do_install run_func do_install
touch -f ${wrksrc}/.xbps_do_install_${pkgname}_done touch -f ${wrksrc}/.xbps_do_install_${pkgname}_done
else else
msg_warn "'$sourcepkg-$lver': skipping '$pkgname' subpkg, already installed into destdir.\n" msg_warn "$pkgver: skipping '$pkgname' subpkg, already installed into destdir.\n"
fi fi
done done
} }

View file

@ -37,7 +37,7 @@ do_make_build()
build_src_phase() build_src_phase()
{ {
local pkg="$pkgname-$version" f lver local f
[ -z $pkgname -o -z $version ] && return 1 [ -z $pkgname -o -z $version ] && return 1
@ -54,13 +54,6 @@ build_src_phase()
cd $build_wrksrc || return 1 cd $build_wrksrc || return 1
fi fi
if [ -n "$revision" ]; then
lver="${version}_${revision}"
pkg="${pkg}_${revision}"
else
lver="${version}"
fi
if [ "$build_style" = "python-module" ]; then if [ "$build_style" = "python-module" ]; then
make_cmd="python" make_cmd="python"
make_build_args="setup.py build" make_build_args="setup.py build"
@ -72,7 +65,7 @@ build_src_phase()
# Run pre_build func. # Run pre_build func.
if [ ! -f $XBPS_PRE_BUILD_DONE ]; then if [ ! -f $XBPS_PRE_BUILD_DONE ]; then
run_func pre_build run_func pre_build
msg_normal "'$pkgname-$lver': pre_build phase done.\n" msg_normal "$pkgver: pre_build phase done.\n"
touch -f $XBPS_PRE_BUILD_DONE touch -f $XBPS_PRE_BUILD_DONE
fi fi
@ -82,12 +75,12 @@ build_src_phase()
run_func do_make_build run_func do_make_build
fi fi
msg_normal "'$pkgname-$lver': build phase done.\n" msg_normal "$pkgver: build phase done.\n"
# Run post_build func. # Run post_build func.
if [ ! -f $XBPS_POST_BUILD_DONE ]; then if [ ! -f $XBPS_POST_BUILD_DONE ]; then
run_func post_build run_func post_build
msg_normal "'$pkgname-l$ver': post_build phase done.\n" msg_normal "$pkgver: post_build phase done.\n"
touch -f $XBPS_POST_BUILD_DONE touch -f $XBPS_POST_BUILD_DONE
fi fi

View file

@ -34,7 +34,7 @@ install_pkglist_from_repos()
cmd="${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} -Ay install" cmd="${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} -Ay install"
msg_normal "'$pkgname': installing required dependencies ...\n" msg_normal "$pkgver: installing required dependencies ...\n"
[ -z "${wrksrc}" ] && wrksrc="$XBPS_BUILDDIR/$pkgname" [ -z "${wrksrc}" ] && wrksrc="$XBPS_BUILDDIR/$pkgname"
[ ! -d "${wrksrc}" ] && mkdir -p "${wrksrc}" [ ! -d "${wrksrc}" ] && mkdir -p "${wrksrc}"
${cmd} ${1} >${wrksrc}/.xbps_install_dependencies.log 2>&1 ${cmd} ${1} >${wrksrc}/.xbps_install_dependencies.log 2>&1
@ -49,8 +49,8 @@ install_pkglist_from_repos()
# #
# Any other returned is criticial. # Any other returned is criticial.
autoremove_pkg_dependencies $KEEP_AUTODEPS autoremove_pkg_dependencies $KEEP_AUTODEPS
msg_red "'${pkgname}': failed to install required dependencies! (error $rval)\n" msg_red "$pkgver: failed to install required dependencies! (error $rval)\n"
msg_error "'${pkgname}': please take a look the logs in \$wrksrc.\n" msg_error "$pkgver': please take a look the logs in \$wrksrc.\n"
fi fi
return $rval return $rval
@ -68,7 +68,7 @@ install_pkg_from_repos()
pkgdepname=$($XBPS_PKGDB_CMD getpkgdepname "$pkg") pkgdepname=$($XBPS_PKGDB_CMD getpkgdepname "$pkg")
cmd="${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} -Ay install" cmd="${fakeroot_cmd} ${fakeroot_cmd_args} ${XBPS_BIN_CMD} -Ay install"
msg_normal "'$pkgname': installing required dependency '$pkg' ...\n" msg_normal "$pkgver: installing required dependency '$pkg' ...\n"
[ -z "${wrksrc}" ] && wrksrc="$XBPS_BUILDDIR/$pkgname" [ -z "${wrksrc}" ] && wrksrc="$XBPS_BUILDDIR/$pkgname"
[ ! -d "${wrksrc}" ] && mkdir -p "${wrksrc}" [ ! -d "${wrksrc}" ] && mkdir -p "${wrksrc}"
${cmd} "\"$pkg\"" >${wrksrc}/.xbps_install_dependency_${pkgdepname}.log 2>&1 ${cmd} "\"$pkg\"" >${wrksrc}/.xbps_install_dependency_${pkgdepname}.log 2>&1
@ -83,7 +83,7 @@ install_pkg_from_repos()
# #
# Any other returned is criticial. # Any other returned is criticial.
autoremove_pkg_dependencies $KEEP_AUTODEPS autoremove_pkg_dependencies $KEEP_AUTODEPS
msg_red "'${pkgname}': failed to install '${pkg}' dependency! (error $rval)\n" msg_red "$pkgver: failed to install '${pkg}' dependency! (error $rval)\n"
msg_error "Please see ${wrksrc}/.xbps_install_${pkgdepname}.log to see what went wrong!\n" msg_error "Please see ${wrksrc}/.xbps_install_${pkgdepname}.log to see what went wrong!\n"
fi fi
@ -102,11 +102,11 @@ autoremove_pkg_dependencies()
# package dependencies installed by the target package, do it. # package dependencies installed by the target package, do it.
# #
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then
msg_normal "'$pkgname': removing automatically installed dependencies ...\n" msg_normal "$pkgver: removing automatically installed dependencies ...\n"
# Autoremove installed binary packages. # Autoremove installed binary packages.
${cmd} -y reconfigure all && ${cmd} -Rpyf autoremove 2>&1 >/dev/null ${cmd} -y reconfigure all && ${cmd} -Rpyf autoremove 2>&1 >/dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
msg_red "'$pkgname': failed to remove automatic dependencies!\n" msg_red "$pkgver: failed to remove automatic dependencies!\n"
exit 1 exit 1
fi fi
# Maybe some dependency wasn't available in repositories and it had # Maybe some dependency wasn't available in repositories and it had
@ -149,9 +149,9 @@ install_pkg_deps()
[ $? -eq 0 ] && return 0 [ $? -eq 0 ] && return 0
if [ -z "$saved_prevpkg" -a -n "${_ORIGINPKG}" ]; then if [ -z "$saved_prevpkg" -a -n "${_ORIGINPKG}" ]; then
msg_normal "Installing '${_ORIGINPKG}' dependency: '$curpkg'.\n" msg_normal "Installing ${_ORIGINPKG} dependency: '$curpkg'.\n"
else else
msg_normal "Installing '$saved_prevpkg' dependency: '$curpkg'.\n" msg_normal "Installing $saved_prevpkg dependency: '$curpkg'.\n"
fi fi
setup_tmpl "$curpkgname" setup_tmpl "$curpkgname"
@ -196,9 +196,9 @@ install_pkg_deps()
install_pkg_deps "${j}" "${curpkg}" install_pkg_deps "${j}" "${curpkg}"
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
if [ -n "$saved_prevpkg" ]; then if [ -n "$saved_prevpkg" ]; then
msg_red "'$saved_prevpkg': failed to install dependency '$curpkg'\n" msg_red "$saved_prevpkg: failed to install dependency '$curpkg'\n"
else else
msg_red "'${_ORIGINPKG}': failed to install dependency '$curpkg'\n" msg_red "${_ORIGINPKG}: failed to install dependency '$curpkg'\n"
fi fi
return 1 return 1
fi fi
@ -213,19 +213,19 @@ install_pkg_deps()
# Package not found, build from source. # Package not found, build from source.
install_pkg "${curpkgname}" install_pkg "${curpkgname}"
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
msg_red "'$saved_prevpkg': failed to install dependency '$curpkg'\n" msg_red "$saved_prevpkg: failed to install dependency '$curpkg'\n"
return 1 return 1
fi fi
fi fi
else else
if [ -n "$saved_prevpkg" ]; then if [ -n "$saved_prevpkg" ]; then
msg_normal "'$saved_prevpkg': installing dependency '$curpkg'...\n" msg_normal "$saved_prevpkg: installing dependency '$curpkg'...\n"
else else
msg_normal "'${_ORIGINPKG}': installing dependency '$curpkg'...\n" msg_normal "${_ORIGINPKG}: installing dependency '$curpkg'...\n"
fi fi
install_pkg "${curpkgname}" install_pkg "${curpkgname}"
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
msg_red "'$saved_prevpkg': failed to install dependency '$curpkg'\n" msg_red "$saved_prevpkg: failed to install dependency '$curpkg'\n"
return 1 return 1
fi fi
fi fi
@ -239,20 +239,14 @@ install_dependencies_pkg()
{ {
local pkg="$1" rval local pkg="$1" rval
local lpkgname=$(${XBPS_PKGDB_CMD} getpkgname ${pkg}) local lpkgname=$(${XBPS_PKGDB_CMD} getpkgname ${pkg})
local i j pkgn iver reqver notinstalled_deps lver local i j pkgn iver reqver notinstalled_deps
[ -z "$pkg" ] && return 2 [ -z "$pkg" ] && return 2
[ -z "$build_depends" ] && return 0 [ -z "$build_depends" ] && return 0
INSTALLING_DEPS=1 INSTALLING_DEPS=1
if [ -n "$revision" ]; then msg_normal "$pkgver: required build dependencies...\n"
lver="${version}_${revision}"
else
lver="${version}"
fi
msg_normal "'$pkgname-$lver': required build dependencies...\n"
for i in ${build_depends}; do for i in ${build_depends}; do
pkgn="$($XBPS_PKGDB_CMD getpkgdepname ${i})" pkgn="$($XBPS_PKGDB_CMD getpkgdepname ${i})"
@ -270,7 +264,7 @@ install_dependencies_pkg()
# Install direct build dependencies from binary packages. # Install direct build dependencies from binary packages.
if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then if [ -n "$XBPS_PREFER_BINPKG_DEPS" -a -z "$bootstrap" ]; then
msg_normal "'$pkg': installing dependencies from repositories ...\n" msg_normal "$pkgver: installing dependencies from repositories ...\n"
for i in ${notinstalled_deps}; do for i in ${notinstalled_deps}; do
if [ -z "$pkglist" ]; then if [ -z "$pkglist" ]; then
pkglist="\"$i\"" pkglist="\"$i\""

View file

@ -28,33 +28,20 @@
# #
run_func_error() run_func_error()
{ {
local lver func="$1" local func="$1"
remove_pkgdestdir_sighandler ${pkgname} $KEEP_AUTODEPS remove_pkgdestdir_sighandler ${pkgname} $KEEP_AUTODEPS
if [ -n "${revision}" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
echo echo
msg_error "${pkgname}-${lver}: '$func' interrupted!\n" msg_error "$pkgver: '$func' interrupted!\n"
} }
remove_pkgdestdir_sighandler() remove_pkgdestdir_sighandler()
{ {
local lver subpkg _pkgname="$1" _kwrksrc="$2" local subpkg _pkgname="$1" _kwrksrc="$2"
setup_tmpl ${_pkgname} setup_tmpl ${_pkgname}
[ -z "$sourcepkg" ] && return 0 [ -z "$sourcepkg" ] && return 0
if [ -n "${revision}" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
# If there is any problem in the middle of writting the metadata, # If there is any problem in the middle of writting the metadata,
# just remove all files from destdir of pkg. # just remove all files from destdir of pkg.
@ -69,7 +56,7 @@ remove_pkgdestdir_sighandler()
if [ -d "$XBPS_DESTDIR/${sourcepkg}-${version%_*}" ]; then if [ -d "$XBPS_DESTDIR/${sourcepkg}-${version%_*}" ]; then
rm -rf "$XBPS_DESTDIR/${sourcepkg}-${version%_*}" rm -rf "$XBPS_DESTDIR/${sourcepkg}-${version%_*}"
msg_red "'${sourcepkg}-${lver}': removed files from DESTDIR...\n" msg_red "$pkgver: removed files from DESTDIR...\n"
fi fi
autoremove_pkg_dependencies ${_kwrksrc} autoremove_pkg_dependencies ${_kwrksrc}
@ -94,16 +81,10 @@ var_is_a_function()
run_func() run_func()
{ {
local func="$1" local func="$1"
local lver rval logpipe logfile local rval logpipe logfile
[ -z "$func" ] && return 1 [ -z "$func" ] && return 1
if [ -n "$revision" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
var_is_a_function $func var_is_a_function $func
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
logpipe=/tmp/logpipe.$$ logpipe=/tmp/logpipe.$$
@ -118,7 +99,7 @@ run_func()
exec 1>"$logpipe" 2>"$logpipe" exec 1>"$logpipe" 2>"$logpipe"
set -e set -e
trap "run_func_error $func && return $?" INT trap "run_func_error $func && return $?" INT
msg_normal "'$pkgname-$lver': running $func phase...\n" msg_normal "$pkgver: running $func phase...\n"
$func 2>&1 $func 2>&1
rval=$? rval=$?
set +e set +e
@ -126,7 +107,7 @@ run_func()
exec 1>&3 2>&3 3>&- exec 1>&3 2>&3 3>&-
rm -f "$logpipe" rm -f "$logpipe"
if [ $rval -ne 0 ]; then if [ $rval -ne 0 ]; then
msg_error "${pkgname}-${lver}: $func failed!\n" msg_error "$pkgver: $func failed!\n"
fi fi
fi fi
return 255 # function not found. return 255 # function not found.

View file

@ -62,7 +62,7 @@ do_perl_configure()
configure_src_phase() configure_src_phase()
{ {
local f lver local f
[ -z $pkgname ] && return 1 [ -z $pkgname ] && return 1
# #
@ -74,18 +74,12 @@ configure_src_phase()
"$build_style" = "gnu_makefile" -o \ "$build_style" = "gnu_makefile" -o \
"$build_style" = "python-module" ] && return 0 "$build_style" = "python-module" ] && return 0
if [ -n "$revision" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
cd $wrksrc || msg_error "unexistent build directory [$wrksrc].\n" cd $wrksrc || msg_error "unexistent build directory [$wrksrc].\n"
# Run pre_configure func. # Run pre_configure func.
if [ ! -f $XBPS_PRECONFIGURE_DONE ]; then if [ ! -f $XBPS_PRECONFIGURE_DONE ]; then
run_func pre_configure run_func pre_configure
msg_normal "'$pkgname-$lver': pre_configure phase done.\n" msg_normal "$pkgver: pre_configure phase done.\n"
touch -f $XBPS_PRECONFIGURE_DONE touch -f $XBPS_PRECONFIGURE_DONE
fi fi
@ -108,15 +102,15 @@ configure_src_phase()
# #
# Unknown build_style type won't work :-) # Unknown build_style type won't work :-)
# #
msg_error "'$pkgname-$lver': unknown build_style [$build_style]\n" msg_error "$pkgver: unknown build_style [$build_style]\n"
fi fi
msg_normal "'$pkgname-$lver': configure phase done.\n" msg_normal "$pkgver: configure phase done.\n"
# Run post_configure func. # Run post_configure func.
if [ ! -f $XBPS_POSTCONFIGURE_DONE ]; then if [ ! -f $XBPS_POSTCONFIGURE_DONE ]; then
run_func post_configure run_func post_configure
msg_normal "'$pkgname-$lver': post_configure phase done.\n" msg_normal "$pkgver: post_configure phase done.\n"
touch -f $XBPS_POSTCONFIGURE_DONE touch -f $XBPS_POSTCONFIGURE_DONE
fi fi

View file

@ -29,7 +29,7 @@
# #
extract_distfiles() extract_distfiles()
{ {
local pkg="$1" curfile cursufx f lver local pkg="$1" curfile cursufx f
[ -f $XBPS_EXTRACT_DONE ] && return 0 [ -f $XBPS_EXTRACT_DONE ] && return 0
[ -z "$IN_CHROOT" -a ! -w $XBPS_BUILDDIR ] && \ [ -z "$IN_CHROOT" -a ! -w $XBPS_BUILDDIR ] && \
@ -40,11 +40,6 @@ extract_distfiles()
# #
[ -n "$pkg" -a -z "$pkgname" ] && return 1 [ -n "$pkg" -a -z "$pkgname" ] && return 1
if [ -n "$revision" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
# #
# If noextract is set, do a "fake extraction". # If noextract is set, do a "fake extraction".
# #
@ -67,7 +62,7 @@ extract_distfiles()
mkdir -p ${wrksrc} || return 1 mkdir -p ${wrksrc} || return 1
fi fi
msg_normal "'$pkgname-$lver': extracting distfile(s), please wait...\n" msg_normal "$pkgver: extracting distfile(s), please wait...\n"
for f in ${distfiles}; do for f in ${distfiles}; do
curfile=$(basename $f) curfile=$(basename $f)

View file

@ -1,5 +1,5 @@
#- #-
# Copyright (c) 2008-2010 Juan Romero Pardines. # Copyright (c) 2008-2011 Juan Romero Pardines.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -34,7 +34,7 @@ verify_sha256_cksum()
[ -z "$file" -o -z "$cksum" ] && return 1 [ -z "$file" -o -z "$cksum" ] && return 1
msg_normal "'$pkgname-$lver': verifying checksum for distfile '$file'... " msg_normal "$pkgver: verifying checksum for distfile '$file'... "
filesum=$(${XBPS_DIGEST_CMD} $XBPS_SRCDISTDIR/$file) filesum=$(${XBPS_DIGEST_CMD} $XBPS_SRCDISTDIR/$file)
if [ "$origsum" != "$filesum" ]; then if [ "$origsum" != "$filesum" ]; then
echo echo
@ -63,12 +63,6 @@ fetch_distfiles()
# If nofetch is set in a build template, skip this phase # If nofetch is set in a build template, skip this phase
# entirely and run the do_fetch() function. # entirely and run the do_fetch() function.
# #
if [ -n "$revision" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
if [ -n "$nofetch" ]; then if [ -n "$nofetch" ]; then
cd ${XBPS_BUILDDIR} cd ${XBPS_BUILDDIR}
[ -n "$build_wrksrc" ] && mkdir -p "$wrksrc" [ -n "$build_wrksrc" ] && mkdir -p "$wrksrc"
@ -104,7 +98,7 @@ fetch_distfiles()
fi fi
fi fi
msg_normal "'$pkgname-$lver': fetching distfile '$curfile'...\n" msg_normal "$pkgver: fetching distfile '$curfile'...\n"
if [ -n "$distfiles" ]; then if [ -n "$distfiles" ]; then
localurl="$f" localurl="$f"
@ -149,5 +143,5 @@ fetch_distfiles()
dfcount=$(($dfcount + 1)) dfcount=$(($dfcount + 1))
done done
unset lver cksum found unset cksum found
} }

View file

@ -59,7 +59,7 @@ binpkg_cleanup()
# #
xbps_make_binpkg_real() xbps_make_binpkg_real()
{ {
local mfiles binpkg pkgdir arch lver dirs _dirs d clevel local mfiles binpkg pkgdir arch dirs _dirs d clevel
if [ ! -d "${DESTDIR}" ]; then if [ ! -d "${DESTDIR}" ]; then
msg_warn "cannot find destdir for $pkgname... skipping!\n" msg_warn "cannot find destdir for $pkgname... skipping!\n"
@ -72,12 +72,7 @@ xbps_make_binpkg_real()
else else
arch=$xbps_machine arch=$xbps_machine
fi fi
if [ -n "$revision" ]; then binpkg=$pkgver.$arch.xbps
lver="${version}_${revision}"
else
lver="${version}"
fi
binpkg=$pkgname-$lver.$arch.xbps
pkgdir=$XBPS_PACKAGESDIR/$arch pkgdir=$XBPS_PACKAGESDIR/$arch
# #
# Don't overwrite existing binpkgs by default, skip them. # Don't overwrite existing binpkgs by default, skip them.

View file

@ -109,7 +109,7 @@ xbps_write_metadata_pkg_real()
fi fi
# Add info-files trigger. # Add info-files trigger.
triggers="info-files $triggers" triggers="info-files $triggers"
msg_normal "'$pkgname-$lver': processing info(1) files...\n" msg_normal "$pkgver: processing info(1) files...\n"
find ${DESTDIR}/usr/share/info -type f -follow | while read f find ${DESTDIR}/usr/share/info -type f -follow | while read f
do do
@ -144,7 +144,7 @@ xbps_write_metadata_pkg_real()
# compress all them with gzip. # compress all them with gzip.
# #
if [ -d "${DESTDIR}/usr/share/man" ]; then if [ -d "${DESTDIR}/usr/share/man" ]; then
msg_normal "'$pkgname-$lver': processing manual pages...\n" msg_normal "$pkgver: processing manual pages...\n"
find ${DESTDIR}/usr/share/man -type f -follow | while read f find ${DESTDIR}/usr/share/man -type f -follow | while read f
do do
j=$(echo "$f"|sed -e "$fpattern") j=$(echo "$f"|sed -e "$fpattern")
@ -170,7 +170,7 @@ xbps_write_metadata_pkg_real()
TMPFLIST=$(mktemp -t flist.XXXXXXXXXX) || exit 1 TMPFLIST=$(mktemp -t flist.XXXXXXXXXX) || exit 1
TMPFPLIST=$(mktemp -t fplist.XXXXXXXXXX) || exit 1 TMPFPLIST=$(mktemp -t fplist.XXXXXXXXXX) || exit 1
msg_normal "'$pkgname-$lver': creating package metadata...\n" msg_normal "$pkgver: creating package metadata...\n"
cat > "$TMPFPLIST" <<_EOF cat > "$TMPFPLIST" <<_EOF
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
@ -275,7 +275,7 @@ _EOF
<key>version</key> <key>version</key>
<string>$lver</string> <string>$lver</string>
<key>pkgver</key> <key>pkgver</key>
<string>$pkgname-$lver</string> <string>$pkgver</string>
<key>architecture</key> <key>architecture</key>
<string>$arch</string> <string>$arch</string>
<key>installed_size</key> <key>installed_size</key>
@ -416,5 +416,5 @@ _EOF
xbps_write_metadata_scripts_pkg remove; \ xbps_write_metadata_scripts_pkg remove; \
} || return $? } || return $?
msg_normal "'$pkgname-$lver': successfully created package metadata.\n" msg_normal "$pkgver: successfully created package metadata.\n"
} }

View file

@ -1,5 +1,5 @@
#- #-
# Copyright (c) 2008-2010 Juan Romero Pardines. # Copyright (c) 2008-2011 Juan Romero Pardines.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -25,11 +25,11 @@
# #
# Applies to the build directory all patches found in PATCHESDIR # Applies to the build directory all patches found in PATCHESDIR
# (templates/$pkgname/patches). # (srcpkgs/$pkgname/patches).
# #
_process_patch() _process_patch()
{ {
local lver args _patch i=$1 local args _patch i=$1
args="-Np0" args="-Np0"
_patch=$(basename $i) _patch=$(basename $i)
@ -40,12 +40,6 @@ _process_patch()
fi fi
cp -f $i $wrksrc cp -f $i $wrksrc
if [ -n "$revision" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
# Try to guess if its a compressed patch. # Try to guess if its a compressed patch.
if $(echo $i|grep -q '.diff.gz'); then if $(echo $i|grep -q '.diff.gz'); then
gunzip $wrksrc/${_patch} gunzip $wrksrc/${_patch}
@ -64,15 +58,15 @@ _process_patch()
elif $(echo $i|grep -q '.patch'); then elif $(echo $i|grep -q '.patch'); then
: :
else else
msg_warn "'$pkgname-$lver': unknown patch type: $i.\n" msg_warn "$pkgver: unknown patch type: $i.\n"
continue continue
fi fi
cd $wrksrc && patch -s ${args} < ${_patch} 2>/dev/null cd $wrksrc && patch -s ${args} < ${_patch} 2>/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
msg_normal "'$pkgname-$lver': Patch applied: ${_patch}.\n" msg_normal "$pkgver: Patch applied: ${_patch}.\n"
else else
msg_error "'$pkgname-$lver': couldn't apply patch: ${_patch}.\n" msg_error "'$pkgver: couldn't apply patch: ${_patch}.\n"
fi fi
} }
@ -87,7 +81,7 @@ apply_tmpl_patches()
_process_patch "$PATCHESDIR/$f" _process_patch "$PATCHESDIR/$f"
done done
else else
for f in $(echo $PATCHESDIR/*); do for f in $PATCHESDIR/*; do
if $(echo $f|grep -q '.args'); then if $(echo $f|grep -q '.args'); then
continue continue
fi fi

View file

@ -88,7 +88,7 @@ stow_pkg_real()
else else
lver="${version}" lver="${version}"
fi fi
msg_normal "'${pkgname}-$lver': stowning files into masterdir, please wait...\n" msg_normal "$pkgver: stowning files into masterdir, please wait...\n"
# Copy files into masterdir. # Copy files into masterdir.
for i in $(find -print); do for i in $(find -print); do

View file

@ -1,5 +1,5 @@
#- #-
# Copyright (c) 2010 Juan Romero Pardines. # Copyright (c) 2010-2011 Juan Romero Pardines.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -40,18 +40,10 @@ strip_files()
strip_files_real() strip_files_real()
{ {
local lver
[ -n "$nostrip" -o -n "$noarch" ] && return 0 [ -n "$nostrip" -o -n "$noarch" ] && return 0
[ -z "$strip_cmd" ] && strip_cmd=strip [ -z "$strip_cmd" ] && strip_cmd=strip
if [ -n "$revision" ]; then msg_normal "$pkgver: stripping files, please wait...\n"
lver="${version}_${revision}"
else
lver="${version}"
fi
msg_normal "'$pkgname-$lver': stripping files, please wait...\n"
find ${DESTDIR} -type f | while read f; do find ${DESTDIR} -type f | while read f; do
case "$(file -bi "$f")" in case "$(file -bi "$f")" in
application/x-executable*) application/x-executable*)

View file

@ -30,7 +30,7 @@ info_tmpl()
{ {
local i= local i=
for f in $(echo $XBPS_COMMONVARSDIR/*.sh); do for f in $XBPS_COMMONVARSDIR/*.sh; do
[ -r ${f} ] && . ${f} [ -r ${f} ] && . ${f}
done done
@ -101,7 +101,7 @@ reset_tmpl_vars()
noarch subpackages sourcepkg gtk_iconcache_dirs \ noarch subpackages sourcepkg gtk_iconcache_dirs \
abi_depends api_depends triggers openrc_services \ abi_depends api_depends triggers openrc_services \
replaces system_accounts system_groups provides \ replaces system_accounts system_groups provides \
build_wrksrc create_wrksrc broken_as_needed \ build_wrksrc create_wrksrc broken_as_needed pkgver \
ignore_vdeps_dir noverifyrdeps conflicts dkms_modules \ ignore_vdeps_dir noverifyrdeps conflicts dkms_modules \
gconf_entries gconf_schemas stow_copy stow_copy_files \ gconf_entries gconf_schemas stow_copy stow_copy_files \
pre_remove post_remove post_stow do_build do_install \ pre_remove post_remove post_stow do_build do_install \
@ -126,7 +126,7 @@ setup_tmpl()
[ -n "$DESTDIR" ] && return 0 [ -n "$DESTDIR" ] && return 0
fi fi
for f in $(echo $XBPS_COMMONVARSDIR/*.sh); do for f in $XBPS_COMMONVARSDIR/*.sh; do
[ -r ${f} ] && . ${f} [ -r ${f} ] && . ${f}
done done
@ -293,7 +293,7 @@ remove_tmpl_wrksrc()
return 0 return 0
fi fi
msg_normal "Cleaning '${sourcepkg}' build directory...\n" msg_normal "$pkgver: cleaning build directory...\n"
rm -rf $lwrksrc rm -rf $lwrksrc
return $? return $?
} }
@ -302,6 +302,12 @@ set_tmpl_common_vars()
{ {
[ -z "$pkgname" ] && return 1 [ -z "$pkgname" ] && return 1
if [ -n "$revision" ]; then
pkgver="${pkgname}-${version}_${revision}"
else
pkgver="${pkgname}-${version}"
fi
. $XBPS_SHUTILSDIR/install_files.sh . $XBPS_SHUTILSDIR/install_files.sh
if [ -n "$BOOTSTRAP_PKG_REBUILD" ]; then if [ -n "$BOOTSTRAP_PKG_REBUILD" ]; then

View file

@ -44,20 +44,14 @@ find_rundep()
verify_rundeps() verify_rundeps()
{ {
local j i f nlib verify_deps maplib found_dup igndir lver local j i f nlib verify_deps maplib found_dup igndir
local missing missing_libs rdep builddep rdep_list builddep_list local missing missing_libs rdep builddep rdep_list builddep_list
PKG_DESTDIR="$1" PKG_DESTDIR="$1"
maplib="$XBPS_COMMONVARSDIR/mapping_shlib_binpkg.txt" maplib="$XBPS_COMMONVARSDIR/mapping_shlib_binpkg.txt"
if [ -n "$revision" ]; then
lver="${version}_${revision}"
else
lver="${version}"
fi
[ -n "$noarch" -o -n "$noverifyrdeps" ] && return 0 [ -n "$noarch" -o -n "$noverifyrdeps" ] && return 0
msg_normal "'$pkgname-$lver': verifying required run dependencies, please wait...\n" msg_normal "$pkgver: verifying required run dependencies, please wait...\n"
depsftmp=$(mktemp -t xbps_src_depstmp.XXXXXXXXXX) || exit 1 depsftmp=$(mktemp -t xbps_src_depstmp.XXXXXXXXXX) || exit 1
find ${PKG_DESTDIR} -type f -perm -u+w > $depsftmp 2>/dev/null find ${PKG_DESTDIR} -type f -perm -u+w > $depsftmp 2>/dev/null
@ -194,5 +188,5 @@ verify_rundeps()
done done
echo "============ CUT HERE ===============" echo "============ CUT HERE ==============="
msg_error "'${pkgname}-${lver}': incorrect run dependencies, won't continue...\n" msg_error "$pkgver: incorrect run dependencies, won't continue...\n"
} }

View file

@ -273,7 +273,7 @@ if [ -n "${_MASTERDIR}" ]; then
fi fi
. @@XBPS_INSTALL_SHAREDIR@@/shutils/init_funcs.sh . @@XBPS_INSTALL_SHAREDIR@@/shutils/init_funcs.sh
set_defvars set_defvars
for f in $(echo @@XBPS_INSTALL_SHAREDIR@@/shutils/*.sh); do for f in $(echo $XBPS_SHUTILSDIR/*.sh); do
[ -r "$f" ] && . $f [ -r "$f" ] && . $f
done done