mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-12-04 18:36:26 +00:00
enhancement: expose srpmproc library
This commit is contained in:
parent
f71605a7d5
commit
7d84156a4b
5
.gitignore
vendored
5
.gitignore
vendored
@ -14,7 +14,6 @@
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
testdata
|
||||
srpmproc
|
||||
/srpmproc
|
||||
.idea
|
||||
dist/
|
||||
dist/
|
||||
/dist/
|
||||
|
@ -23,7 +23,7 @@ package main
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
"github.com/spf13/cobra"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
|
@ -22,6 +22,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/rocky-linux/srpmproc/pkg/srpmproc"
|
||||
"log"
|
||||
"os"
|
||||
"os/user"
|
||||
@ -32,13 +33,12 @@ import (
|
||||
"github.com/go-git/go-billy/v5/memfs"
|
||||
"github.com/go-git/go-billy/v5/osfs"
|
||||
"github.com/go-git/go-git/v5/plumbing/transport/ssh"
|
||||
"github.com/rocky-linux/srpmproc/internal/blob"
|
||||
"github.com/rocky-linux/srpmproc/internal/blob/file"
|
||||
"github.com/rocky-linux/srpmproc/internal/blob/gcs"
|
||||
"github.com/rocky-linux/srpmproc/internal/blob/s3"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
"github.com/rocky-linux/srpmproc/pkg/blob"
|
||||
"github.com/rocky-linux/srpmproc/pkg/blob/file"
|
||||
"github.com/rocky-linux/srpmproc/pkg/blob/gcs"
|
||||
"github.com/rocky-linux/srpmproc/pkg/blob/s3"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
|
||||
"github.com/rocky-linux/srpmproc/internal"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@ -96,14 +96,14 @@ func mn(_ *cobra.Command, _ []string) {
|
||||
sourceRpmLocation := ""
|
||||
if strings.HasPrefix(sourceRpm, "file://") {
|
||||
sourceRpmLocation = strings.TrimPrefix(sourceRpm, "file://")
|
||||
importer = &internal.SrpmMode{}
|
||||
importer = &srpmproc.SrpmMode{}
|
||||
} else {
|
||||
if moduleMode {
|
||||
sourceRpmLocation = fmt.Sprintf("%s/%s", modulePrefix, sourceRpm)
|
||||
} else {
|
||||
sourceRpmLocation = fmt.Sprintf("%s/%s", rpmPrefix, sourceRpm)
|
||||
}
|
||||
importer = &internal.GitMode{}
|
||||
importer = &srpmproc.GitMode{}
|
||||
}
|
||||
|
||||
lastKeyLocation := sshKeyLocation
|
||||
@ -145,7 +145,7 @@ func mn(_ *cobra.Command, _ []string) {
|
||||
manualCs = strings.Split(manualCommits, ",")
|
||||
}
|
||||
|
||||
internal.ProcessRPM(&data.ProcessData{
|
||||
srpmproc.ProcessRPM(&data.ProcessData{
|
||||
Importer: importer,
|
||||
RpmLocation: sourceRpmLocation,
|
||||
UpstreamPrefix: upstreamPrefix,
|
||||
|
@ -23,7 +23,7 @@ package data
|
||||
import (
|
||||
"github.com/go-git/go-billy/v5"
|
||||
"github.com/go-git/go-git/v5/plumbing/transport/ssh"
|
||||
"github.com/rocky-linux/srpmproc/internal/blob"
|
||||
"github.com/rocky-linux/srpmproc/pkg/blob"
|
||||
)
|
||||
|
||||
type ProcessData struct {
|
@ -28,8 +28,8 @@ import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
srpmprocpb "github.com/rocky-linux/srpmproc/pb"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
)
|
||||
|
||||
// returns right if not empty, else left
|
@ -25,8 +25,8 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
srpmprocpb "github.com/rocky-linux/srpmproc/pb"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
)
|
||||
|
||||
func del(cfg *srpmprocpb.Cfg, _ *data.ProcessData, _ *data.ModeData, _ *git.Worktree, pushTree *git.Worktree) error {
|
@ -28,8 +28,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
srpmprocpb "github.com/rocky-linux/srpmproc/pb"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
)
|
||||
|
||||
func checkAddPrefix(file string) string {
|
@ -33,8 +33,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
srpmprocpb "github.com/rocky-linux/srpmproc/pb"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
)
|
||||
|
||||
func lookaside(cfg *srpmprocpb.Cfg, _ *data.ProcessData, md *data.ModeData, patchTree *git.Worktree, pushTree *git.Worktree) error {
|
@ -28,8 +28,8 @@ import (
|
||||
|
||||
"github.com/bluekeyes/go-gitdiff/gitdiff"
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
srpmprocpb "github.com/rocky-linux/srpmproc/pb"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
)
|
||||
|
||||
func patch(cfg *srpmprocpb.Cfg, _ *data.ProcessData, _ *data.ModeData, patchTree *git.Worktree, pushTree *git.Worktree) error {
|
@ -27,8 +27,8 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
srpmprocpb "github.com/rocky-linux/srpmproc/pb"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
)
|
||||
|
||||
func replace(cfg *srpmprocpb.Cfg, pd *data.ProcessData, _ *data.ModeData, patchTree *git.Worktree, pushTree *git.Worktree) error {
|
@ -33,8 +33,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
srpmprocpb "github.com/rocky-linux/srpmproc/pb"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
)
|
||||
|
||||
const (
|
@ -18,7 +18,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
package internal
|
||||
package srpmproc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@ -36,7 +36,7 @@ import (
|
||||
"github.com/go-git/go-git/v5/plumbing"
|
||||
"github.com/go-git/go-git/v5/plumbing/object"
|
||||
"github.com/go-git/go-git/v5/storage/memory"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
)
|
||||
|
||||
type remoteTarget struct {
|
@ -18,7 +18,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
package internal
|
||||
package srpmproc
|
||||
|
||||
import (
|
||||
"github.com/cavaliercoder/go-rpm"
|
@ -18,4 +18,4 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
package internal
|
||||
package srpmproc
|
@ -18,7 +18,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
package internal
|
||||
package srpmproc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@ -33,10 +33,10 @@ import (
|
||||
"github.com/go-git/go-git/v5/config"
|
||||
"github.com/go-git/go-git/v5/plumbing"
|
||||
"github.com/go-git/go-git/v5/storage/memory"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
"github.com/rocky-linux/srpmproc/internal/directives"
|
||||
"github.com/rocky-linux/srpmproc/modulemd"
|
||||
srpmprocpb "github.com/rocky-linux/srpmproc/pb"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
"github.com/rocky-linux/srpmproc/pkg/directives"
|
||||
"google.golang.org/protobuf/encoding/prototext"
|
||||
)
|
||||
|
@ -18,7 +18,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
package internal
|
||||
package srpmproc
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
@ -38,7 +38,7 @@ import (
|
||||
"github.com/go-git/go-git/v5/plumbing"
|
||||
"github.com/go-git/go-git/v5/plumbing/object"
|
||||
"github.com/go-git/go-git/v5/storage/memory"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
)
|
||||
|
||||
var tagImportRegex *regexp.Regexp
|
@ -18,7 +18,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
package internal
|
||||
package srpmproc
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@ -37,7 +37,7 @@ import (
|
||||
"github.com/go-git/go-billy/v5/memfs"
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/go-git/go-git/v5/storage/memory"
|
||||
"github.com/rocky-linux/srpmproc/internal/data"
|
||||
"github.com/rocky-linux/srpmproc/pkg/data"
|
||||
)
|
||||
|
||||
type SrpmMode struct{}
|
Loading…
Reference in New Issue
Block a user