[Rpm-maint] [rpm-software-management/rpm] Add support for generating buildinfo file as subpackage (#1532)

Zbigniew Jędrzejewski-Szmek notifications at github.com
Sun Nov 27 18:16:57 UTC 2022


@keszybz commented on this pull request.



> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
+# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+# OR OTHER DEALINGS IN THE SOFTWARE.
+# 
+# Except as contained in this notice, the name of a copyright holder shall not
+# be used in advertising or otherwise to promote the sale, use or other dealings
+# in this Software without prior written authorization of the copyright holder.
+#
+
+set -e -o pipefail
+
+getos() {
+    # shellcheck disable=SC1091
+    test -r /etc/os-release && . /etc/os-release

OK. So something like this:
```bash
if test -e /etc/os-release; then
   . /etc/os-release
elif test -e /usr/lib/os-release; then
   . /usr/lib/os-release
fi
```
Differences from the original code:
- do not suppress permission errors by using `-r` instead of `-e`
- use /usr/lib/os-release if appropriate


-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1532#discussion_r1032988938
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/1532/review/1195038108 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20221127/781d6e86/attachment.html>


More information about the Rpm-maint mailing list