diff --git a/bin/import_srpm.sh b/bin/import_srpm.sh index 02d4bd449..9665678c8 100755 --- a/bin/import_srpm.sh +++ b/bin/import_srpm.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash # import_srpm.sh: Import SRPM packages to git repo -pwd=$PWD # Input data srpm_path=$1 git_path=$2 git_branch=$3 -token=$4 +script=$4 +token=$5 name=$(rpm -q --qf '[%{Name}]' -p $srpm_path) version=$(rpm -q --qf '[%{Version}-%{Release}]' -p $srpm_path) tmp_dir=/tmp/$name-$version-$RANDOM @@ -32,7 +32,7 @@ cpio -idv < srpm.cpio rm -f srpm.cpio # Remove archives -$pwd/file-store.rb $token $PWD +$script $token # Commit and push changes git add -A . diff --git a/lib/modules/models/git.rb b/lib/modules/models/git.rb index 904ab30a1..44f00c648 100644 --- a/lib/modules/models/git.rb +++ b/lib/modules/models/git.rb @@ -93,7 +93,7 @@ module Modules def import_srpm(srpm_path = srpm.path, branch_name = 'import') token = User.find_by_uname('rosa_system').authentication_token - system("#{Rails.root.join('bin', 'import_srpm.sh')} #{srpm_path} #{path} #{branch_name} #{token} >> /dev/null 2>&1") + system("#{Rails.root.join('bin', 'import_srpm.sh')} #{srpm_path} #{path} #{branch_name} #{Rails.root.join('bin', 'file-store.rb')} #{token} >> /dev/null 2>&1") end protected