Pages

Showing posts with label command-line. Show all posts
Showing posts with label command-line. Show all posts

Tuesday, April 14, 2015

Have yaourt save compiled packages to /var/cache/pacman/pkg

   The title of this post might not mean much to most of you, but for those few lucky enough to use Arch Linux on a daily basis, this could be of use to you. By default, yaourt does not keep the package files it produces, it deletes them after installation. Since the AUR deals mostly with unsupported packages, making it imperative that you be able to roll back to older packages, this is not useful default behaviour.
   To have yaourt export your compiled packages to the standard location, /var/cache/pacman/pkg/, edit /etc/yaourtrc and change the line
#EXPORT=0
to
EXPORT=2
That is all. Have a nice day!

Thursday, February 2, 2012

Corrrupted SVN repo and the solution

   I'm currently taking a Numerical Physics course at U. Laval. So far, it has been a really enjoyable experience. However, I would like to share some technical know-how I acquired while working on one of the projects.
   We are mostly using MATLAB (I personally use Octave, which is the open-source counterpart) to do the projects. As of the fourth project, I am working with a partner, which immediately lead to the classic problem: how do we share the code?
    Of course, this problem has been solved in thousands of ways. I chose to create an account on SourceForge (I don't have my own server, so it was the easiest way) and start a project where I could dump the all the code in an SVN repository. (By the way, all the code we write, for what it's worth, is Creative Commons.)
   Everything went well; up till yesterday. For some obscure reason, when I tried to svn up in the morning, svn returned the error 
Reading one svndiff window read beyond the end of the representation.
which I didn't know about. Some Googling informed me that the repository was corrupted.  Some more Googling revealed a SourceForge support page that gave a solution to the problem.
   Okay, so here's the complete solution. You log on to the Shell SourceForge provide and run the following commands:

adminrepo --checkout svn
svnadmin dump -r 0:92 /svnroot/projectName/ > ~/repo.dump
The adminrepo checks out the SVN repo of your project in a folder that you can modify. You then dump the repo (I used -r 0:92 because I knew the repo was sane at rev 92 and because I had manually merged the diffs of -r 93:95 in my working directory).
   Now, if you're sure you have a good backup, you can delete the repo. We will then create a new one and load the dump file into this new repo.

rm -rf /svnroot/projectName/
svnadmin create /svnroot/projectName
adminrepo --save svn
Now half the fun is done. The repo is back in the main folder (which you can't modify directly) and your DB should be un-corrupted (or whatever).
   If you're using the new SourceForge bashboard, you can't stop here. You have to tell the dashboard that you've made some drastic changes to the repo. In the SourceForge web interface, navigate to Admin → Tools. Under the SVN tool, click on Import Repo. Enter the following URL:
https://projectName.svn.sourceforge.net/svnroot/projectName

click Import and you're done! 

Please inform me in the comments is something is unclear or just plain wrong. Thanks!

Wednesday, August 10, 2011

Removing files from working directory not under version control

   I've been using SVN since the beginning of summer and I'm liking it so far. However, I stumbled across a little problem this week.

    I use SVN to write a LaTeX document which spans multiple files. Being textual, the contents of the .tex files are diff-able and all the features of SVN can be used. However, when I compile the document to have a nice PDF file, a plethora of files are simultaneously created. I don't want to put these files under version control. I hear you say: "Well, do not add them to your repository, then!". Fair enough, here's the result of a svn st:
Cluttered up svn st. I hate cluttered 
I hate cluttered things! Now, the easy solution is to remove all files you do want to put under version control, marked by a '?'. You always the manual way, i.e. rm file1 file2 file3 ... fileX but that's cumbersome. Let's use some of our bash knowledge to solve this problem. 

WARNING. The following command will remove all files marked with a '?'. Be careful with it!

rm `svn st | grep ?`

Simple enough, huh?