Rename libostree to ostree
This commit is contained in:
parent
77697b10f7
commit
999d239c59
|
|
@ -31,20 +31,20 @@ publish_ostree-sys:
|
||||||
- cargo publish --verbose --manifest-path sys/Cargo.toml --token $CRATES_IO_TOKEN
|
- cargo publish --verbose --manifest-path sys/Cargo.toml --token $CRATES_IO_TOKEN
|
||||||
when: manual
|
when: manual
|
||||||
|
|
||||||
# libostree
|
# ostree
|
||||||
libostree:
|
ostree:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- cargo test --verbose --all-features
|
- cargo test --verbose --all-features
|
||||||
|
|
||||||
libostree_nightly:
|
ostree_nightly:
|
||||||
stage: build
|
stage: build
|
||||||
image: rustlang/rust:nightly
|
image: rustlang/rust:nightly
|
||||||
script:
|
script:
|
||||||
- cargo test --verbose --all-features
|
- cargo test --verbose --all-features
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
publish_libostree:
|
publish_ostree:
|
||||||
stage: publish
|
stage: publish
|
||||||
script:
|
script:
|
||||||
- cargo publish --verbose --token $CRATES_IO_TOKEN
|
- cargo publish --verbose --token $CRATES_IO_TOKEN
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "libostree"
|
name = "ostree"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
authors = ["Felix Krull"]
|
authors = ["Felix Krull"]
|
||||||
|
|
||||||
|
|
@ -7,7 +7,7 @@ license = "MIT"
|
||||||
description = "Rust bindings for libostree"
|
description = "Rust bindings for libostree"
|
||||||
keywords = ["ostree", "libostree"]
|
keywords = ["ostree", "libostree"]
|
||||||
|
|
||||||
documentation = "https://fkrull.gitlab.io/ostree-rs/libostree"
|
documentation = "https://fkrull.gitlab.io/ostree-rs/ostree"
|
||||||
repository = "https://gitlab.com/fkrull/ostree-rs"
|
repository = "https://gitlab.com/fkrull/ostree-rs"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ features = ["dox"]
|
||||||
repository = "fkrull/ostree-rs"
|
repository = "fkrull/ostree-rs"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "libostree"
|
name = "ostree"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2018 Felix Krull
|
Copyright (c) 2018, 2019 Felix Krull
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
all: gir/libostree gir/ostree-sys
|
all: gir/ostree gir/ostree-sys
|
||||||
|
|
||||||
.PHONY: update-gir-files
|
.PHONY: update-gir-files
|
||||||
|
|
||||||
|
|
@ -16,7 +16,7 @@ target/tools/bin/rustdoc-stripper:
|
||||||
cargo install --root target/tools -- rustdoc-stripper
|
cargo install --root target/tools -- rustdoc-stripper
|
||||||
|
|
||||||
merge-lgpl-docs: target/tools/bin/gir target/tools/bin/rustdoc-stripper
|
merge-lgpl-docs: target/tools/bin/gir target/tools/bin/rustdoc-stripper
|
||||||
target/tools/bin/gir -c conf/libostree.toml -m doc
|
target/tools/bin/gir -c conf/ostree.toml -m doc
|
||||||
target/tools/bin/rustdoc-stripper -g -o target/vendor.md
|
target/tools/bin/rustdoc-stripper -g -o target/vendor.md
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
extern crate gio;
|
extern crate gio;
|
||||||
extern crate glib;
|
extern crate glib;
|
||||||
extern crate libostree;
|
extern crate ostree;
|
||||||
extern crate tempfile;
|
extern crate tempfile;
|
||||||
|
|
||||||
use glib::prelude::*;
|
use glib::prelude::*;
|
||||||
use libostree::prelude::*;
|
use ostree::prelude::*;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
fn create_repo(repodir: &tempfile::TempDir) -> Result<libostree::Repo, glib::Error> {
|
fn create_repo(repodir: &tempfile::TempDir) -> Result<ostree::Repo, glib::Error> {
|
||||||
let repo = libostree::Repo::new_for_path(repodir.path());
|
let repo = ostree::Repo::new_for_path(repodir.path());
|
||||||
repo.create(libostree::RepoMode::Archive, None)?;
|
repo.create(ostree::RepoMode::Archive, None)?;
|
||||||
Ok(repo)
|
Ok(repo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23,17 +23,17 @@ fn create_test_file(treedir: &tempfile::TempDir) -> Result<(), io::Error> {
|
||||||
|
|
||||||
fn create_mtree(
|
fn create_mtree(
|
||||||
treedir: &tempfile::TempDir,
|
treedir: &tempfile::TempDir,
|
||||||
repo: &libostree::Repo,
|
repo: &ostree::Repo,
|
||||||
) -> Result<libostree::MutableTree, glib::Error> {
|
) -> Result<ostree::MutableTree, glib::Error> {
|
||||||
let gfile = gio::File::new_for_path(treedir.path());
|
let gfile = gio::File::new_for_path(treedir.path());
|
||||||
let mtree = libostree::MutableTree::new();
|
let mtree = ostree::MutableTree::new();
|
||||||
repo.write_directory_to_mtree(&gfile, &mtree, None, None)?;
|
repo.write_directory_to_mtree(&gfile, &mtree, None, None)?;
|
||||||
Ok(mtree)
|
Ok(mtree)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn commit_mtree(
|
fn commit_mtree(
|
||||||
repo: &libostree::Repo,
|
repo: &ostree::Repo,
|
||||||
mtree: &libostree::MutableTree,
|
mtree: &ostree::MutableTree,
|
||||||
) -> Result<String, glib::Error> {
|
) -> Result<String, glib::Error> {
|
||||||
repo.prepare_transaction(None)?;
|
repo.prepare_transaction(None)?;
|
||||||
let repo_file = repo.write_mtree(mtree, None)?.downcast().unwrap();
|
let repo_file = repo.write_mtree(mtree, None)?.downcast().unwrap();
|
||||||
|
|
@ -43,8 +43,8 @@ fn commit_mtree(
|
||||||
Ok(checksum)
|
Ok(checksum)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn open_repo(repodir: &tempfile::TempDir) -> Result<libostree::Repo, glib::Error> {
|
fn open_repo(repodir: &tempfile::TempDir) -> Result<ostree::Repo, glib::Error> {
|
||||||
let repo = libostree::Repo::new_for_path(repodir.path());
|
let repo = ostree::Repo::new_for_path(repodir.path());
|
||||||
repo.open(None)?;
|
repo.open(None)?;
|
||||||
Ok(repo)
|
Ok(repo)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue