public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/pcs] f44: simplify prep
@ 2026-09-16 12:21 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-09-16 12:21 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/pcs
            Branch : f44
            Commit : 2c918d981d0716acd3d221a6f35b32ccc7a278a6
            Author : Michal Pospíšil <mpospisi@redhat.com>
            Date   : 2026-09-11T20:04:06+02:00
            Stats  : +30/-65 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/pcs/c/2c918d981d0716acd3d221a6f35b32ccc7a278a6?branch=f44

            Log:
            simplify prep

The review of the patch section was caused by the issues with git
patching in TMT. They are further refinement of the previous commit. I
removed the update_times_patch macro because it should remove
differences in file modification times between builds on different
architectures. Since PCS has been a noarch package for a while, I fell
that it is safe to remove, it cal always be re-added leter in case there
are issues.

I also reviewed the comments in the whole prep section. I made sure that
comments make sense to me, there is no outdated information and updated
formatting to match the rest of the spec.

I unified the order of parameters to autosetup and autopatch as it was
mismatched from the time I copied the pcs-web-ui installation from the
upstream spec where it was written originally by someone else. This also
makes it easier to follow the documentation, as the order is now same
across usages and comments explaining what they do.

---
diff --git a/pcs.spec b/pcs.spec
index 3ae6c1e..91e3b12 100644
--- a/pcs.spec
+++ b/pcs.spec
@@ -280,74 +280,39 @@ Pacemaker/Corosync Configuration System (pcs) in the background.
 
 
 %prep
-# -- following is inspired by python-simplejon.el5 --
-# Update timestamps on the files touched by a patch, to avoid non-equal
-# .pyc/.pyo files across the multilib peers within a build
-
-update_times(){
-  # update_times <reference_file> <file_to_touch> ...
-  # set the access and modification times of each file_to_touch to the times
-  # of reference_file
-
-  # put all args to file_list
-  file_list=("$@")
-  # first argument is reference_file: so take it and remove from file_list
-  reference_file=${file_list[0]}
-  unset file_list[0]
-
-  for fname in ${file_list[@]}; do
-    # some files could be deleted by a patch therefore we test file for
-    # existance before touch to avoid exit with error: No such file or
-    # directory
-    # diffstat cannot create list of files without deleted files
-    test -e $fname && touch -r $reference_file $fname
-  done
-}
-
-update_times_patch(){
-  # update_times_patch <patch_file_name>
-  # set the access and modification times of each file in patch to the times
-  # of patch_file_name
-
-  patch_file_name=$1
-
-  # diffstat
-  # -l lists only the filenames. No histogram is generated.
-  # -p override the logic that strips common pathnames,
-  #    simulating the patch "-p" option. (Strip the smallest prefix containing
-  #    num leading slashes from each file name found in the patch file)
-  update_times ${patch_file_name} `diffstat -p1 -l ${patch_file_name}`
-}
-
-# documentation for setup/autosetup/autopatch:
+# Documentation for autosetup/autopatch:
 #   * http://ftp.rpm.org/max-rpm/s1-rpm-inside-macros.html
 #   * https://rpm-software-management.github.io/rpm/manual/autosetup.html
-# patch web-ui sources
-# -n <name> — Set Name of Build Directory
-# -T — Do Not Perform Default Archive Unpacking
-# -b <n> — Unpack The nth Sources Before Changing Directory
-# -a <n> — Unpack The nth Sources After Changing Directory
-# -N — disables automatic patch application, use autopatch to apply patches
 #
-# 1. unpack sources (-b 0)
-# 2. then cd into sources tree (the setup macro itself)
-# 3. then unpack node_modules into sources tree (-a 1).
+# AUTOSETUP
+# -T        - do not perform default archive unpacking
+# -b <n>    - unpack Source<n> into builddir
+# -a <n>    - unpack Source<n> into the previously unpacked source
+# -N        - disables automatic patch application, use autopatch
+# -n <name> - set name of build directory
+#
+# AUTOPATCH (applies patches with finer control than autosetup)
+# -q    - don’t warn if there are no matching patches
+# -p<n> - argument to control patch prefix stripping (pnum in the patch manual)
+# -m<n> - apply patches starting from <n>
+# -M<n> - apply patches up to <n>
+
+# Unpack and patch web-ui sources
+# 1. Unpack web-ui Source100 before changing dir (-b 100)
+# 2. Autosetup calls cd into unpacked web-ui tree
+# 3. Unpack node_modules Source101 after cd into web-ui tree (-a 101).
 %autosetup -T -b 100 -a 101 -N -n %{ui_src_name}
-%autopatch -p1 -m 201
-# update_times_patch %%{PATCH201}
-
-# patch pcs sources
-%autosetup -n %{pcs_source_name} -N
-%autopatch -p1 -M 200
-# update_times_patch %%{PATCH1}
-update_times_patch %{PATCH1}
-update_times_patch %{PATCH2}
-update_times_patch %{PATCH3}
-update_times_patch %{PATCH4}
-update_times_patch %{PATCH5}
-
-# generate .tarball-version if building from an untagged commit, not a released version
-# autogen uses git-version-gen which uses .tarball-version for generating version number
+# Apply infinite amount of patches starting with Patch201
+%autopatch -q -p1 -m 201
+
+# Unpack and patch pcs sources
+%autosetup -N -n %{pcs_source_name}
+# Apply Patch1-Patch200
+%autopatch -q -p1 -M 200
+
+# Generate .tarball-version if building from an untagged commit, not a released
+# version. autogen.sh uses git-version-gen which uses .tarball-version file for
+# setting version number across autotools
 %if 0%{?tarball_version:1}
   echo %{tarball_version} > %{_builddir}/%{pcs_source_name}/.tarball-version
 %endif
@@ -356,7 +321,7 @@ update_times_patch %{PATCH5}
   echo %{ui_tarball_version} > %{_builddir}/%{ui_src_name}/.tarball-version
 %endif
 
-# prepare dirs/files necessary for building python bundles
+# Move bundled python sdists where autotools expect them
 mkdir -p %{pcs_bundled_dir}/src
 cp -f %SOURCE41 rpm/
 cp -f %SOURCE42 rpm/

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-16 12:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 12:21 [rpms/pcs] f44: simplify prep 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox