summaryrefslogtreecommitdiff
path: root/libremakepkg
diff options
context:
space:
mode:
Diffstat (limited to 'libremakepkg')
-rwxr-xr-xlibremakepkg12
1 files changed, 6 insertions, 6 deletions
diff --git a/libremakepkg b/libremakepkg
index 6b996dc..ef276f3 100755
--- a/libremakepkg
+++ b/libremakepkg
@@ -39,13 +39,15 @@ usage() {
}
CLEAN=""
+CLEAN_CACHE=""
update_first=0
chrootname=${CHCOPY}
-while getopts 'hcun' arg; do
+while getopts 'hcCun' arg; do
case "${arg}" in
h) usage ;;
c) CLEAN="-c" ;;
+ C) CLEAN_CACHE="-C"
u) update_first=1 ;;
n) chrootname="$OPTARG" ;;
*) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;;
@@ -62,17 +64,15 @@ pkgbuild-check-nonfree ||{
fi
}
-mount -o bind ${CACHEDIR} \
- ${CHROOTDIR}/${chrootname}/var/cache/pacman/pkg || exit 1
-
if [ $update_first -eq 1 ]; then
msg "Updating the main chroot"
- mkarchroot $CLEAN ${CACHEDIR} -u -- ${CHROOTDIR}/${CHROOT}
+ # -c option in mkarchroot indicates cache
+ mkarchroot -c ${CACHEDIR} -u -- ${CHROOTDIR}/${CHROOT}
fi
msg "Creating the package"
-makechrootpkg $CLEAN -r ${CHROOTDIR} -l ${chrootname} -- $MAKEPKG_ARGS
+makechrootpkg $CLEAN -r ${CHROOTDIR} -l ${chrootname} -- $CLEAN_CACHE $MAKEPKG_ARGS
umount ${CHROOTDIR}/${chrootname}/var/cache/pacman/pkg