Skip to content

Commit

Permalink
ccm: fixup
Browse files Browse the repository at this point in the history
Closes #89
  • Loading branch information
graysky authored and graysky committed Sep 23, 2024
1 parent e701aa7 commit 85c11a2
Showing 1 changed file with 19 additions and 32 deletions.
51 changes: 19 additions & 32 deletions common/clean-chroot-manager64.in
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,6 @@ check_config() {
# note that we still have to modify pacman.conf to add a line for the repo
# but only after it is populated with packages which is in the indexit function
[[ -d "$REPO" ]] || mkdir "$REPO"
chown :alpm -R "$REPO"
chown "$USER" "$REPO"
fi
# pacman 7.0.0 requires alpm gid for local repos
if [[ -d "$REPO" ]]; then
dir_gid=$(stat -c "%G" "$REPO")
if [[ "$dir_gid" == "alpm" ]]; then
true
else
chown :alpm -R "$REPO"
fi
fi
if sudo -u "$USER" -H sh -c "[ ! -w \"$REPO\" ]"; then
local mesg="User $USER has no write permissions on $REPO"
Expand Down Expand Up @@ -250,28 +239,26 @@ create() {
fi

# Create the internal repo, if it doesn't exist yet
if [[ $INTERNAL_REPO ]]; then
if [[ ! -d "$REPO" ]]; then
# make the empty dir for the repo in root's copy of the buildroot
# note that we still have to modify pacman.conf to add a line for the repo
# but only after it is populated with packages which is in the indexit function
[[ -d "$REPO" ]] || mkdir "$REPO"
if [[ ! -d "$REPO" ]]; then
# make the empty dir for the repo in root's copy of the buildroot
# note that we still have to modify pacman.conf to add a line for the repo
# but only after it is populated with packages which is in the indexit function
[[ -d "$REPO" ]] || mkdir "$REPO"
chown :alpm -R "$REPO"
chown "$USER" "$REPO"
fi
# pacman 7.0.0 requires alpm gid for local repos
if [[ -d "$REPO" ]]; then
dir_gid=$(stat -c "%G" "$REPO")
if [[ "$dir_gid" == "alpm" ]]; then
true
else
chown :alpm -R "$REPO"
chown "$USER" "$REPO"
fi
# pacman 7.0.0 requires alpm gid for local repos
if [[ -d "$REPO" ]]; then
dir_gid=$(stat -c "%G" "$REPO")
if [[ "$dir_gid" == "alpm" ]]; then
true
else
chown :alpm -R "$REPO"
fi
fi
if sudo -u "$USER" -H sh -c "[ ! -w \"$REPO\" ]"; then
local mesg="User $USER has no write permissions on $REPO"
echo -e "${RED}==> ERROR:${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}"; exit 1
fi
fi
fi
if sudo -u "$USER" -H sh -c "[ ! -w \"$REPO\" ]"; then
local mesg="User $USER has no write permissions on $REPO"
echo -e "${RED}==> ERROR:${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}"; exit 1
fi

# if we are using an external repo and if it has a db, add it to pacman.conf if not do nothing
Expand Down

0 comments on commit 85c11a2

Please sign in to comment.