Skip to content

Instantly share code, notes, and snippets.

@Ram-Z
Created January 20, 2016 21:48
Show Gist options
  • Save Ram-Z/70230fb8bb09a33f9e86 to your computer and use it in GitHub Desktop.
Save Ram-Z/70230fb8bb09a33f9e86 to your computer and use it in GitHub Desktop.
diff --git a/chakra/.bashrc b/chakra/.bashrc
index 7a197ea..ccc73b3 100644
--- a/chakra/.bashrc
+++ b/chakra/.bashrc
@@ -237,7 +237,7 @@ export GIT_PS1_SHOWCOLORHINTS=1
PROMPT_COMMAND='__git_ps1 "[\u@\[\e[31;1m\]$CHROOT\[\e[0m\]: \w" "]\$ "'
cd /chakra/$REPO
-ls
+# ls
if [[ ! -S "$SSH_AUTH_SOCK" ]]; then
eval $(ssh-agent)
fi
diff --git a/chakra/bin/check_so_files.sh b/chakra/bin/check_so_files.sh
index e844aed..18f783b 100755
--- a/chakra/bin/check_so_files.sh
+++ b/chakra/bin/check_so_files.sh
@@ -3,7 +3,7 @@
# check_so_files.sh
#
# Copyright © 2015 Samir Benmendil <[email protected]>
-# Copyright © Phil Miller <philm[at]chakra-project[dot]org>
+#
# 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 2 of the License, or
@@ -17,9 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
-export LANG=en_US.UTF-8
-export LC_MESSAGES=en_US.UTF-8
-
if [ "$#" -ne 1 ]; then
>&2 printf 'USAGE: %s pkgname\n' "$0"
exit 1
@@ -27,26 +24,11 @@ fi
pkg=$1
-lib=`readelf -d $(pacman -Qql $pkg) 2>/dev/null | grep NEEDED | sort | uniq | cut -d[ -f2 | cut -d] -f1`
-
-echo "Checking in /usr/lib"
-echo ">> there might be errors"
-echo ">> check if those got found in /lib"
+libs=$(pacman -Qlq $pkg | grep -e 'bin/.' -e '\.so')
-for i in $lib
-do
- pacman -Qo /usr/lib/$i
-done
-echo " "
-echo ">> done"
-echo " "
-echo "Checking in /lib"
-echo ">> Ignore already found libs"
-echo " "
+libdepends=( $(objdump -p $libs 2> /dev/null | sed -n 's/NEEDED\s*//p' | sort -u) )
+libpaths=( $(locate -b ${libdepends[@]/\//\\/} | grep -e '^/usr/lib/' -e '^/extra/usr/lib/') )
-for i in $lib
-do
- pacman -Qo /lib/$i
-done
+pacman -Qoq ${libpaths[@]} | sort -u | grep -v "^$pkg$"
# vim: set et sw=2 ts=2:
diff --git a/chakra/bin/functions/buildsystem b/chakra/bin/functions/buildsystem
index 16f62ed..2a138af 100644
--- a/chakra/bin/functions/buildsystem
+++ b/chakra/bin/functions/buildsystem
@@ -147,6 +147,14 @@ upload_files() {
# downloads and signs the databases to the temporary folder
# upload the new files to the server and cleanup the temp folder
sign_online_database() {
+ #TODO waiting for updates on rattata, needs gnupg2 and openssh 6.7
+ # local repo=$1
+ # local arch=${2:-$(get_arch)}
+ # # -R </path/to/remote/socket>:</path/to/local/socket>
+ # ssh $_ssh_user@$_rsync_server -p $_ssh_port \
+ # -R ~/.gnupg/S.gpg-agent:~/.gnupg/S.gpg-agent \
+ # "for i in packages/$repo/$arch/${repo}.db.tar; do gpg2 --batch --detach-sign \$i; done "
+
# downloads (and eventually signs) the databases to the temporary folder
status_start "downloading and signing the database"
dir=$(mktemp -d)
@@ -156,7 +164,7 @@ sign_online_database() {
gpg --batch --detach-sign "$dir/$1.db.tar.gz"
status_done
- upload_files $1 "$dir/"*.db.tar.*
+ upload_files $1 "$dir"/$1.db.tar.?z.sig
rm -r "$dir"
}
diff --git a/chakra/bin/move.sh b/chakra/bin/move.sh
index 816828c..be6b2a6 100755
--- a/chakra/bin/move.sh
+++ b/chakra/bin/move.sh
@@ -28,6 +28,24 @@ _srce_repo=$(echo $2)
_dest_repo=$(echo $3)
_cur_repo=$(pwd | awk -F '/' '{print $NF}')
+function usage ()
+{
+ echo "Usage : $0 PKGS SRCREPO DSTREPO
+ Move packages from SRCREPO to DSTREPO.
+
+ Examples:
+ $0 -r repo upload all pkgs to [repo]
+ $0 foo -r repo bar upload pkgs containing 'foo' or 'bar' to [repo]
+ invokes \`find -name '*foo*' -o -name '*bar*'\`
+ $0 -r repo 'foobar*' upload pkgs starting with 'foobar' to [repo]
+ invokes \`find -name 'foobar*'\`
+
+ Options:
+ -r,--repo Which repo to upload to. (mandatory)
+ -h,--help Display this message
+ -v,--version Display script version"
+}
+
# helper functions
_needed_functions="config_handling helpers messages buildsystem"
for subroutine in $_needed_functions ; do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment