чување 1186817f5fff1962b89069ebfc43b382df8d3e0d родитељ b84eaae35ada4958ede6ceba227d55eeea75e5f6 Аутор: Страхиња Радић <contact@strahinja.org> Датум: Thu, 4 Aug 2022 12:51:36 +0200 Add info operation Signed-off-by: Страхиња Радић <contact@strahinja.org> Diffstat:
| M | README | | | 7 | ++++--- |
| A | lib/info.mk | | | 21 | +++++++++++++++++++++ |
| M | mkpk | | | 1 | + |
измењених датотека: 3, додавања: 26(+), брисања: 3(-)
diff --git a/README b/README @@ -48,10 +48,11 @@ mkpk helper usage # mkpk update # Pulls the galeb-mkfiles repository # mkpk fetch foo # fetches the sources of foo to SRCBASEDIR # mkpk build foo # builds the foo tarball and puts it into PKGDIR -# mkpk list foo # lists files in a built and installed tarball # mkpk install foo # installs the built tarball -# mkpk uninstall foo # uninstalls the package using built and - # installed tarball as filelist +# mkpk list foo # lists files in an installed tarball +# mkpk info foo # show information about an installed tarball +# mkpk uninstall foo # uninstalls the package using an installed + # tarball as filelist [1]: https://proot-me.github.io/ diff --git a/lib/info.mk b/lib/info.mk @@ -0,0 +1,21 @@ +<$mkpklib/defaults.mk + +show-info:QV: + record=$(grep "^${PKGBASE}\t" "${PKGDB}" 2>/dev/null || echo '') + if [ -z "${record}" ]; then + printf "Package %s is not installed\n" "${PKGBASE}" >&2 + exit 1 + fi + ver=$(echo "${record}" | cut -f2) + if [ -z "${ver}" ]; then + printf "Corrupted record for %s in %s\n" \ + "${PKGBASE}" "${PKGDB}" >&2 + exit 1 + else + date=$(echo "${record}" | cut -f3) + pkg=${PKGDIR}/${PKGBASE}-${ver}.tar.xz + printf "Package:\t\t%s\n" "${PKGBASE}" + printf "Version:\t\t%s\n" "${ver}" + printf "Installation Date:\t%s\n" "${date}" + printf "Tarball:\t\t%s\n" "${pkg}" + fi diff --git a/mkpk b/mkpk @@ -39,6 +39,7 @@ case ${command} in fetch) file=fetch;; build) file=build;; list) file=listfiles;; + info) file=info;; install) file=install;; uninstall) file=uninstall;; *) usage