#233 Remove slashes after %{buildroot}
Merged 3 years ago by ankursinha. Opened 3 years ago by churchyard.
fedora-docs/ churchyard/quick-docs buildroot-slash  into  master

@@ -61,8 +61,8 @@ 

  +

  [source]

  ----

- mkdir -p %{buildroot}/%{_bindir}

- install -p -m 755 %{SOURCE0} %{buildroot}/%{_bindir}

+ mkdir -p %{buildroot}%{_bindir}

+ install -p -m 755 %{SOURCE0} %{buildroot}%{_bindir}

  ----

  +

  NOTE: In this example, we use the following three macros: `%\{buildroot}`, `%\{_bindir}`, and `%\{SOURCE0}`. This method ignores the origin of the files and directories and focuses on the destination of the files. Without `%\{buildroot}` the files might install directly onto your development machine. This is not recommended, especially if you run as root. For more information on macros and `.spec` file entries, see xref:con_rpm_spec_file_overview[].

@@ -147,7 +147,7 @@ 

  * delete the `dir` file in `%install`:

  

  ----

- $ rm -f %{buildroot}/%{_infodir}/dir

+ $ rm -f %{buildroot}%{_infodir}/dir

  ----

  

  * `Requires(post): info` and `Requires(preun): info`
@@ -202,7 +202,7 @@ 

  %install

  %make_install

  %find_lang %{name}

- rm -f %{buildroot}/%{_infodir}/dir

+ rm -f %{buildroot}%{_infodir}/dir

  

  %post

  /sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :

%{_bindir} etc. already starts with a slash.
There is no need to put a slash after %{buildroot}.
(Except when pointing to the literal root of the buildroot and using just "%{buildroot}/".)

Pull-Request has been merged by ankursinha

3 years ago