Skip to content

Implementation of a function to delete clones of a given domain - #2358

Open
rubengarcialorenzo wants to merge 5 commits into
UPC:mainfrom
rubengarcialorenzo:main
Open

Implementation of a function to delete clones of a given domain#2358
rubengarcialorenzo wants to merge 5 commits into
UPC:mainfrom
rubengarcialorenzo:main

Conversation

@rubengarcialorenzo

Copy link
Copy Markdown
Collaborator
New function that deletes the clones of a given domain.

Description

Given a base, this function deletes recursively or not all the clones of the given base that are not bases.

Motivation and Context

@frankiejol frankiejol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other CLI options use "-" to join words, like in remove-user. Change remove_clones to remove-clones at the GetOptions call around line 172 so it uses the same format.
Also $RECURSIVE is a global variable, yo do not need to pass it to the functions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new CLI operation to script/rvd_back for deleting clones of a given base domain (optionally traversing base-clone trees), and updates Parrot ISO metadata/cleanup logic in lib/Ravada.pm.

Changes:

  • Add --remove-clones (and --recursive) CLI support to delete non-base clones under a base domain.
  • Improve add_user flow by checking for existing usernames and prompting for an alternative.
  • Update Parrot Home Edition XFCE ISO metadata to 7.3 and add cleanup for older Parrot 7.1 ISO entries.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
script/rvd_back Adds --remove-clones/--recursive, implements clone deletion traversal, and adds a duplicate-username prompt in add_user.
lib/Ravada.pm Updates Parrot ISO definition to 7.3 and adds deletion of old Parrot 7.1 ISO rows in _remove_old_isos.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread script/rvd_back
Comment on lines +381 to +386
print "There is already a user with that username \n";
print "Try using another username \n";
$login = <STDIN>;
chomp $login;
$sth_check->execute($login);
$usern = $sth_check->fetchrow();
Comment thread script/rvd_back
Comment thread lib/Ravada.pm
Comment on lines +1587 to +1589
"Delete FROM iso_images "
."WHERE url like 'https://download.parrot.sh/parrot/iso/7.1/'"
,"DELETE FROM iso_images "
Comment thread script/rvd_back
Comment on lines 171 to +173
,'remove:s'=> \$REMOVE_DOMAIN
,'remove-clones=s' => \$REMOVE_CLONES
,'recursive' => \$RECURSIVE
Comment thread script/rvd_back

list($ALL) if $LIST;
remove_domain($REMOVE_DOMAIN) if defined $REMOVE_DOMAIN;
remove_clones($REMOVE_CLONES, $RECURSIVE) if defined $REMOVE_CLONES;
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@frankiejol
frankiejol self-requested a review July 30, 2026 12:52

@frankiejol frankiejol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rubengarcialorenzo please consider Copilot suggestions:

  • use = instead like in SQL
  • add help text to $USAGE
  • do not pass $RECURSIVE to remove_clones function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants