`simp environment new` creates rsync/CentOS unconditionally, so the rsync skeleton cannot ship it

Offen Anfängerfreundlich
#244 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
62/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
ruby
Bereich
tooling

Rechercherichtung

Der bedingungslose Aufruf FileUtils.ln_s('RedHat', 'CentOS') steht in copy_rsync_skeleton_files in lib/simp/cli/environment/secondary_dir_env.rb etwa in Zeile 148. Lies diese Methode und den rsync-Skeleton-Kopierschritt davor. Die Lösung besteht darin, den Link nur dann anzulegen, wenn CentOS noch nicht existiert. Füge eine Spec hinzu, die sowohl den Fall abdeckt, dass das Skeleton bereits CentOS enthält, als auch den Fall, dass CentOS fehlt. Fertig ist, wenn in beiden Fällen keine RedHat/RedHat-Schleife entsteht.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Problem

copy_rsync_skeleton_files creates the rsync/CentOS -> RedHat link itself after copying the rsync skeleton (lib/simp/cli/environment/secondary_dir_env.rb:148):

FileUtils.ln_s('RedHat', 'CentOS') # C.5.2

simp/simp-rsync-skeleton#64 adds AlmaLinux, OracleLinux and Rocky links to the skeleton, so the per-distribution aliases now live in two places. The skeleton can't take over the CentOS link while this call is unconditional: if the copied skeleton already contains CentOS -> RedHat, ln_s follows it and creates a RedHat/RedHat -> RedHat loop inside the tree instead.

Someone who copies the skeleton by hand, as the simp-rsync-skeleton README describes, also gets no CentOS link at all.

Suggested fix

  • Create the link only when CentOS doesn't already exist.
  • Once a release with that change is out, ship CentOS in simp-rsync-skeleton with the other links, and then remove the call here.
Vorherrschende Sprache
Ruby
Sterne
2
Forks
13
Ø Merge
4 T. 3 Std.
Gemergte PRs (30 T.)
10

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus simp/rubygem-simp-cli

Alle Issues in simp/rubygem-simp-cli

Ähnliche Issues

Weitere Issues zu Ruby

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.