How to rename a directory in a quilt patch? - patch

I want to create a patch using quilt in which there is a directory rename. But quilt add seems to support just files.
If I should use quilt add <old_dir>/* then how can I add the renamed directory to my quilt patch? Invoking quilt add <new_dir> before creating it, gives me an error like this (here the <new_dir> name is _include, the <old_dir> name is include and the patch name is 0001-fix-cross-compile.patch:
$ quilt add _include/
/usr/share/quilt/scripts/backup-files: line 104: .pc/0001-fix-cross-compile.patch/_include/: Is a directory
Failed to back up file _include/
If I use the command without trailing /:
$ quilt add _include
File _include added to patch 0001-fix-cross-compile.patch
Which is not what I mean.
If I first create the directory:
$ mkdir _include
$ quilt add _include
cp: omitting directory '_include'
Failed to back up file _include
How can I add the new directory to my patch?
Thank you.

Related

Add new directory within subdirectory using CVS

How does one add a new directory within a subdirectory using a CVS repository?
cvs add [new_dir_name]
simply creates a new directory on the first level of the repository, while going into the subdirecory I am interested in and adding does not work. i.e.L
cd repository/directory
cvs add [new_dir_name]
Produces an error:
cvs [add aborted]: there is no version here; do 'cvs checkout' first
(This error message, though, still happens when I check out the repository).
Any ideas how to do this?
cd repository
mkdir a
mkdir a/b
mdkdir a/b/c
cvs update -d a/b/c ( not sure if in one go works, if not, try one after another)
The option -d will create directories that are missing. The same should work for add, if you cvs update afterwards and commit to persist it.
Personally I would use git or svn - changed from cvs ~10y ago
You must add each directory in the path to the final subdirectory that is not present on the server in descending oder.
For example...
If you are in the root of your cvs repository, the following should work.
mkdir -p dirname/subdirname
cvs add dirname
cvs add dirname/subdirname
alternately / equivalently
mkdir -p dirname/subdirname
cvs add dirname
cd dirname
cvs add subdirname

Unix mv command: Incorrectly type '.:' instead of target folder

While moving folders using the mv command (Unix) I incorrectly specified the target folder of the copy with .: instead of the path I wanted.
meaning instead of:
mv ./folder/to/move/ ./target/folder/
I typed:
mv ./folder/to/move/ .:
The command moved the folder somewhere. How can I find this location?
The command created a folder named .: in the current folder.
As the name starts with a . it's invisible with a simple ls check.
A cd .: move you to it.
(Note: I used find to look for the folder and found a match with a folder name .:.)

How to not ignore in Laravel storage/app/mydir/myfile.json

I am having a problem with gitignore in Laravel 5.3.
I have the following gitignore file. I used ! to exclude myfile.json.
node_modules/
public/storage
storage/*.key
/.idea
Homestead.json
Homestead.yaml
.env
SQL/
*.sql
mynotes.md
!storage/app/mydir/myfile.json
When I run git status --ignored I get this outputs.
Ignored files:
(use "git add -f <file>..." to include in what will be committed)
../.env
../SQL/
../app/.DS_Store
../bootstrap/cache/config.php
../bootstrap/cache/services.php
../mynotes.md
../node_modules/
uploads/.DS_Store
../storage/app/.DS_Store
../storage/app/mydir/
...
...
So myfile.json is ignored. How can I write a gitignore so that I can add/commit a file?
The rule to remember with gitignore:
It is not possible to re-include a file if a parent directory of that file is excluded.
So check which .gitignore rule actually does ignore ../storage/app/mydir/, because if it is a .gitignore located (for instance) directly in /storage/app/, it will have precedence.
git check-ignore -v -- ../storage/app/mydir/myfile.json
../ means your current .gitignore is not in the right place: for a !storage/app/mydir/xxx rule to apply, it should be in a .gitignore file one folder up.

Can't drop a folder in Unix

I was trying to create some folders from a text file (arbo.txt which contains a list of directories) using:
xargs --verbose -d\n mkdir -p < /applis/arbo.txt
I guess the -d\n is not correct since I got other folders than those in arbo.txt file.
The problem is that now I'm not able to drop these folders, I tried:
rm f
rm -rf f
There are no errors, but the folder is not dropped (I can see it using ls), and when I try:
cd f
I get:
-ksh: cd: f: [No such file or directory]
Edit:
using ls I can see that the folder name is: f?.
How can I drop this folder?
Thanks
Try to use:
> xargs -n1 mkdir -p < dirs.txt
Otherwise, help out with some info on f:
> ls -l f
> file f
If what appears as f contains unprintable characters, using the file name expansion of the shell may save you the trouble to figure them out exactly. Be careful not to delete other important files that match the same name pattern!
rm -rf f*
In you command it add the ? to the folder name f. You can use the below to delete the file.
rm -rf f\?
UPDATE:-
rm -rf '<file name >'
The file name is,
All the contents in the arbo.txt file without any change.
Because your command creates only one folder with the name as all the contents in the arbo.txt file including the new line also. after that it add the ? to before each new line.
To get the folder name as easily, you can type starting name of the folder name and give tab. it give the full name of the folder.

shebang line not working in R script

I have the following script
#!/usr/bin/Rscript
print ("shebang works")
in a file called shebang.r. When I run it from command line using Rscript it works
$ Rscript shebang.r
but when I run it from the command line alone
$ shebang.r
It doesn't work. shebang.r command not found.
If I type (based on other examples I've seen)
$ ./shebang.r
I get permission denied.
Yes, Rscript is located in /usr/bin directory
Make the file executable.
chmod 755 shebang.r
In addition to Sjoerd's answer... Only the directories listed in the environment variable PATH are inspected for commands to run. You need to type ./shebang.r (as opposed to just shebang.r) if the current directory, known as ., is not in your PATH.
To inspect PATH, type
echo $PATH
To add . to PATH, type
export PATH="$PATH:."
You can add this line to your ~/.bashrc to make it happen automatically if you open a new shell.

Resources