From 84ac6089674343953f0485294461e64502874d85 Mon Sep 17 00:00:00 2001 From: nazunalika Date: Thu, 16 Jun 2022 13:18:18 -0700 Subject: [PATCH] symlink functions --- iso/py/.common.py.swp | Bin 0 -> 12288 bytes iso/py/util/dnf_utils.py | 15 +++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 iso/py/.common.py.swp diff --git a/iso/py/.common.py.swp b/iso/py/.common.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..255489cc50696fddc31841ca2f0e621f71046459 GIT binary patch literal 12288 zcmeHNJ!~9B6rKRO`Micf0#Cc=v zMCRv?&sskdmFMZRhu0p+r5o%Ra11yG90QI4$ADwNG2j?*3_M&6m}DP$10g?BgnhdB z-nZ+!cywQm0mp!2z%k$$a11yG90QI4$ADwNG2j?*3_OGkuz-+v9wp?H#}GXJ|6l(7 z|I^ci`~choz63r6J_J4hZUOHC7lE_D9B>5K5B%~JA>RR?19yP8ff3LJ7_bDK0FD6^ z`0WrOUjui6K5!a%4*2m&LcRcQ11(@0H~{>7kdSYId%!oqN5Gpv3zz^Zz#mT#@;z_| z*aS9!8Q>uB*#Sa^z!Bi9#|e2KxDC7qFyJU~82BB0SWZ5+ytvCT;23ZWI0hU8|1$#< zXIjfEt<`#`vD)ffZne)ZHQMwfEv4;N>mofyEA{|ht%5tIdP6J79s*`~M;jI;WI}}_ zrZk4CFc3X+RfQ4jDS3S_&4??=+x1J0)kf<=HpULV>M1@FTFBVDjyb#;51+YTsCwZj z^e~KG9CFR+h6qF2PUxZwP;0b!)(KY6c8v*mU&K7XtY%0VoQEl={I!&Y)JQuy#hPs7bSzVl1Yb-IxG^Fg z__Tel-t=~PjHRKk@IWd?W2xwBx?1e zW+aOb);9RRI`eJ5@&WY=OJqXyX(fxkVl&i}abFCO$hx+3V%Sd9*11wwGr0(IH zHVo~t*v<@tg1M47{Prs@90axH=ckD+&gz&&p|4q=cS6a6sx64AsmwUbq)d2RwSi4j zPkGan$2}QAa`8J z6@kz@<+Lf{bh9#@tKrZvY#e3B^>}QgUerc$7A=$}5xjM5d+8`CjkT+FQxOJ%P^F3D ziR^Sy+MQH|)?#Q(q8DqmaT-}&U;Eh*AKSn0OEsvCj@J?;Uqvg>r4!_-(?dxNq#C1V zrCsYN5=u!`OVX}AL0p>tlbOmEUn~!E1S#5$jJJc2VpFq0>6vY9=@_kY0Iv5kE>xu@ z&Mm_Q-)UJ0OPlTPi=`M5aUaz7?M<~Zd1W%14E)J+lgpEP8}{mN4T};xNpFy1 ztD^nixJmNOkl#<(=B=|f%}@uHU-a4DkoVTn%_%Ol7npk2X6NUx&PHA)%X(BPJYERb zE-cmC&BlfLmiY^X=1RTUY+c?GFU*&2nrqv}3#IkasrLCZS5Db?RX*$dONIRo=|U-8 zS!=H}@ALCwVSTn;uWvh9m@CBX`u2JjZ0x;|X`T1dqD`VL+t&)C-89B4SoX17(V8{g z;CMNVX$k}T9^@(#mM)o^B*lSwk@ure4s7X_k69-wR7h4Swk@r^w}n#Pm-SITON~x< Q3N0>ofm|W9Ay=II3D8I1+5i9m literal 0 HcmV?d00001 diff --git a/iso/py/util/dnf_utils.py b/iso/py/util/dnf_utils.py index bb71427..bfdb88a 100644 --- a/iso/py/util/dnf_utils.py +++ b/iso/py/util/dnf_utils.py @@ -67,6 +67,7 @@ class RepoSync: self.compose_base = config['compose_root'] + "/" + major # Relevant major version items + self.shortname = config['shortname'] self.revision = rlvars['revision'] + "-" + rlvars['rclvl'] self.fullversion = rlvars['revision'] self.arches = rlvars['allowed_arches'] @@ -190,7 +191,7 @@ class RepoSync: if self.fullrun: self.deploy_extra_files() - self.symlink_to_latest() + self.symlink_to_latest(generated_dir) if self.repoclosure: self.repoclosure_work(sync_root, work_root, log_root) @@ -525,7 +526,7 @@ class RepoSync: return compose_base_dir - def symlink_to_latest(self): + def symlink_to_latest(self, generated_dir): """ Emulates pungi and symlinks latest-Rocky-X @@ -533,7 +534,13 @@ class RepoSync: 'latest' directory is what is rsynced on to staging after completion. This link should not change often. """ - pass + try: + os.remove(self.compose_latest_dir) + except: + pass + + self.log.info('Symlinking to latest-{}-{}...'.format(self.shortname, self.major_version)) + os.symlink(generated_dir, self.compose_latest_dir) def generate_conf(self, dest_path='/var/tmp') -> str: """ @@ -798,7 +805,7 @@ class RepoSync: also deploys COMPOSE_ID and maybe in the future a metadata dir with a bunch of compose-esque stuff. """ - pass + self.log.info('Deploying extra files...') class SigRepoSync: """