diff options
-rw-r--r-- | functions | 40 | ||||
-rwxr-xr-x | repoctl | 63 |
2 files changed, 103 insertions, 0 deletions
@@ -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" +} + @@ -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 |