From f9d0cc487229ca3abcd5a2e75a082fcf295b99c9f67c9a54cb6d974a3f1f9f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 2 Apr 2019 21:28:24 +0000 Subject: [PATCH] Accepting request 690787 from home:Andreas_Schwab:Factory - Remove useless uses of rpm.expand - Fix use of file:close OBS-URL: https://build.opensuse.org/request/show/690787 OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/dpkg?expand=0&rev=71 --- update-alternatives.changes | 6 ++++++ update-alternatives.spec | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/update-alternatives.changes b/update-alternatives.changes index ce1f6d3..47efb05 100644 --- a/update-alternatives.changes +++ b/update-alternatives.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Apr 2 20:04:25 UTC 2019 - Andreas Schwab + +- Remove useless uses of rpm.expand +- Fix use of file:close + ------------------------------------------------------------------- Wed Mar 13 09:15:51 UTC 2019 - Stephan Kulow diff --git a/update-alternatives.spec b/update-alternatives.spec index 5b4cf99..630d99a 100644 --- a/update-alternatives.spec +++ b/update-alternatives.spec @@ -75,7 +75,7 @@ if posix.access('var/lib/rpm/alternatives', 'x') then print("migrating update alternatives database to new location") -- We proceed even if no alternatives directory exists, such situation -- occurs in buildroot environment - new_location=rpm.expand('%{_localstatedir}/lib/alternatives/') + new_location='%{_localstatedir}/lib/alternatives/' for i,old_file in pairs(posix.dir("var/lib/rpm/alternatives/")) do print(old_file.."\n") new_file = string.gsub(old_file, "(.*/)(.*)", new_location .. "%2") @@ -85,8 +85,7 @@ if posix.access('var/lib/rpm/alternatives', 'x') then posix.rmdir('var/lib/rpm/alternatives') end -- touch file -new_file = io.open(rpm.expand('%{_localstatedir}/log/alternatives.log'), "w") -new_file.close() +io.open('%{_localstatedir}/log/alternatives.log', "w"):close() %files %license COPYING