summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlibremakepkg27
1 files changed, 10 insertions, 17 deletions
diff --git a/libremakepkg b/libremakepkg
index 1b0776b..98adb80 100755
--- a/libremakepkg
+++ b/libremakepkg
@@ -33,7 +33,6 @@ function usage {
echo ' -c cleans the chroot before building.'
echo ' -u updates the chroot before building.'
echo ' -n use this dir instead of "${CHCOPY}".'
- echo ' -I <pkg> install this package, use it as many times needed.'
echo ' -M <--arg> passes long args to makepkg, use it as many times as needed.'
echo
}
@@ -41,14 +40,14 @@ function usage {
function buildenv {
msg "Building env"
for mp in ${SRCDEST} ${PKGDEST} ${SRCPKGDEST} ${WORKDIR}; do
- msg2 "binding /$mp"
+ msg2 "binding ${mp} to ${CHROOTDIR}/${CHCOPY}${mp}"
mkdir -p "${CHROOTDIR}/${CHCOPY}${mp}"
mount -o bind ${mp} "${CHROOTDIR}/${CHCOPY}${mp}" || exit 1
done
for config in etc/makepkg.conf etc/pacman.conf etc/mtab; do
- msg2 "copying config /$etc"
- cp --remove-destination /$etc $CHROOTDIR/$CHCOPY/$etc || exit 1
+ msg2 "copying config /$config to ${CHROOTDIR}/${CHCOPY}/${config}"
+ cp --remove-destination /${config} ${CHROOTDIR}/${CHCOPY}/${config} || exit 1
done
}
@@ -76,7 +75,6 @@ CLEAN_CACHE=""
UPDATE_FIRST="n"
USE_LOG='n'
CHROOTNAME=${CHCOPY}
-PKGINSTALL=""
MAKEPKG_ARGS=""
#libremakepkg own args
@@ -88,12 +86,11 @@ while getopts ${libremakepkgargs} arg ; do
case "${arg}" in
h) usage; exit 0 ;;
c) CLEAN_FIRST="y" ;;
- u) update_first="y" ;;
+ u) UPDATE_FIRST="y" ;;
n) chrootname="$OPTARG"; echo $chrootname ;;
- I) PKGINSTALL+="-I $OPTARG " ;;
M) MAKEPKG_ARGS+=" $OPTARG" ;;
L) MAKEPKG_ARGS+=" -$arg $OPTARG"
- use_log='y';;
+ USE_LOG='y';;
*) MAKEPKG_ARGS+=" -$arg $OPTARG" ;;
esac
done
@@ -113,14 +110,17 @@ pkgbuild-check-nonfree ||{
fi
}
+buildenv
+
if [ "${UPDATE_FIRST}" = y ]; then
- msg "Updating the chroot in use"
+ msg "Updating the chroot in use..."
# -c option in mkarchroot indicates cache
mkarchroot -c ${CACHEDIR} -u "${CHROOTDIR}/${CHROOTNAME}"
fi
if [ "${CLEAN_FIRST}" = y ]; then
msg "Cleaning ..."
+ plain "making list of packages in ${CHROOTDIR}/${CHROOTNAME}/root/"
cp "/etc/libretools.d/cleansystem" "${CHROOTDIR}/${CHROOTNAME}/root/"
(cat <<EOF
#!/bin/bash
@@ -132,17 +132,10 @@ pkgs=($(comm -23 <(pacman -Qq | sort) <(sort /root/cleansystem)))
EOF
) > "${CHROOTDIR}/${CHROOTNAME}/clean"
- mkarchroot -r "/clean" "${CHROOTDIR}/${CHROOTNAME}"
-
-fi
+ mkarchroot -r "/clean" "${CHROOTDIR}/${CHROOTNAME}"
-if [ -n ${PKGINSTALL} ]; then
- msg "Installing packages"
- makechrootpkg -r ${PKGINSTALL} "${CHROOTDIR}/${CHROOTNAME}"
fi
-buildenv
-
msg "Creating the package"
makechrootpkg -r ${CHROOTDIR} -l "${chrootname}" -- ${MAKEPKG_ARGS}
ev=$? # exit value