<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Schadenfreude &#187; gentoo</title>
	<atom:link href="http://www.ralree.com/tag/gentoo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ralree.com</link>
	<description>Malicious enjoyment derived from observing someone else's misfortune</description>
	<lastBuildDate>Thu, 09 Feb 2012 01:49:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Adding Progress Bars to cp and mv in Gutsy</title>
		<link>http://www.ralree.com/2007/11/11/adding-progress-bars-to-cp-and-mv-in-gutsy/</link>
		<comments>http://www.ralree.com/2007/11/11/adding-progress-bars-to-cp-and-mv-in-gutsy/#comments</comments>
		<pubDate>Sun, 11 Nov 2007 07:07:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[gutsy]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pain]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/11/11/adding-progress-bars-to-cp-and-mv-in-gutsy</guid>
		<description><![CDATA[Notice that I can do a -g for a progess bar! Yay! Now for an action shot: hank@rofl:~/tmp/coreutils-6.7$ cp -g coreutils_6.7-1_i386.deb /nexus/mod0/www/deb/binary/ coreutils_6.7-1_i386.deb &#124; 48% &#124; 3.2 MiB &#124; 118 KiB/s &#124; ETA The Easy Way Hopefully coming soon&#8230; The Hard Way WARNING! PROCEED AT YOUR OWN RISK! THIS BROKE MY SYSTEM AND I WENT BACK TO THE DEFAULT COREUTILS PACKAGE Get coreutils 6.7 Get the corresponding patches Edit patch/generic/001_all_coreutils-gen-progress-bar.patch with vim: :%s/coreutils\///g Patch the tree with patch -p0 &#60; [...]]]></description>
			<content:encoded><![CDATA[<p>Notice that I can do a <strong><em>-g</strong></em> for a progess bar!  Yay!  Now for an <strong>action shot</strong>:</p>
<pre><code>
hank@rofl:~/tmp/coreutils-6.7$ cp -g coreutils_6.7-1_i386.deb /nexus/mod0/www/deb/binary/
coreutils_6.7-1_i386.deb         |  48% |   3.2 MiB |   118 KiB/s | ETA
</code></pre>
<p>            <span id="more-4763"></span></p>
<h2>The Easy Way</h2>
<p><strong>Hopefully coming soon&#8230;</strong></p>
<h2>The Hard Way</h2>
<h3><span style="color: #F00;">WARNING!  PROCEED AT YOUR OWN RISK!  THIS BROKE MY SYSTEM AND I WENT BACK TO THE DEFAULT COREUTILS PACKAGE</span></h3>
<ul>
<li>
<p>Get <a href="http://ftp.gnu.org/pub/gnu/coreutils/">coreutils 6.7</a></p>
</li>
<li>
<p>Get <a href="http://dev.gentoo.org/~vapier/dist/">the corresponding patches</a></p>
</li>
<li>
<p>Edit <code>patch/generic/001_all_coreutils-gen-progress-bar.patch</code> with vim:</p>
</li>
</ul>
<pre><code>
:%s/coreutils\///g
</code></pre>
<ul>
<li>
<p>Patch the tree with <code>patch -p0 &lt; patch/generic/001_all_coreutils-gen-progress-bar.patch</code></p>
</li>
<li>
<p>Run a magical loop:</p>
</li>
</ul>
<pre><code>
# From http://ubuntuforums.org/showpost.php?p=3691686&#038;postcount=2
for file in src/{copy,touch}.c lib/utimens.{c,h} ; do \
   cp -v $file{,.orig}
   sed 's/futimens/gl_&#038;/' $file.orig &gt; $file
done
</code></pre>
<ul>
<li><code>./configure --prefix=/ &amp;&amp; make &amp;&amp; sudo checkinstall</code></li>
<li>Restart your terminal</li>
</ul>
<p>Make sure you don&#8217;t completely hose your system and end up having to do this:</p>
<pre><code>
hank@rofl:~/tmp/coreutils-6.7/src$ sudo ./cp rm cp mv /bin/
</code></pre>
<p>Yes, that&#8217;s me using the cp binary from the current working directory to copy itself and some friends to <code>/bin</code> to resurrect my coreutils&#8230;</p>
<p>Also, I found out that there is a core package that externally manages the <code>hostname</code> command exclusively, and <code>dpkg</code> whines when you try to overwrite it with the awesome <code>coreutils</code> one.  I don&#8217;t currently know how to make <code>dpkg</code> just do it&#8217;s job.  Here&#8217;s the output:</p>
<pre><code>
hank@rofl:~/tmp/coreutils-6.7$ sudo dpkg -i coreutils_6.7-1_i386.deb
(Reading database ... 235274 files and directories currently installed.)
Preparing to replace coreutils 5.97-5.3ubuntu3 (using coreutils_6.7-1_i386.deb) ...
Unpacking replacement coreutils ...
dpkg: error processing coreutils_6.7-1_i386.deb (--install):
 trying to overwrite `/bin/hostname', which is also in package hostname
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
 coreutils_6.7-1_i386.deb
</code></pre>
<p>If I can get that small bug fixed, I can actually implement the <strong>Easy Way</strong>.  I ended up conceeding to a dirty, <strong><em>dirty</strong></em> <code>make install</code>.  I also found out that you need a <strong>Depends:</strong> entry in each deb package even if it just contains <code>bash</code>.  Apt is apparently pretty stupid about parsing Package files from repositories.</p>
<h2>The Result</h2>
<pre><code>
hank@rofl:~$ mv --help
Usage: mv [OPTION]... [-T] SOURCE DEST
  or:  mv [OPTION]... SOURCE... DIRECTORY
  or:  mv [OPTION]... -t DIRECTORY SOURCE...
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.

Mandatory arguments to long options are mandatory for short options too.
      --backup[=CONTROL]       make a backup of each existing destination file
  -b                           like --backup but does not accept an argument
  -f, --force                  do not prompt before overwriting
  -g, --progress               show a progress bar if operation is going to
                                 take a long time
# ...
</code></pre>
<p>Notice that I can do a <strong><em>-g</strong></em> for a progess bar!  Yay!  Now for an <strong>action shot</strong>:</p>
<pre><code>
hank@rofl:~/tmp/coreutils-6.7$ cp -g coreutils_6.7-1_i386.deb /nexus/mod0/www/deb/binary/
coreutils_6.7-1_i386.deb         |  48% |   3.2 MiB |   118 KiB/s | ETA
</code></pre>
<h2>And then I rebooted</h2>
<p>I rebooted, and all hell broke loose.  I couldn&#8217;t get permissions for various devices in /dev, etc.  There must be some dependency on ubuntu or debian patches in the boot process.  Yuck.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/11/11/adding-progress-bars-to-cp-and-mv-in-gutsy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

