summaryrefslogtreecommitdiff
path: root/libremakepkg
diff options
context:
space:
mode:
Diffstat (limited to 'libremakepkg')
-rwxr-xr-xlibremakepkg22
1 files changed, 14 insertions, 8 deletions
diff --git a/libremakepkg b/libremakepkg
index e446833..b8d8c9a 100755
--- a/libremakepkg
+++ b/libremakepkg
@@ -32,6 +32,7 @@ function usage {
echo ' -h show this message.'
echo ' -c cleans the chroot before building.'
echo ' -u updates the chroot before building.'
+ echo ' -U copy pacman, makepkg, and mtag config files to the chroot'
echo ' -n use this dir instead of "${CHCOPY}".'
echo ' -M <--arg> passes long args to makepkg, use it as many times as needed.'
echo
@@ -44,11 +45,13 @@ function buildenv {
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 /$config to ${CHROOTDIR}/${CHCOPY}/${config}"
- cp --remove-destination /${config} ${CHROOTDIR}/${CHCOPY}/${config} || exit 1
- done
+
+ if [ "$update_config" = 'y']; then
+ for config in etc/makepkg.conf etc/pacman.conf etc/mtab; do
+ msg2 "copying config /$config to ${CHROOTDIR}/${CHCOPY}/${config}"
+ cp --remove-destination /${config} ${CHROOTDIR}/${CHCOPY}/${config} || exit 1
+ done
+ fi
}
# Clean packages with pacman
@@ -74,6 +77,7 @@ while [ "\$clean" = 'false' ]; do
done
EOF
) > "${CHROOTDIR}/${CHROOTNAME}/clean"
+ chmod +x "${CHROOTDIR}/${CHROOTNAME}/clean"
mkarchroot -r "/clean" "${CHROOTDIR}/${CHROOTNAME}"
}
@@ -102,9 +106,10 @@ UPDATE_FIRST="n"
USE_LOG='n'
CHROOTNAME=${CHCOPY}
MAKEPKG_ARGS=""
+update_config='n'
#libremakepkg own args
-libremakepkgargs='hcun:I:M:'
+libremakepkgargs='hcuUn:I:M:'
#now makepkg args
libremakepkgargs+='ACdefiLmop:rRs'
@@ -113,7 +118,8 @@ while getopts ${libremakepkgargs} arg ; do
h) usage; exit 0 ;;
c) CLEAN_FIRST="y" ;;
u) UPDATE_FIRST="y" ;;
- n) chrootname="$OPTARG"; echo $chrootname ;;
+ U) update_config='y'
+ n) CHROOTNAME="$OPTARG" ;;
M) MAKEPKG_ARGS+=" $OPTARG" ;;
L) MAKEPKG_ARGS+=" -$arg $OPTARG"
USE_LOG='y';;
@@ -150,7 +156,7 @@ if [ "${CLEAN_FIRST}" = y ]; then
fi
msg "Creating the package"
-makechrootpkg -r ${CHROOTDIR} -l "${CHROOTNAME}" -- ${MAKEPKG_ARGS}
+makechrootpkg -r "${CHROOTDIR}" -l "${CHROOTNAME}" -- "${MAKEPKG_ARGS}
ev=$? # exit value
[ "${USE_LOG}" == 'y' -a -e ${CHROOTDIR}/${CHROOTNAME}/build/*.log ] && {