Yes that would be nice to incorporate into inxi.
What about showing the full sources.list? (I know cat /etc/apt/sources.list will show it) Back to top |
|||||
anticapitalista, note the thread you are posting in.
inxi is not smxi, so I suggest reposting this topic in the smxi feature request thread or I'll just forget about it. Back to top |
|||||
I know it is the inxi thread.
I thought it might be useful as part of inxi to have it show the sources.list as well as often on irc people are asked to post their sources.list. Back to top |
|||||
ah, I see, I missed your point, thanks for clearing it up. Keep in mind that sources are only in sources.list or sources.list.d sub files in debian type distros, and that sources can be in multiple files even in debian, for debian derived distros, so that's not quite as easy as you think it might be. But it's an idea.
Has to do the following: not show commented lines or null lines, show files sources are in. Overall a feature needs to work on all major distros, not just one though, so I think it's best to wait and collect data for all main distros before implementing such a feature. :: Code :: cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2>/dev/null | grep -Ev '(^[[:space:]]*$|^[[:space:]]*#)'shows all current active repos in sources.list and sub files. Or simpler, with output of which file each item is in: :: Code :: grep -Esv '(^$|^[[:space:]]*#)' /etc/apt/sources.list /etc/apt/sources.list.d/*.listBack to top |
|||||
Thanks for thinking about the feature. I didn't know that there were other places for repos outside /etc/apt/sources.list(.d). You mean there are other disros besides Debian (based) ones ;) ??
:: Code ::
grep -Esv '(^$|^[[:space:]]*#)' /etc/apt/sources.list /etc/apt/sources.list.d/*.list is very nice on Debian-based distros. Back to top |
|||||
because this is fairly easy to do, and because debian derived distros like ubuntu make up a big chunk of the market, I added this feature now for inxi 1.2.0.
Outputs with -r option (r for repo) in a nicely ordered list, with filename first, then each active line, ie, not commented out or blank, printed below it. If more than one sources.list file is active, this will show it easily. Note: this does not show with -F option since it's so specialized, and it will show an error message letting non debian based distro users know that feature isn't yet supported for their distro, but over time I guess we can add in the rpm ones and arch and gentoo and a few others. But let's face it, probably 80% of distro users are running an ubuntu/debian derived distro now anyway, that's my guess anyway, so adding support for that many all at once is worth it even if it's not perfect. Back to top |
|||||
Upgraded inxi to 1.2.1 and the feature works as it should on antiX.
:: Code :: antiX@antiX-M8:~$ inxi -r
Repos: Contents of apt sources file: /etc/apt/sources.list deb http://ftp.de.debian.org/debian/ unstable main contrib non-free deb http://www.debian-multimedia.org/ unstable main deb http://ftp.de.debian.org/debian/ testing main contrib non-free deb http://fr1.mepis-deb.org/mepis/ mepis-8.0 main deb http://deb.opera.com/opera/ sid non-free deb http://download.virtualbox.org/virtualbox/debian/ lenny non-free deb http://www.geekconnection.org/remastersys/repository debian/ deb http://liquorix.net/debian/ sid main Contents of apt sources file: /etc/apt/sources.list.d/google-chrome.list deb http://dl.google.com/linux/deb/ stable main Thanks for including this h2. Back to top |
|||||
If your interested, Fedora puts it repo info in /etc/yum.repos.d/
"yum repolist" prints it out in this format: :: Code :: repo id repo name status
adobe-linux-i386 Adobe Systems Incorporated enabled: 17 chromium Chromium Test Packages enabled: 12 fedora Fedora 11 - i386 enabled: 13,289 livna rpm.livna.org for 11 - i386 enabled: 3 rpmfusion-free RPM Fusion for Fedora 11 - Free enabled: 377 rpmfusion-free-updates RPM Fusion for Fedora 11 - Free - Updates enabled: 601 rpmfusion-nonfree RPM Fusion for Fedora 11 - Nonfree enabled: 110 rpmfusion-nonfree-updates RPM Fusion for Fedora 11 - Nonfree - Updates enabled: 372 updates Fedora 11 - i386 - Updates enabled: 5,664 repolist: 20,445 This contents of each .repo file can be filled with multiple listings, such as the fedora.repo: :: Code :: [fedora]
protect=yes protect=yes name=Fedora $releasever - $basearch failovermethod=priority #baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/ mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch enabled=1 metadata_expire=7d gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch [fedora-debuginfo] protect=yes protect=yes name=Fedora $releasever - $basearch - Debug failovermethod=priority #baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/ mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch enabled=0 metadata_expire=7d gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch [fedora-source] protect=yes protect=yes name=Fedora $releasever - Source failovermethod=priority #baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/ mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch enabled=0 metadata_expire=7d gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch or as simple as chromium.repo :: Code :: [chromium]
name=Chromium Test Packages baseurl=http://spot.fedorapeople.org/chromium/F11/ enabled=1 gpgcheck=0 If this is just to much to make it work outside Debian, I'd understand. Back to top |
|||||
added in a feature to put in a space to any url when the repo is shown in an irc client, that avoids some bots showing the url page title under each line, which is annoying for doing debugging of repo information.
So for any irc client it will show: :: Code :: deb http: //ftp.de.debian.org/debian/ unstable main contrib non-freenote the space after http: that breaks the automated url detections in some irc channels, bots etc. For console terminal it won't add that space, so you can see the real data raw. A few bug fixes, and now it's 1.2.2 goineasy so it's .repo always? That's reasonably doable I guess, but trickier to parse the data unless you use the yum tool, which might not always be there, don't know. Parsing those types of config files is harder than a simple grep though, unfortunately, you have to build the string with awk, it's a pain. I'll hold off on those for a while because that kind of awk is hard to do, but with that model it should be fine I guess. Has to be awk because it's reading a block of text, not a line, as far as I know, we need that done with awk, which is a pain to do. Back to top |
|||||
yes...it's .repo always. Although there are some files that end in .repo.rpmsave and .repo.rpmnew, but they don't come up in yum repolist. I'll research what they are exactly and re-post. They seem to be dups of the .repo files of the same name. At the moment googling doesn't give me any other explanations.
Back to top |
|||||
All times are GMT - 8 Hours
|