Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make new release? #16

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
target
Cargo.lock
vgcore.*
.idea/
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ services:

language: rust
rust:
# - stable
# - beta
- stable
- beta
- nightly
before_install:
- sudo apt-get install -y libarchive-dev
script:
- cargo build
- cargo doc --no-deps
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then
docker run --rm -it codekoala/arch sh -c "pacman -Syu --noconfirm >/dev/null 2>/dev/null && pacman -S --noconfirm git cargo && mkdir build && cd build && git clone --branch '$TRAVIS_BRANCH' https://github.com/derekdreery/alpm-sys.git && cd alpm-sys && cargo test" ;
docker run --rm -it archlinux/base sh -c "pacman -Syu --noconfirm >/dev/null 2>/dev/null && pacman -S --noconfirm git cargo libarchive gcc && mkdir build && cd build && git clone --branch '$TRAVIS_BRANCH' https://github.com/derekdreery/alpm-sys.git && cd alpm-sys && cargo test" ;
fi
notifications:
on_success: change
Expand Down
7 changes: 0 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
[workspace]

members = [ "alpm-sys", "libalpm", "libalpm-utils", "printf", "printf_helper" ]


[replace]
"alpm-sys:0.1.2" = { "path" = "./alpm-sys" }
"printf:0.1.0" = { "path" = "./printf" }

6 changes: 3 additions & 3 deletions alpm-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[package]
name = "alpm-sys"
version = "0.1.2"
version = "0.2.0"
repository = "https://github.com/derekdreery/alpm-sys"
documentation = "https://docs.rs/alpm-sys/"
license = "MIT OR Apache-2.0"
authors = [
"Richard Dodd <[email protected]>",
"James Zhu <[email protected]>",
]
description = "alpm.h interface."
readme = "README.md"
Expand All @@ -19,6 +20,5 @@ include = [
]

[dependencies]
libc = "0.2"
libc = "^0.2"
libarchive3-sys = "0.1"

72 changes: 72 additions & 0 deletions alpm-sys/src/errors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
use libc::*;

use ffi::alpm_handle_t;

#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum alpm_errno_t {
ALPM_ERR_OK = 0,
ALPM_ERR_MEMORY = 1,
ALPM_ERR_SYSTEM = 2,
ALPM_ERR_BADPERMS = 3,
ALPM_ERR_NOT_A_FILE = 4,
ALPM_ERR_NOT_A_DIR = 5,
ALPM_ERR_WRONG_ARGS = 6,
ALPM_ERR_DISK_SPACE = 7,
ALPM_ERR_HANDLE_NULL = 8,
ALPM_ERR_HANDLE_NOT_NULL = 9,
ALPM_ERR_HANDLE_LOCK = 10,
ALPM_ERR_DB_OPEN = 11,
ALPM_ERR_DB_CREATE = 12,
ALPM_ERR_DB_NULL = 13,
ALPM_ERR_DB_NOT_NULL = 14,
ALPM_ERR_DB_NOT_FOUND = 15,
ALPM_ERR_DB_INVALID = 16,
ALPM_ERR_DB_INVALID_SIG = 17,
ALPM_ERR_DB_VERSION = 18,
ALPM_ERR_DB_WRITE = 19,
ALPM_ERR_DB_REMOVE = 20,
ALPM_ERR_SERVER_BAD_URL = 21,
ALPM_ERR_SERVER_NONE = 22,
ALPM_ERR_TRANS_NOT_NULL = 23,
ALPM_ERR_TRANS_NULL = 24,
ALPM_ERR_TRANS_DUP_TARGET = 25,
ALPM_ERR_TRANS_NOT_INITIALIZED = 26,
ALPM_ERR_TRANS_NOT_PREPARED = 27,
ALPM_ERR_TRANS_ABORT = 28,
ALPM_ERR_TRANS_TYPE = 29,
ALPM_ERR_TRANS_NOT_LOCKED = 30,
ALPM_ERR_TRANS_HOOK_FAILED = 31,
ALPM_ERR_PKG_NOT_FOUND = 32,
ALPM_ERR_PKG_IGNORED = 33,
ALPM_ERR_PKG_INVALID = 34,
ALPM_ERR_PKG_INVALID_CHECKSUM = 35,
ALPM_ERR_PKG_INVALID_SIG = 36,
ALPM_ERR_PKG_MISSING_SIG = 37,
ALPM_ERR_PKG_OPEN = 38,
ALPM_ERR_PKG_CANT_REMOVE = 39,
ALPM_ERR_PKG_INVALID_NAME = 40,
ALPM_ERR_PKG_INVALID_ARCH = 41,
ALPM_ERR_PKG_REPO_NOT_FOUND = 42,
ALPM_ERR_SIG_MISSING = 43,
ALPM_ERR_SIG_INVALID = 44,
ALPM_ERR_DLT_INVALID = 45,
ALPM_ERR_DLT_PATCHFAILED = 46,
ALPM_ERR_UNSATISFIED_DEPS = 47,
ALPM_ERR_CONFLICTING_DEPS = 48,
ALPM_ERR_FILE_CONFLICTS = 49,
ALPM_ERR_RETRIEVE = 50,
ALPM_ERR_INVALID_REGEX = 51,
ALPM_ERR_LIBARCHIVE = 52,
ALPM_ERR_LIBCURL = 53,
ALPM_ERR_EXTERNAL_DOWNLOAD = 54,
ALPM_ERR_GPGME = 55,
}

extern "C" {
/// Returns the current error code from the handle.
pub fn alpm_errno(handle: *mut alpm_handle_t) -> alpm_errno_t;

/// Returns the string corresponding to an error number.
pub fn alpm_strerror(err: alpm_errno_t) -> *const c_char;
}
Loading