SHA256
3
0
forked from pool/dpkg

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
This commit is contained in:
Tomáš Chvátal 2019-04-02 21:28:24 +00:00 committed by Git OBS Bridge
parent 03729a1ecb
commit f9d0cc4872
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Apr 2 20:04:25 UTC 2019 - Andreas Schwab <schwab@suse.de>
- Remove useless uses of rpm.expand
- Fix use of file:close
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Mar 13 09:15:51 UTC 2019 - Stephan Kulow <coolo@suse.com> Wed Mar 13 09:15:51 UTC 2019 - Stephan Kulow <coolo@suse.com>

View File

@ -75,7 +75,7 @@ if posix.access('var/lib/rpm/alternatives', 'x') then
print("migrating update alternatives database to new location") print("migrating update alternatives database to new location")
-- We proceed even if no alternatives directory exists, such situation -- We proceed even if no alternatives directory exists, such situation
-- occurs in buildroot environment -- 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 for i,old_file in pairs(posix.dir("var/lib/rpm/alternatives/")) do
print(old_file.."\n") print(old_file.."\n")
new_file = string.gsub(old_file, "(.*/)(.*)", new_location .. "%2") 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') posix.rmdir('var/lib/rpm/alternatives')
end end
-- touch file -- touch file
new_file = io.open(rpm.expand('%{_localstatedir}/log/alternatives.log'), "w") io.open('%{_localstatedir}/log/alternatives.log', "w"):close()
new_file.close()
%files %files
%license COPYING %license COPYING