source ../config/urls
source ../functions/gztobz2
+# Ownership of downloaded files
+FPKG_USER="root"
+FPKG_GROUP="users"
+
LFS_PKG_BASE="$(dirname $(pwd))/packages"
LFS_PKG_DIR="${LFS_PKG_BASE}/${LFS_STAGE}"
LFS_PATCHES_DIR="${LFS_PKG_BASE}/${LFS_STAGE}/patches"
--output-document=${DESTDIR}/${SOURCE}.part
wget_status=$?
+ chown ${FPKG_USER}:${FPKG_GROUP} ${DESTDIR}/${SOURCE}.part
+ chmod 664 ${DESTDIR}/${SOURCE}.part
+
# Append log to global log file
cat ${WGET_LOG_FILE} >> ${LFS_LOG_FILE}
# Rename temporary file to final name
mv ${DESTDIR}/${SOURCE}{.part,}
+ chown ${FPKG_USER}:${FPKG_GROUP} ${DESTDIR}/${SOURCE}
+ chmod 664 ${DESTDIR}/${SOURCE}
return 0
}
# Then create destination directory if it does not exists.
if [ ! -d ${LFS_PKG_DIR} ]; then
- install -v -m755 -d ${LFS_PKG_DIR} 1> ${LFS_LOG_FILE} 2>&1 || exit 1
+ install -v -m775 -o ${FPKG_USER} -g ${FPKG_GROUP} \
+ -d ${LFS_PKG_DIR} 1> ${LFS_LOG_FILE} 2>&1 || exit 1
fi
# Create patches destination directory if it does not exists.
if [ ! -d ${LFS_PATCHES_DIR} ]; then
- install -v -m755 -d ${LFS_PATCHES_DIR} 1> ${LFS_LOG_FILE} 2>&1 || exit 1
+ install -v -m775 -o ${FPKG_USER} -g ${FPKG_GROUP} \
+ -d ${LFS_PATCHES_DIR} 1> ${LFS_LOG_FILE} 2>&1 || exit 1
fi
if [ -n "${TEST_INTEGRITY}" ]; then