forked from Plemya-x/ALR
		
	chore: run make update-license fmt
				
					
				
			This commit is contained in:
		@@ -1,29 +1,21 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ALR - Any Linux Repository
 | 
			
		||||
 * Copyright (C) 2024 Евгений Храмов
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU General Public License as published by
 | 
			
		||||
 * the Free Software Foundation, either version 3 of the License, or
 | 
			
		||||
 * (at your option) any later version.
 | 
			
		||||
 * Это программное обеспечение свободно: вы можете распространять его и/или изменять
 | 
			
		||||
 * на условиях GNU General Public License, опубликованной Free Software Foundation,
 | 
			
		||||
 * либо версии 3 лицензии, либо (на ваш выбор) любой более поздней версии.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU General Public License for more details.
 | 
			
		||||
 * Это программное обеспечение распространяется в надежде, что оно будет полезным,
 | 
			
		||||
 * но БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ; даже без подразумеваемой гарантии
 | 
			
		||||
 * КОММЕРЧЕСКОЙ ПРИГОДНОСТИ или ПРИГОДНОСТИ ДЛЯ ОПРЕДЕЛЕННОЙ ЦЕЛИ. См.
 | 
			
		||||
 * GNU General Public License для более подробной информации.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 * Вы должны были получить копию GNU General Public License
 | 
			
		||||
 * вместе с этой программой. Если нет, см. <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
// This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan.
 | 
			
		||||
// It has been modified as part of "ALR - Any Linux Repository" by Евгений Храмов.
 | 
			
		||||
//
 | 
			
		||||
// ALR - Any Linux Repository
 | 
			
		||||
// Copyright (C) 2025 Евгений Храмов
 | 
			
		||||
//
 | 
			
		||||
// This program is free software: you can redistribute it and/or modify
 | 
			
		||||
// it under the terms of the GNU General Public License as published by
 | 
			
		||||
// the Free Software Foundation, either version 3 of the License, or
 | 
			
		||||
// (at your option) any later version.
 | 
			
		||||
//
 | 
			
		||||
// This program is distributed in the hope that it will be useful,
 | 
			
		||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
// GNU General Public License for more details.
 | 
			
		||||
//
 | 
			
		||||
// You should have received a copy of the GNU General Public License
 | 
			
		||||
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 | 
			
		||||
package build
 | 
			
		||||
 | 
			
		||||
