aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-10-28 17:17:15 +0000
committerNicolas Vigier <boklm@mageia.org>2011-10-28 17:17:15 +0000
commit5a914dd8291c79c5545a167e25d2c2992c3d62c9 (patch)
tree5138874f64860fcdd6fd58f314655d8a034de677
parent810b3a6928dc0e640a1d6736efa82c864fbc005b (diff)
downloadrepoctl-5a914dd8291c79c5545a167e25d2c2992c3d62c9.tar
repoctl-5a914dd8291c79c5545a167e25d2c2992c3d62c9.tar.gz
repoctl-5a914dd8291c79c5545a167e25d2c2992c3d62c9.tar.bz2
repoctl-5a914dd8291c79c5545a167e25d2c2992c3d62c9.tar.xz
repoctl-5a914dd8291c79c5545a167e25d2c2992c3d62c9.zip
add lspkg command
-rw-r--r--functions40
-rwxr-xr-xrepoctl63
2 files changed, 103 insertions, 0 deletions
diff --git a/functions b/functions
index c40cff0..cee332b 100644
--- a/functions
+++ b/functions
@@ -333,3 +333,43 @@ function move_pkg()
"$output"
}
+function ls_pkg()
+{
+ local src_distrorelease="$1"; shift
+ local src_section="$1"; shift
+ local src_sectionrepo="$1"; shift
+ local srcname="$1"; shift
+ local output="$1"; shift
+
+ check_distro_section "$src_distrorelease" "$src_section" "$src_sectionrepo"
+
+ local srcpkg=$(find_src_pkg "$src_distrorelease" "$src_section" "$src_sectionrepo" "$srcname")
+
+ if [ -z $srcpkg ]
+ then
+ return 0
+ fi
+
+ for arch in $arches
+ do
+ move_pkg_files \
+ "" "" "" \
+ "" "" "" \
+ $(get_media_path "$src_distrorelease" "$src_section" "$src_sectionrepo" "$arch") \
+ "" \
+ "$srcpkg" "$output"
+ move_pkg_files \
+ "" "" "" \
+ "" "" "" \
+ $(get_media_path_debug "$src_distrorelease" "$src_section" "$src_sectionrepo" "$arch") \
+ "" \
+ "$srcpkg" "$output"
+ done
+ move_pkg_file \
+ "" "" "" \
+ "" "" "" \
+ $(get_media_path_src "$src_distrorelease" "$src_section" "$src_sectionrepo") \
+ "" \
+ "$output"
+}
+
diff --git a/repoctl b/repoctl
index 479c0ba..ae75543 100755
--- a/repoctl
+++ b/repoctl
@@ -38,6 +38,17 @@ Example :
repoctl rmpkg --srcrepo 1:core:updates_testing --srcpkg emacs
EOF
+ ;;
+ lspkg)
+ cat <<EOF
+Usage: repoctl lspkg --srcrepo distribution:section:sectionrepo \\
+ --srcpkg|--binpkg name
+
+Example :
+ List emacs packages from 1/core/updates_testing repository :
+ repoctl lspkg --srcrepo 1:core:updates_testing --srcpkg emacs
+EOF
+ ;;
esac
}
@@ -126,6 +137,53 @@ function rmpkg()
mvpkg --remove $@
}
+function lspkg()
+{
+ args=$(getopt -o hn -l srcrepo:,help,srcpkg:,binpkg: -- "$@")
+ [ $? -ne 0 ] && usage_cmd mvpkg && exit 1
+ eval set -- "$args"
+ [ $# -lt 1 ] && exit 1
+ while [ $# -gt 0 ]
+ do
+ case $1 in
+ -h|--help)
+ usage_cmd lspkg
+ exit 0
+ ;;
+ --srcrepo)
+ IFS=':' read -ra srcrepo <<< "$2"
+ shift;shift;;
+ --srcpkg)
+ srcpkg="$2"
+ shift;shift;;
+ --binpkg)
+ binpkg="$2"
+ shift;shift;;
+ --)
+ shift;break;;
+ -*)
+ usage
+ exit 1
+ ;;
+ *)
+ break
+ ;;
+ esac
+ done
+ if [ -z "$srcrepo" -o -z "$srcpkg$binpkg" ]
+ then
+ usage
+ exit 1
+ fi
+ if [ -n "$srcpkg" ]
+ then
+ ls_pkg "${srcrepo[0]}" "${srcrepo[1]}" "${srcrepo[2]}" "$srcpkg" "/dev/stdout"
+ else
+ echo "The --binpkg option is not supported yet"
+ fi
+
+}
+
function usage()
{
cat <<EOF
@@ -135,6 +193,7 @@ function usage()
mvpkg
lnpkg
rmpkg
+ lspkg
genhdlists
mirrordistro
getrepolock
@@ -157,6 +216,10 @@ case "$1" in
shift
rmpkg $@
;;
+ lspkg)
+ shift
+ lspkg $@
+ ;;
*)
usage
exit 1