<commit_before>require 'rpm'

namespace :sisyphus do
namespace :update do
task :x86_64 => :environment do
  puts "import x86_64.rpm's"
  puts Time.now

  branch = Branch.find :first, :conditions => { :urlname => 'Sisyphus' }

  ActiveRecord::Base.transaction do
  ActiveRecord::Base.connection.execute("DELETE FROM packages WHERE arch = 'x86_64' AND branch = 'Sisyphus'")
  Dir.glob(branch.binary_x86_64_path).each do |f|
  begin
    rpm = RPM::Package::open(file)
    package = Package.new
    package.filename = rpm.name + '-' + rpm.version.v + '-' + rpm.version.r + '.x86_64.rpm'
    package.sourcepackage = rpm[1044]
    package.name = rpm.name
    package.version = rpm.version.v
    package.release = rpm.version.r
    package.arch = rpm.arch
    package.group = r[1016]

    packager = rpm[1015]
    packager_name = packager.split('<')[0].chomp
    packager_email = packager.chop.split('<')[1]

    packager_email = packager_email.downcase

    packager_email = packager_email.gsub(' at altlinux.ru', '@altlinux.org')
    packager_email = packager_email.gsub(' at altlinux.org', '@altlinux.org')
    packager_email = packager_email.gsub(' at altlinux dot org', '@altlinux.org')
    packager_email = packager_email.gsub(' at altlinux dot ru', '@altlinux.org')<commit_msg>fix typo in update script for Sisyphus/x86_64<commit_after>require 'rpm'

namespace :sisyphus do
namespace :update do
task :x86_64 => :environment do
  puts "import x86_64.rpm's"
  puts Time.now

  branch = Branch.find :first, :conditions => { :urlname => 'Sisyphus' }

  ActiveRecord::Base.transaction do
  ActiveRecord::Base.connection.execute("DELETE FROM packages WHERE arch = 'x86_64' AND branch = 'Sisyphus'")
  Dir.glob(branch.binary_x86_64_path).each do |file|
  begin
    rpm = RPM::Package::open(file)
    package = Package.new
    package.filename = rpm.name + '-' + rpm.version.v + '-' + rpm.version.r + '.x86_64.rpm'
    package.sourcepackage = rpm[1044]
    package.name = rpm.name
    package.version = rpm.version.v
    package.release = rpm.version.r
    package.arch = rpm.arch
    package.group = r[1016]

    packager = rpm[1015]
    packager_name = packager.split('<')[0].chomp
    packager_email = packager.chop.split('<')[1]

    packager_email = packager_email.downcase

    packager_email = packager_email.gsub(' at altlinux.ru', '@altlinux.org')
    packager_email = packager_email.gsub(' at altlinux.org', '@altlinux.org')
    packager_email = packager_email.gsub(' at altlinux dot org', '@altlinux.org')
    packager_email = packager_email.gsub(' at altlinux dot ru', '@altlinux.org')
{'fraction_non_alphanumeric': 0.13789107763615296, 'fraction_numerical': 0.027809965237543453, 'mean_word_length': 3.9616858237547894, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2476323', 'n_tokens_mistral': 960, 'n_tokens_neox': 889, 'n_words': 187}