add repodir, move pkgs

This commit is contained in:
artoo 2014-10-05 21:27:37 +02:00
parent b7a9945ef4
commit efdd0924dc
2 changed files with 56 additions and 51 deletions

View file

@ -51,6 +51,12 @@ else
profiledir='@sysconfdir@/sets'
fi
if [[ -n ${repodir} ]];then
repodir=${repodir}
else
repodir='/opt'
fi
if [[ -r /etc/makepkg.conf ]]; then
. /etc/makepkg.conf
fi
@ -78,8 +84,8 @@ repo=false
base_packages=('base-devel')
mkmanjaroroot_args=()
makechrootpkg_args=()
mkchroot_args=()
mkchrootpkg_args=()
makepkg_args=()
profiles=$(get_profiles)
@ -138,20 +144,16 @@ makepkg_conf="@pkgdatadir@/makepkg-${arch}.conf"
chrootdir=${chroots}/${branch}-${arch}
if ${nosystemd};then
mkmanjaroroot_args+=(-x)
mkchroot_args+=(-x)
fi
if ${namcap};then
makechrootpkg_args+=(-n)
mkchrootpkg_args+=(-n)
fi
# if ${repo};then
# makechrootpkg_args+=(-d)
# fi
mkchroot_args+=(-C ${pacman_conf} -M ${makepkg_conf} -b ${branch})
mkmanjaroroot_args+=(-C ${pacman_conf} -M ${makepkg_conf} -b ${branch})
makechrootpkg_args+=(-b ${branch} -r ${chrootdir})
mkchrootpkg_args+=(-b ${branch} -r ${chrootdir})
makepkg_args+=("${*:$OPTIND}")
@ -167,10 +169,10 @@ if ${verbose};then
msg2 "pacman_conf: ${pacman_conf}"
msg2 "makepkg_conf: $makepkg_conf"
msg "mkmanjaroroot:"
msg2 "args: ${mkmanjaroroot_args[*]}"
msg "mkchroot:"
msg2 "args: ${mkchroot_args[*]}"
msg "makechrootpkg:"
msg2 "args: ${makechrootpkg_args[*]}"
msg2 "args: ${mkchrootpkg_args[*]}"
msg "makepkg:"
msg2 "args: ${makepkg_args[*]}"
@ -186,6 +188,7 @@ if ${verbose};then
msg2 "base_packages: ${base_packages[*]}"
msg2 "pkgdir: ${pkgdir}"
msg2 "PKGDEST: ${PKGDEST}"
msg2 "repodir: ${repodir}"
fi

View file

@ -8,48 +8,50 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# cp_profile_pkgs(){
# for pkg in $(cat ${profiledir}/$1.set); do
# cp_pkg $pkg
# done
# }
#
# cp_pkg(){
# msg2 "Copying $1 to ${pkgdir}"
# cd $1
# cp ${misc_args[*]} *.pkg.tar.xz ${pkgdir}
# cd ..
# }
#
# cp_pkgs(){
# msg "Copying packages ..."
# eval "case ${profile} in
# $profiles)
# cp_profile_pkgs ${profile}
# ;;
# *)
# cp_pkg ${profile}
# ;;
# esac"
# msg "Finished copying"
# }
mv_profile_pkgs(){
for pkg in $(cat ${profiledir}/$1.set); do
mv_pkg $pkg
done
}
repo_create(){
cd ${pkgdir}
repo-add ${pkgdir##*/}.db.tar.xz *.pkg.tar.xz
mv_pkg(){
msg2 "Copying $1 to ${pkgdir}"
cd $1
mv -v *.pkg.tar.xz ${pkgdir}
cd ..
}
#cp_pkgs ${profile}
mv_pkgs(){
msg "Copying packages ..."
if ${is_profile};then
mv_profile_pkgs ${profile}
else
mv_pkg ${profile}
fi
msg "Finished copying"
}
if ${repo}; then
cd ${pkgdir}
repo_create
cd ..
fi
repo_create(){
for p in ${pkgdir}/*.pkg.tar.xz; do
ln -sv $p ${repodir}/$p
done
repo-add ${repodir##*/}.db.tar.xz *.pkg.tar.xz
}
if ! ${pretend};then
mv_pkgs ${profile}
if ${repo}; then
cd ${pkgdir}
repo_create
cd ..
fi
if ${sign}; then
cd ${pkgdir}
signpkgs
cd ..
fi
if ${sign}; then
cd ${pkgdir}
signpkgs
cd ..
fi