Compare commits
8 Commits
f4149ccf2b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| d699548ff9 | |||
| 9f67a83aff | |||
| 00da5457d0 | |||
| a913782426 | |||
| 2f5035a935 | |||
| 8ba540df51 | |||
| 080a96991d | |||
| 2e0f83e4f5 |
54
repo.sh
54
repo.sh
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CONFIG_DIR="${HOME}/.config/vur"
|
CONFIG_DIR="/voidpkg/vur"
|
||||||
CONFIG_FILE="vur.conf"
|
CONFIG_FILE="vur.conf"
|
||||||
KEY_FILE="privkey.pem"
|
KEY_FILE="privkey.pem"
|
||||||
KEY_PATH="${CONFIG_DIR}/${KEY_FILE}"
|
KEY_PATH="${CONFIG_DIR}/${KEY_FILE}"
|
||||||
@@ -19,15 +19,36 @@ get_void_pkgs(){
|
|||||||
read vpkgs_location
|
read vpkgs_location
|
||||||
|
|
||||||
if [ -z "${vpkgs_location}" ];then
|
if [ -z "${vpkgs_location}" ];then
|
||||||
vpkgs_location="${HOME}/vur"
|
vpkgs_location="/voidpkg/void-packages"
|
||||||
echo "Creating directory: ${vpkgs_location}"
|
echo "Creating directory: ${vpkgs_location}"
|
||||||
mkdir -p "${vpkgs_location}"
|
mkdir -p "${vpkgs_location}"
|
||||||
git clone https://github.com/void-linux/void-packages.git "${vpkgs_location}"
|
git clone https://github.com/void-linux/void-packages.git "${vpkgs_location}"
|
||||||
|
|
||||||
elif [ -n "${vpkgs_location}" ];then
|
elif [ -n "${vpkgs_location}" ];then
|
||||||
echo "Creating directory: ${vpkgs_location}"
|
while true;do
|
||||||
git clone https://github.com/void-linux/void-packages.git "${vpkgs_location}"
|
echo -n "Use ssh? [y/N]: "
|
||||||
|
read use_ssh
|
||||||
|
|
||||||
|
if [ -z "${use_ssh}" ] || [ "${use_ssh}" = "n" ] || [ "${use_ssh}" = "N" ] ;then
|
||||||
|
echo "Creating directory: ${vpkgs_location}"
|
||||||
|
|
||||||
|
git clone https://github.com/void-linux/void-packages.git "${vpkgs_location}" || exit 1
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
|
elif [ "${use_ssh}" = "y" ] || [ "${use_ssh}" = "Y" ];then
|
||||||
|
|
||||||
|
echo -n "Remote git username? (i.e github username): "
|
||||||
|
read git_user
|
||||||
|
|
||||||
|
git clone git@github.com:"${git_user}"/void-packages.git "${vpkgs_location}" || exit 1
|
||||||
|
break
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
echo "please enter y, n, or leave blank"
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +72,6 @@ gen_conf(){
|
|||||||
|
|
||||||
echo "void_packages=${void_packages_location}/hostdir/binpkgs" >> "${CONFIG_DIR}/${CONFIG_FILE}"
|
echo "void_packages=${void_packages_location}/hostdir/binpkgs" >> "${CONFIG_DIR}/${CONFIG_FILE}"
|
||||||
|
|
||||||
echo "Provid enter the full path of your custom repository: "
|
|
||||||
source "${CONFIG_DIR}/${CONFIG_FILE}"
|
source "${CONFIG_DIR}/${CONFIG_FILE}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -105,21 +125,31 @@ sign_pkgs(){
|
|||||||
echo "Generating a new key..."
|
echo "Generating a new key..."
|
||||||
gen_key
|
gen_key
|
||||||
|
|
||||||
|
echo "Signing xbps repodata in ${REPO_PATH}"
|
||||||
|
xbps-rindex --sign --signedby "${USER}" --privkey "${KEY_PATH}" "${REPO_PATH}"
|
||||||
echo "Signing xbps files in ${REPO_PATH}"
|
echo "Signing xbps files in ${REPO_PATH}"
|
||||||
xbps-rindex --sign --signedby "${USER}" --privkey "${KEY_PATH}" "$REPO_PATH"
|
xbps-rindex -S --signedby "${USER}" --privkey "${KEY_PATH}" "${REPO_PATH}"/*.xbps
|
||||||
else
|
else
|
||||||
echo "Signing xbps files in ${REPO_PATH}"
|
echo "Signing xbps files in ${REPO_PATH}"
|
||||||
xbps-rindex --sign --signedby "${USER}" --privkey "${KEY_PATH}" "$REPO_PATH"
|
xbps-rindex --sign --signedby "${USER}" --privkey "${KEY_PATH}" "${REPO_PATH}"
|
||||||
fi
|
echo "Signing xbps files in ${REPO_PATH}"
|
||||||
|
xbps-rindex -S --signedby "${USER}" --privkey "${KEY_PATH}" "${REPO_PATH}"/*.xbps
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
add_pkg(){
|
add_pkg(){
|
||||||
load_conf
|
load_conf
|
||||||
create_repo
|
create_repo
|
||||||
cp -r "${void_packages}"/*.xbps "${REPO_PATH}" || exit 1
|
cp -r "${void_packages}"/*.xbps "${REPO_PATH}" || exit 1
|
||||||
|
cp -r "${void_packages}"/nonfree/*.xbps "${REPO_PATH}" || exit 1
|
||||||
xbps-rindex -a "${REPO_PATH}"/*.xbps
|
xbps-rindex -a "${REPO_PATH}"/*.xbps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remove_obsoletes(){
|
||||||
|
xbps-rindex -r "${REPO_PATH}"
|
||||||
|
xbps-rindex -c "${REPO_PATH}"
|
||||||
|
}
|
||||||
|
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
|
|
||||||
-c | --create)
|
-c | --create)
|
||||||
@@ -141,13 +171,19 @@ case "${1}" in
|
|||||||
load_conf
|
load_conf
|
||||||
add_pkg
|
add_pkg
|
||||||
sign_pkgs
|
sign_pkgs
|
||||||
|
remove_obsoletes
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-vp | --void-packages)
|
-vp | --void-packages)
|
||||||
get_void_pkgs
|
get_void_pkgs
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
-r | --remove-obsoletes)
|
||||||
|
load_conf
|
||||||
|
remove_obsoletes
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
help_file
|
help_file
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user