@@ -53,6 +45,7 @@ import (
 | 
			
		||||
 | 
			
		||||
	"github.com/goreleaser/nfpm/v2"
 | 
			
		||||
	"github.com/goreleaser/nfpm/v2/files"
 | 
			
		||||
 | 
			
		||||
	"plemya-x.ru/alr/internal/cliutils"
 | 
			
		||||
	"plemya-x.ru/alr/internal/config"
 | 
			
		||||
	"plemya-x.ru/alr/internal/cpu"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,19 @@
 | 
			
		||||
// ALR - Any Linux Repository
 | 
			
		||||
// Copyright (C) 2025 Евгений Храмов
 | 
			
		||||
//
 | 
			
		||||
// This program is free software: you can redistribute it and/or modify
 | 
			
		||||
// it under the terms of the GNU General Public License as published by
 | 
			
		||||
// the Free Software Foundation, either version 3 of the License, or
 | 
			
		||||
// (at your option) any later version.
 | 
			
		||||
//
 | 
			
		||||
// This program is distributed in the hope that it will be useful,
 | 
			
		||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
// GNU General Public License for more details.
 | 
			
		||||
//
 | 
			
		||||
// You should have received a copy of the GNU General Public License
 | 
			
		||||
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 | 
			
		||||
package build
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
@@ -8,6 +24,7 @@ import (
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/goreleaser/nfpm/v2"
 | 
			
		||||
 | 
			
		||||
	"plemya-x.ru/alr/internal/types"
 | 
			
		||||
	"plemya-x.ru/alr/pkg/loggerctx"
 | 
			
		||||
)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,31 +1,21 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ALR - Any Linux Repository
 | 
			
		||||
 * ALR - Любой Linux Репозиторий
 | 
			
		||||
 * Copyright (C) 2024 Евгений Храмов
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * Это программное обеспечение является свободным: вы можете распространять его и/или изменять
 | 
			
		||||
 * it under the terms of the GNU General Public License as published by
 | 
			
		||||
 * на условиях GNU General Public License, опубликованной
 | 
			
		||||
 * the Free Software Foundation, either version 3 of the License, or
 | 
			
		||||
 * Free Software Foundation, либо версии 3 лицензии, либо
 | 
			
		||||
 * (at your option) any later version.
 | 
			
		||||
 * (по вашему усмотрению) любой более поздней версии.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * Это программное обеспечение распространяется в надежде, что оно будет полезным,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * но БЕЗ КАКОЙ-ЛИБО ГАРАНТИИ; даже без подразумеваемой гарантии
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * КОММЕРЧЕСКОЙ ПРИГОДНОСТИ или ПРИГОДНОСТИ ДЛЯ ОПРЕДЕЛЕННОЙ ЦЕЛИ.
 | 
			
		||||
 * GNU General Public License for more details.
 | 
			
		||||
 * Подробности смотрите в GNU General Public License.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * Вы должны были получить копию GNU General Public License
 | 
			
		||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 * вместе с этой программой. Если нет, посмотрите <http://www.gnu.org/licenses/>.
 | 
			
		||||
 */
 | 
			
		||||
// This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan.
 | 
			
		||||
// It has been modified as part of "ALR - Any Linux Repository" by Евгений Храмов.
 | 
			
		||||
//
 | 
			
		||||
// ALR - Any Linux Repository
 | 
			
		||||
// Copyright (C) 2025 Евгений Храмов
 | 
			
		||||
//
 | 
			
		||||
// This program is free software: you can redistribute it and/or modify
 | 
			
		||||
// it under the terms of the GNU General Public License as published by
 | 
			
		||||
// the Free Software Foundation, either version 3 of the License, or
 | 
			
		||||
// (at your option) any later version.
 | 
			
		||||
//
 | 
			
		||||
// This program is distributed in the hope that it will be useful,
 | 
			
		||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
// GNU General Public License for more details.
 | 
			
		||||
//
 | 
			
		||||
// You should have received a copy of the GNU General Public License
 | 
			
		||||
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 | 
			
		||||
package build
 | 
			
		||||
 | 
			
		||||
@@ -46,15 +36,15 @@ func InstallPkgs(ctx context.Context, alrPkgs []db.Package, nativePkgs []string,
 | 
			
		||||
 | 
			
		||||
	if len(nativePkgs) > 0 {
 | 
			
		||||
		err := opts.Manager.Install(nil, nativePkgs...)
 | 
			
		||||
        // Если есть нативные пакеты, выполняем их установку
 | 
			
		||||
		// Если есть нативные пакеты, выполняем их установку
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			log.Fatal("Error installing native packages").Err(err).Send()
 | 
			
		||||
            // Логируем и завершаем выполнение при ошибке
 | 
			
		||||
			// Логируем и завершаем выполнение при ошибке
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	InstallScripts(ctx, GetScriptPaths(ctx, alrPkgs), opts)
 | 
			
		||||
    // Устанавливаем скрипты сборки через функцию InstallScripts
 | 
			
		||||
	// Устанавливаем скрипты сборки через функцию InstallScripts
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// GetScriptPaths возвращает срез путей к скриптам, соответствующий
 | 
			
		||||
@@ -62,7 +52,7 @@ func InstallPkgs(ctx context.Context, alrPkgs []db.Package, nativePkgs []string,
 | 
			
		||||
func GetScriptPaths(ctx context.Context, pkgs []db.Package) []string {
 | 
			
		||||
	var scripts []string
 | 
			
		||||
	for _, pkg := range pkgs {
 | 
			
		||||
        // Для каждого пакета создаем путь к скрипту сборки
 | 
			
		||||
		// Для каждого пакета создаем путь к скрипту сборки
 | 
			
		||||
		scriptPath := filepath.Join(config.GetPaths(ctx).RepoDir, pkg.Repository, pkg.Name, "alr.sh")
 | 
			
		||||
		scripts = append(scripts, scriptPath)
 | 
			
		||||
	}
 | 
			
		||||
@@ -75,17 +65,17 @@ func InstallScripts(ctx context.Context, scripts []string, opts types.BuildOpts)
 | 
			
		||||
	for _, script := range scripts {
 | 
			
		||||
		opts.Script = script // Устанавливаем текущий скрипт в опции
 | 
			
		||||
		builtPkgs, _, err := BuildPackage(ctx, opts)
 | 
			
		||||
        // Выполняем сборку пакета
 | 
			
		||||
		// Выполняем сборку пакета
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			log.Fatal("Error building package").Err(err).Send()
 | 
			
		||||
            // Логируем и завершаем выполнение при ошибке сборки
 | 
			
		||||
			// Логируем и завершаем выполнение при ошибке сборки
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		err = opts.Manager.InstallLocal(nil, builtPkgs...)
 | 
			
		||||
        // Устанавливаем локально собранные пакеты
 | 
			
		||||
		// Устанавливаем локально собранные пакеты
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			log.Fatal("Error installing package").Err(err).Send()
 | 
			
		||||
            // Логируем и завершаем выполнение при ошибке установки
 | 
			
		||||
			// Логируем и завершаем выполнение при ошибке установки
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user