From 8074f78ea7a86ea4866fa2feea588b21b6062710 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 24 Apr 2017 21:18:04 -0700 Subject: [PATCH 1/4] Add pkgutils submodule --- .gitmodules | 3 +++ pkgutils | 1 + 2 files changed, 4 insertions(+) create mode 160000 pkgutils diff --git a/.gitmodules b/.gitmodules index 4157e1719..7b1c83abe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,6 @@ path = libc-artifacts url = https://github.com/redox-os/libc-artifacts.git branch = master +[submodule "pkgutils"] + path = pkgutils + url = https://github.com/redox-os/pkgutils.git diff --git a/pkgutils b/pkgutils new file mode 160000 index 000000000..4cf2e9d21 --- /dev/null +++ b/pkgutils @@ -0,0 +1 @@ +Subproject commit 4cf2e9d216721282a8f2bb82c031ee90ede878f4 From 608565652687e3d3f7bb6b76da96011cd1fa9ff4 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 24 Apr 2017 21:19:01 -0700 Subject: [PATCH 2/4] Have setup.py download pkgutils --- setup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.sh b/setup.sh index 3396cacf5..62aa36f5b 100755 --- a/setup.sh +++ b/setup.sh @@ -4,6 +4,9 @@ set -e echo "Downloading latest libc-artifacts" git submodule update --init --remote libc-artifacts +echo "Downloading latest pkgutils" +git submodule update --init --remote pkgutils + echo "Defaulting to rust nightly" rustup override set nightly echo "Update rust nightly" From cad99ecff5a382d456ff81511f99a7f5ade9e1b2 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 24 Apr 2017 21:40:12 -0700 Subject: [PATCH 3/4] Use "pkg create" to build package --- cook.sh | 4 +--- setup.sh | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cook.sh b/cook.sh index 5c0ac2914..36549d991 100755 --- a/cook.sh +++ b/cook.sh @@ -195,9 +195,7 @@ function op { rm -rfv stage ;; tar) - pushd stage > /dev/null - tar cfv ../stage.tar . - popd > /dev/null + $ROOT/pkgutils/target/release/pkg create stage ;; untar) rm -rfv stage.tar diff --git a/setup.sh b/setup.sh index 62aa36f5b..795627d99 100755 --- a/setup.sh +++ b/setup.sh @@ -24,4 +24,10 @@ then cargo install -f xargo fi +echo "Building pkgutils" +pushd pkgutils +# TODO Change pkgutils to not hard code TARGET +TARGET=x86_64-unknown-redox cargo build --release +popd + echo "cook.sh is ready to use" From a092814806e4ab9afe022820d59d692e9f54b7e2 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Tue, 25 Apr 2017 11:27:53 -0700 Subject: [PATCH 4/4] Create package metadata file --- cook.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cook.sh b/cook.sh index 36549d991..b5df2c45b 100755 --- a/cook.sh +++ b/cook.sh @@ -195,10 +195,14 @@ function op { rm -rfv stage ;; tar) + mkdir -p stage/etc/pkg.d + echo "name = \"$1\"" > "stage/etc/pkg.d/$1.toml" + echo "version = \"$(op $1 version)\"" >> "stage/etc/pkg.d/$1.toml" + echo "target = \"$TARGET\"" >> "stage/etc/pkg.d/$1.toml" $ROOT/pkgutils/target/release/pkg create stage ;; untar) - rm -rfv stage.tar + rm -rfv stage.tar stage.sig ;; publish) mkdir -p "$REPO"