Use Rakes fileutils for command execution

This commit is contained in:
Eugen Wissner 2021-06-30 09:06:17 +02:00
parent d1e98ff646
commit 9decbdd285
Signed by: belka
GPG Key ID: A27FDC1E8EE902C0
2 changed files with 7 additions and 5 deletions

2
.gitignore vendored
View File

@ -25,4 +25,6 @@
/config/config.rb /config/config.rb
/vendor/ /vendor/
/.bundle/ /.bundle/
/debug/PackageKit/PackageKit/ /debug/PackageKit/PackageKit/
/debug/PackageKit/package/

View File

@ -9,8 +9,9 @@
# For the script to work PackageKit source should be in the ./PackageKit # For the script to work PackageKit source should be in the ./PackageKit
# directory alongside this script. # directory alongside this script.
require 'fileutils' require 'rake/file_utils'
require 'pathname' require 'pathname'
require 'rake'
require 'open3' require 'open3'
CWD = Pathname.new Dir.pwd CWD = Pathname.new Dir.pwd
@ -28,7 +29,7 @@ version = `git -C #{SOURCE} describe --tags --abbrev=0`
.delete_prefix('PACKAGEKIT_') .delete_prefix('PACKAGEKIT_')
.gsub('_', '.') .gsub('_', '.')
exec_result = system 'meson', sh 'meson',
'--buildtype=debug', '--buildtype=debug',
'--prefix=/usr', '--prefix=/usr',
'--libdir=/usr/lib64', '--libdir=/usr/lib64',
@ -43,10 +44,9 @@ exec_result = system 'meson',
'-Ddaemon_tests=true', '-Ddaemon_tests=true',
TMP.to_s, TMP.to_s,
SOURCE.to_s SOURCE.to_s
raise 'Meson build failed' unless exec_result
exec_result = system({'DESTDIR' => DESTINATION.to_s}, 'ninja', '-C', TMP.to_s, 'install') sh({ 'DESTDIR' => DESTINATION.to_s },
raise 'Ninja installation failed' unless exec_result 'ninja', '-C', TMP.to_s, 'install')
actual_mandir = DESTINATION + 'usr/share/man/man1' actual_mandir = DESTINATION + 'usr/share/man/man1'
mandir = DESTINATION + 'usr/man/man1' mandir = DESTINATION + 'usr/man/man1'