1、心血来潮,想做个小动画,想起linux下有个好玩的sl命令,结果是
打算找到源代码,仔细研究下,结果发现,没有源代码,其实不详ubuntu和centos系统有dpkg可以下载,但是arch系的linux也是一样的
2、既然安装过软件包,那就到/var/cache/pacman/pkg下先看下软件包里有没有信息
cd /var/cache/pacman/pkg
3、查看软件包:
ls | grep ^sl 结果为:
sl-5.02-5-x86_64.pkg.tar.xz
sl-5.02-6-x86_64.pkg.tar.zst
slang-2.3.2-2-x86_64.pkg.tar.zst
非常明显有两个不同版本的软件包,还有一个是相关的软件包,本次以sl-5.02-6-x86_64.pkg.tar.zst 为例
4、切换至root用户,新建目录,将sl-5.02-6-x86_64.pkg.tar.zst 拷入目录中,解压
su 输入root密码
mkdir tmp | cp sl-5.02-6-x86_64.pkg.tar.zst tmp/
cd tmp/
tar xvf sl-5.02-6-x86_64.pkg.tar.zst 结果为:
.BUILDINFO
.MTREE
.PKGINFO
usr/
usr/bin/
usr/bin/sl
usr/share/
usr/share/licenses/
usr/share/licenses/sl/
usr/share/licenses/sl/LICENSE
usr/share/man/
usr/share/man/man1/
usr/share/man/man1/sl.1.gz
5、查看文件.PKGINFO,获取软件的源码地址,cat .PKGINFO,结果为:
# Generated by makepkg 5.2.2
# using fakeroot version 1.24
pkgname = sl
pkgbase = sl
pkgver = 5.02-6
pkgdesc = Steam Locomotive runs across your terminal when you type "sl" as you meant to typ
e "ls".
url = http://www.tkl.iis.u-tokyo.ac.jp/~toyoda/index_e.html //这个就是源码地址,将其拷入浏览器地址,进入一个网站
builddate = 1594143425
packager = Felix Yan <felixonmars@archlinux.org>
size = 27278
arch = x86_64
license = custom
depend = ncurses
6、下载源码即可。